on xenial help sign in
stabilize tests
fbcdf2eLukáš Tinkl
tests/mocks/Unity/Indicators/IndicatorsModel.qml+2−2
@@ -99,12 +99,12 @@ Indicators.FakeIndicatorsModel {
99
99
100 Component.onCompleted: {
100 Component.onCompleted: {
101 // init data for the fake indicator-keyboard
101 // init data for the fake indicator-keyboard
102− MockInputDeviceBackend.addMockDevice("/kbd0", InputInfo.Keyboard);
102+ MockInputDeviceBackend.addMockDevice("/indicator_kbd0", InputInfo.Keyboard);
103 AccountsService.keymaps = ["us", "cs"];
103 AccountsService.keymaps = ["us", "cs"];
104 }
104 }
105
105
106 Component.onDestruction: {
106 Component.onDestruction: {
107− MockInputDeviceBackend.removeDevice("/kbd0");
107+ MockInputDeviceBackend.removeDevice("/indicator_kbd0");
108 AccountsService.keymaps = ["us"];
108 AccountsService.keymaps = ["us"];
109 }
109 }
110
110
tests/qmltests/Panel/tst_IndicatorItemRow.qml+3−3
@@ -196,7 +196,7 @@ IndicatorTest {
196 verify(dataItem !== null);
196 verify(dataItem !== null);
197
197
198 indicatorsRow.selectItemAt(dataItem.x + dataItem.width/2);
198 indicatorsRow.selectItemAt(dataItem.x + dataItem.width/2);
199− compare(indicatorsRow.currentItem, dataItem);
199+ tryCompare(indicatorsRow, "currentItem", dataItem);
200 }
200 }
201
201
202 // tests item default selection (no item at position X)
202 // tests item default selection (no item at position X)
@@ -303,9 +303,9 @@ IndicatorTest {
303 var item = findChild(indicatorsRow, "indicator-keyboard-panelItem");
303 var item = findChild(indicatorsRow, "indicator-keyboard-panelItem");
304 AccountsService.keymaps = data.keymaps;
304 AccountsService.keymaps = data.keymaps;
305 if (data.keyboard) {
305 if (data.keyboard) {
306− MockInputDeviceBackend.addMockDevice("/kbd0", InputInfo.Keyboard);
306+ MockInputDeviceBackend.addMockDevice("/indicator_kbd0", InputInfo.Keyboard);
307 } else {
307 } else {
308− MockInputDeviceBackend.removeDevice("/kbd0");
308+ MockInputDeviceBackend.removeDevice("/indicator_kbd0");
309 }
309 }
310
310
311 compare(item.hidden, data.hidden);
311 compare(item.hidden, data.hidden);
tests/qmltests/Panel/tst_IndicatorsBar.qml+3−5
@@ -136,8 +136,7 @@ IndicatorTest {
136 }
136 }
137
137
138 function wait_for_expansion_to_settle() {
138 function wait_for_expansion_to_settle() {
139− tryCompare(heightAnimation, "running", false);
139+ waitUntilTransitionsEnd(indicatorsBar);
140− wait(UbuntuAnimation.SnapDuration); // put a little extra wait in for things to settle
141 }
140 }
142
141
143 // Rough check that expanding a selected item keeps it within the area of the original item.
142 // Rough check that expanding a selected item keeps it within the area of the original item.
@@ -151,7 +150,6 @@ IndicatorTest {
151 indicatorsBar.expanded = true;
150 indicatorsBar.expanded = true;
152 wait_for_expansion_to_settle();
151 wait_for_expansion_to_settle();
153
152
154−
155 // mappedPosition contained within mappedRect
153 // mappedPosition contained within mappedRect
156 tryCompareFunction(function() {
154 tryCompareFunction(function() {
157 var mappedRect = indicatorsBar.mapFromItem(dataItem, 0, 0, dataItem.width, dataItem.height);
155 var mappedRect = indicatorsBar.mapFromItem(dataItem, 0, 0, dataItem.width, dataItem.height);
@@ -203,8 +201,8 @@ IndicatorTest {
203
201
204 function test_visibleIndicators_data() {
202 function test_visibleIndicators_data() {
205 return [
203 return [
206− { visible: [true, false, true, false, true, true] },
204+ { visible: [true, false, true, false, true, true, false, true] },
207− { visible: [false, false, false, false, false, false] }
205+ { visible: [false, false, false, false, false, false, true, false] }
208 ];
206 ];
209 }
207 }
210
208
tests/qmltests/Panel/tst_IndicatorsMenu.qml+4−3
@@ -219,8 +219,8 @@ IndicatorTest {
219 mappedPosition.x, indicatorsMenu.openedHeight / 2,
219 mappedPosition.x, indicatorsMenu.openedHeight / 2,
220 true /* beginTouch */, false /* endTouch */);
220 true /* beginTouch */, false /* endTouch */);
221
221
222− compare(indicatorItemRow.currentItem, indicatorItem,
222+ tryCompare(indicatorItemRow, "currentItem", indicatorItem, undefined /*timeout, default */,
223− "Incorrect item activated at position " + i);
223+ "Incorrect item activated at position " + i);
224
224
225 touchFlick(indicatorItemRow,
225 touchFlick(indicatorItemRow,
226 mappedPosition.x, indicatorsMenu.openedHeight / 2,
226 mappedPosition.x, indicatorsMenu.openedHeight / 2,
@@ -265,7 +265,8 @@ IndicatorTest {
265 false /* beginTouch */, false /* endTouch */,
265 false /* beginTouch */, false /* endTouch */,
266 units.gu(50) /* speed */, 5 /* iterations */); // more samples needed for accurate velocity
266 units.gu(50) /* speed */, 5 /* iterations */); // more samples needed for accurate velocity
267
267
268+ tryCompare(indicatorItemRow, "currentItem", firstItem, undefined /* timeout, default */,
268− compare(indicatorItemRow.currentItem, firstItem, "First indicator should still be the current item");
269+ "First indicator should still be the current item");
269 // after waiting in the same spot with touch down, it should update to the next item.
270 // after waiting in the same spot with touch down, it should update to the next item.
270 tryCompare(indicatorItemRow, "currentItem", nextItem);
271 tryCompare(indicatorItemRow, "currentItem", nextItem);
271
272