on xenial help sign in
fixup failing tests
9f83b28Lukáš Tinkl
qml/Panel/IndicatorItemRow.qml−1
@@ -199,7 +199,6 @@ Item {
199 // HACK for indicator-keyboard
199 // HACK for indicator-keyboard
200 readonly property bool hideKeyboardIndicator: identifier == "indicator-keyboard" && (AccountsService.keymaps.length < 2 || keyboardsModel.count == 0)
200 readonly property bool hideKeyboardIndicator: identifier == "indicator-keyboard" && (AccountsService.keymaps.length < 2 || keyboardsModel.count == 0)
201
201
202−
203 height: row.height
202 height: row.height
204 expanded: root.expanded
203 expanded: root.expanded
205 selected: currentItem === this
204 selected: currentItem === this
tests/mocks/Unity/Indicators/IndicatorsModel.qml+13
@@ -16,6 +16,8 @@
16
16
17import QtQuick 2.4
17import QtQuick 2.4
18import Unity.Indicators 0.1 as Indicators
18import Unity.Indicators 0.1 as Indicators
19+import Unity.InputInfo 0.1
20+import AccountsService 0.1
19
21
20Indicators.FakeIndicatorsModel {
22Indicators.FakeIndicatorsModel {
21 id: root
23 id: root
@@ -95,6 +97,17 @@ Indicators.FakeIndicatorsModel {
95 }
97 }
96 ]
98 ]
97
99
100+ Component.onCompleted: {
101+ // init data for the fake indicator-keyboard
102+ MockInputDeviceBackend.addMockDevice("/kbd0", InputInfo.Keyboard);
103+ AccountsService.keymaps = ["us", "cs"];
104+ }
105+
106+ Component.onDestruction: {
107+ MockInputDeviceBackend.removeDevice("/kbd0");
108+ AccountsService.keymaps = ["us"];
109+ }
110+
98 function load(profile) {
111 function load(profile) {
99 unload();
112 unload();
100 root.modelData = originalModelData;
113 root.modelData = originalModelData;
tests/qmltests/Panel/tst_IndicatorItemRow.qml+3−5
@@ -131,11 +131,6 @@ IndicatorTest {
131 wait(1); // row seems to take a bit of time for item x values to update.
131 wait(1); // row seems to take a bit of time for item x values to update.
132 }
132 }
133
133
134− function cleanup() {
135− AccountsService.keymaps = [];
136− MockInputDeviceBackend.removeDevice("/kbd0");
137− }
138−
139 function wait_for_expansion_to_settle() {
134 function wait_for_expansion_to_settle() {
140 tryCompare(heightAnimation, "running", false);
135 tryCompare(heightAnimation, "running", false);
141 wait(200); // put a little extra wait in for things to settle
136 wait(200); // put a little extra wait in for things to settle
@@ -309,7 +304,10 @@ IndicatorTest {
309 AccountsService.keymaps = data.keymaps;
304 AccountsService.keymaps = data.keymaps;
310 if (data.keyboard) {
305 if (data.keyboard) {
311 MockInputDeviceBackend.addMockDevice("/kbd0", InputInfo.Keyboard);
306 MockInputDeviceBackend.addMockDevice("/kbd0", InputInfo.Keyboard);
307+ } else {
308+ MockInputDeviceBackend.removeDevice("/kbd0");
312 }
309 }
310+
313 compare(item.hidden, data.hidden);
311 compare(item.hidden, data.hidden);
314 }
312 }
315 }
313 }