@@ -1,143 +0,0 @@
2− * Copyright 2013 Canonical Ltd.
4− * This program is free software; you can redistribute it and/or modify
5− * it under the terms of the GNU General Public License as published by
6− * the Free Software Foundation; version 3.
8− * This program is distributed in the hope that it will be useful,
9− * but WITHOUT ANY WARRANTY; without even the implied warranty of
10− * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11− * GNU General Public License for more details.
13− * You should have received a copy of the GNU General Public License
14− * along with this program. If not, see <http://www.gnu.org/licenses/>.
19−import "../../../qml/Dash/Video"
20−import Ubuntu.Components.ListItems 0.1 as ListItem
21−import Ubuntu.Components 0.1
22−import Unity.Test 0.1 as UT
27− width: gridRect.width + controls.width
34− height: parent.height
35− anchors.top: parent.top
36− anchors.right: parent.right
41− text: "Clicked item: [none]"
42− anchors {left: parent.left; right: parent.right; margins: units.gu(1) }
45− model: testCase.test_clicked_signal_data()
47− anchors {left: parent.left; right: parent.right; margins: units.gu(1) }
48− text: testCase.test_clicked_signal_data()[index].tag
49− onClicked: gridLoader.source = "../../../qml/Dash/" + testCase.test_clicked_signal_data()[index].component
56− ListElement { icon: "../../graphics/clock.png"; title: "Item0"; comment: ""; uri: "dummy.desktop"; dndUri: "dummy.desktop" }
57− ListElement { icon: "../../graphics/clock.png"; title: "Item1"; comment: ""; uri: "dummy.desktop"; dndUri: "dummy.desktop" }
58− ListElement { icon: "../../graphics/clock.png"; title: "Item2"; comment: ""; uri: "dummy.desktop"; dndUri: "dummy.desktop" }
59− ListElement { icon: "../../graphics/clock.png"; title: "Item3"; comment: ""; uri: "dummy.desktop"; dndUri: "dummy.desktop" }
60− ListElement { icon: "../../graphics/clock.png"; title: "Item4"; comment: ""; uri: "dummy.desktop"; dndUri: "dummy.desktop" }
61− ListElement { icon: "../../graphics/clock.png"; title: "Item5"; comment: ""; uri: "dummy.desktop"; dndUri: "dummy.desktop" }
62− ListElement { icon: "../../graphics/clock.png"; title: "Item6"; comment: ""; uri: "dummy.desktop"; dndUri: "dummy.desktop" }
63− ListElement { icon: "../../graphics/clock.png"; title: "Item7"; comment: ""; uri: "dummy.desktop"; dndUri: "dummy.desktop" }
64− ListElement { icon: "../../graphics/clock.png"; title: "Item8"; comment: ""; uri: "dummy.desktop"; dndUri: "dummy.desktop" }
65− ListElement { icon: "../../graphics/clock.png"; title: "Item9"; comment: ""; uri: "dummy.desktop"; dndUri: "dummy.desktop" }
66− ListElement { icon: "../../graphics/clock.png"; title: "Item10"; comment: ""; uri: "dummy.desktop"; dndUri: "dummy.desktop" }
67− ListElement { icon: "../../graphics/clock.png"; title: "Item11"; comment: ""; uri: "dummy.desktop"; dndUri: "dummy.desktop" }
68− ListElement { icon: "../../graphics/clock.png"; title: "Item12"; comment: ""; uri: "dummy.desktop"; dndUri: "dummy.desktop" }
69− ListElement { icon: "../../graphics/clock.png"; title: "Item13"; comment: ""; uri: "dummy.desktop"; dndUri: "dummy.desktop" }
70− ListElement { icon: "../../graphics/clock.png"; title: "Item14"; comment: ""; uri: "dummy.desktop"; dndUri: "dummy.desktop" }
71− ListElement { icon: "../../graphics/clock.png"; title: "Item15"; comment: ""; uri: "dummy.desktop"; dndUri: "dummy.desktop" }
72− ListElement { icon: "../../graphics/clock.png"; title: "Item16"; comment: ""; uri: "dummy.desktop"; dndUri: "dummy.desktop" }
73− ListElement { icon: "../../graphics/clock.png"; title: "Item17"; comment: ""; uri: "dummy.desktop"; dndUri: "dummy.desktop" }
74− ListElement { icon: "../../graphics/clock.png"; title: "Item18"; comment: ""; uri: "dummy.desktop"; dndUri: "dummy.desktop" }
75− ListElement { icon: "../../graphics/clock.png"; title: "Item19"; comment: ""; uri: "dummy.desktop"; dndUri: "dummy.desktop" }
81− height: parent.height
83− anchors.top: parent.top
84− anchors.left: parent.left
92− item.model = fakeModel
98− target: gridLoader.item
99− onClicked: spyLabel.text = "Clicked index: " + index
108− function test_clicked_signal_data() {
110− {tag: "VideoFilterGrid", component: "Video/VideoFilterGrid.qml"},
111− {tag: "MusicFilterGrid", component: "Music/MusicFilterGrid.qml"}
115− function test_clicked_signal(data) {
116− gridLoader.source = "";
117− gridLoader.source = "../../../qml/Dash/" + data.component;
119− // Wait until the FilterGrid is loaded by the loader
120− tryCompare(gridLoader, "status", Loader.Ready);
122− // Wait until the GridView inside the model has finished rendering
123− var gridView = findChild(gridLoader, "responsiveGridViewGrid");
124− gridView.forceLayout();
125− waitForRendering(gridView);
128− var tile1 = findChild(gridLoader.item, "delegate1");
129− verify(tile1 !== undefined, "delegate1 wasn't found");
131− mouseClick(tile1, tile1.width/2, tile1.height/2);
133− // Check emission of clicked() signal with the according index as argument
134− compare(clickedSpy.signalArguments[0][0], 1, "Clicked index is not the same as the one actually clicked")
140− signalName: "clicked"
141− target: gridLoader.item