@@ -17,14 +17,14 @@
17import QtQuick 2.4
17import QtQuick 2.4
18import QtQuick.Layouts 1.1
18import QtQuick.Layouts 1.1
19import QtTest 1.0
19import QtTest 1.0
20−import "../../../qml/Panel"
21import Ubuntu.Components 1.3
20import Ubuntu.Components 1.3
22import Unity.Test 0.1 as UT
21import Unity.Test 0.1 as UT
23−import Unity.Indicators 0.1 as Indicators
24import AccountsService 0.1
22import AccountsService 0.1
25import Unity.InputInfo 0.1
23import Unity.InputInfo 0.1
24+import "../../../qml/Panel"
25+import "../../../qml/Panel/Indicators"
27−IndicatorTest {
27+PanelTest {
29 width: units.gu(120)
29 width: units.gu(120)
30 height: units.gu(40)
30 height: units.gu(40)
@@ -45,7 +45,7 @@ IndicatorTest {
45 anchors.fill: indicatorsRow
45 anchors.fill: indicatorsRow
48− IndicatorItemRow {
48+ PanelItemRow {
49 id: indicatorsRow
49 id: indicatorsRow
50 height: expanded ? units.gu(7) : units.gu(3)
50 height: expanded ? units.gu(7) : units.gu(3)
51 anchors.centerIn: parent
51 anchors.centerIn: parent
@@ -59,6 +59,16 @@ IndicatorTest {
62+ delegate: IndicatorItem {
63+ property int ownIndex: index
64+ property string identifier: model.identifier
66+ objectName: identifier + "-panelItem"
69+ icons: [ "image://theme/settings" ]
62 MouseArea {
72 MouseArea {
64 anchors.fill: parent
74 anchors.fill: parent
@@ -165,8 +175,13 @@ IndicatorTest {
165 // test removals
175 // test removals
166 for (i = 0; i < root.originalModelData.length; i++) {
176 for (i = 0; i < root.originalModelData.length; i++) {
167 item = findChild(indicatorsRow, root.originalModelData[i]["identifier"] + "-panelItem");
177 item = findChild(indicatorsRow, root.originalModelData[i]["identifier"] + "-panelItem");
178+ console.log(item, i, root.originalModelData[i]["identifier"])
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");
183+ verify(item === null, "items not removed item should still be present");
172 // test insertion
187 // test insertion
@@ -287,28 +302,5 @@ IndicatorTest {
287 // should go back to 0
302 // should go back to 0
288 tryCompare(findChild(indicatorsRow, "highlight"), "highlightCenterOffset", 0);
303 tryCompare(findChild(indicatorsRow, "highlight"), "highlightCenterOffset", 0);
291− function test_hidingKeyboardIndicator_data() {
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 }
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);
308− MockInputDeviceBackend.removeDevice("/indicator_kbd0");
311− compare(item.hidden, data.hidden);