@@ -17,14 +17,14 @@
1717import QtQuick 2.4
1818import QtQuick.Layouts 1.1
1919import QtTest 1.0
20−import "../../../qml/Panel"
2120import Ubuntu.Components 1.3
2221import Unity.Test 0.1 as UT
23−import Unity.Indicators 0.1 as Indicators
2422import AccountsService 0.1
2523import Unity.InputInfo 0.1
24+import "../../../qml/Panel"
25+import "../../../qml/Panel/Indicators"
2626
27−IndicatorTest {
27+PanelTest {
2828 id: root
2929 width: units.gu(120)
3030 height: units.gu(40)
@@ -45,7 +45,7 @@ IndicatorTest {
4545 anchors.fill: indicatorsRow
4646 }
4747
48− IndicatorItemRow {
48+ PanelItemRow {
4949 id: indicatorsRow
5050 height: expanded ? units.gu(7) : units.gu(3)
5151 anchors.centerIn: parent
@@ -59,6 +59,16 @@ IndicatorTest {
5959 }
6060 }
6161
62+ delegate: IndicatorItem {
63+ property int ownIndex: index
64+ property string identifier: model.identifier
65+
66+ objectName: identifier + "-panelItem"
67+ width: units.gu(3)
68+ height: units.gu(3)
69+ icons: [ "image://theme/settings" ]
70+ }
71+
6272 MouseArea {
6373 id: ma
6474 anchors.fill: parent
@@ -165,8 +175,13 @@ IndicatorTest {
165175 // test removals
166176 for (i = 0; i < root.originalModelData.length; i++) {
167177 item = findChild(indicatorsRow, root.originalModelData[i]["identifier"] + "-panelItem");
178+ console.log(item, i, root.originalModelData[i]["identifier"])
168179
169− verify(data.remove.indexOf(i) !== -1 ? (item === null) : (item !== null));
180+ if (data.remove.indexOf(i) !== -1) {
181+ verify(item === null, "removed item should not be present");
182+ } else {
183+ verify(item === null, "items not removed item should still be present");
184+ }
170185 }
171186
172187 // test insertion
@@ -287,28 +302,5 @@ IndicatorTest {
287302 // should go back to 0
288303 tryCompare(findChild(indicatorsRow, "highlight"), "highlightCenterOffset", 0);
289304 }
290−
291− function test_hidingKeyboardIndicator_data() {
292− return [
293− { tag: "No keyboard, no keymap", keyboard: false, keymaps: [], hidden: true },
294− { tag: "No keyboard, one keymap", keyboard: false, keymaps: ["us"], hidden: true },
295− { tag: "No keyboard, 2 keymaps", keyboard: false, keymaps: ["us", "cs"], hidden: true },
296− { tag: "Keyboard, no keymap", keyboard: true, keymaps: [], hidden: true },
297− { tag: "Keyboard, one keymap", keyboard: true, keymaps: ["us"], hidden: true },
298− { tag: "Keyboard, 2 keymaps", keyboard: true, keymaps: ["us", "cs"], hidden: false }
299− ];
300− }
301−
302− function test_hidingKeyboardIndicator(data) {
303− var item = findChild(indicatorsRow, "indicator-keyboard-panelItem");
304− AccountsService.keymaps = data.keymaps;
305− if (data.keyboard) {
306− MockInputDeviceBackend.addMockDevice("/indicator_kbd0", InputInfo.Keyboard);
307− } else {
308− MockInputDeviceBackend.removeDevice("/indicator_kbd0");
309− }
310−
311− compare(item.hidden, data.hidden);
312− }
313305 }
314306}