@@ -28,7 +28,7 @@ Item {
2828
2929 property ListModel searchHistory: ListModel {}
3030
31− property var lens_status: {
31+ property var lensStatus: {
3232 'MockLens1': { 'movementStarted': 0, 'positionedAtBeginning': 0 },
3333 'MockLens2': { 'movementStarted': 0, 'positionedAtBeginning': 0 },
3434 'MockLens3': { 'movementStarted': 0, 'positionedAtBeginning': 0 },
@@ -41,53 +41,58 @@ Item {
4141 }
4242
4343 DashContent {
44− id: dash_content
44+ id: dashContent
4545 anchors.fill: parent
4646
4747 model: lensesModel
4848 lenses : lensesModel
4949
50− lensDelegateMapping: { "MockLens3" : "../tests/qmltests/Dash/qml/fake_lensView3.qml",
51− "MockLens2" : "../tests/qmltests/Dash/qml/fake_lensView2.qml",
52− "MockLens1" : "../tests/qmltests/Dash/qml/fake_lensView1.qml",
53− "MockLens4" : "../tests/qmltests/Dash/qml/fake_lensView4.qml"
54− }
50+ lensMapper : lensDelegateMapper
51+ }
5552
53+ LensDelegateMapper {
54+ id: lensDelegateMapper
55+ lensDelegateMapping: {
56+ "MockLens1": "../tests/qmltests/Dash/qml/fake_lensView1.qml",
57+ "MockLens2": "../tests/qmltests/Dash/qml/fake_lensView2.qml",
58+ "MockLens3": "../tests/qmltests/Dash/qml/fake_lensView3.qml",
59+ "MockLens4": "../tests/qmltests/Dash/qml/fake_lensView4.qml"
60+ }
5661 genericLens: "../tests/qmltests/Dash/qml/fake_generic_lensView.qml"
5762 }
5863
5964 function clear_lens_status() {
60− lens_status["MockLens1"].movementStarted = 0;
61− lens_status["MockLens1"].positionedAtBeginning = 0;
65+ lensStatus["MockLens1"].movementStarted = 0;
66+ lensStatus["MockLens1"].positionedAtBeginning = 0;
6267
63− lens_status["MockLens2"].movementStarted = 0;
64− lens_status["MockLens2"].positionedAtBeginning = 0;
68+ lensStatus["MockLens2"].movementStarted = 0;
69+ lensStatus["MockLens2"].positionedAtBeginning = 0;
6570
66− lens_status["MockLens3"].movementStarted = 0;
67− lens_status["MockLens3"].positionedAtBeginning = 0;
71+ lensStatus["MockLens3"].movementStarted = 0;
72+ lensStatus["MockLens3"].positionedAtBeginning = 0;
6873
69− lens_status["MockLens4"].movementStarted = 0;
70− lens_status["MockLens4"].positionedAtBeginning = 0;
74+ lensStatus["MockLens4"].movementStarted = 0;
75+ lensStatus["MockLens4"].positionedAtBeginning = 0;
7176
72− lens_status["MockLens5"].movementStarted = 0;
73− lens_status["MockLens5"].positionedAtBeginning = 0;
77+ lensStatus["MockLens5"].movementStarted = 0;
78+ lensStatus["MockLens5"].positionedAtBeginning = 0;
7479 }
7580
7681 SignalSpy {
77− id: lensLoaded_spy
78− target: dash_content
82+ id: lensLoadedSpy
83+ target: dashContent
7984 signalName: "lensLoaded"
8085 }
8186
8287 SignalSpy {
83− id: movementStarted_spy
84− target: dash_content
88+ id: movementStartedSpy
89+ target: dashContent
8590 signalName: "movementStarted"
8691 }
8792
8893 SignalSpy {
89− id: contentEndReached_spy
90− target: dash_content
94+ id: contentEndReachedSpy
95+ target: dashContent
9196 signalName: "contentEndReached"
9297 }
9398
@@ -96,13 +101,13 @@ Item {
96101 when: windowShown
97102
98103 function init() {
99− lensLoaded_spy.clear();
100− movementStarted_spy.clear();
101− contentEndReached_spy.clear()
104+ lensLoadedSpy.clear();
105+ movementStartedSpy.clear();
106+ contentEndReachedSpy.clear()
102107 clear_lens_status();
103108
104109 // clear, wait for dahs to empty and load lenses.
105− var dashContentList = findChild(dash_content, "dashContentList");
110+ var dashContentList = findChild(dashContent, "dashContentList");
106111 verify(dashContentList != undefined)
107112 lensesModel.clear();
108113 tryCompare(dashContentList, "count", 0);
@@ -110,47 +115,47 @@ Item {
110115 }
111116
112117 function test_movement_started_signal() {
113− dash_content.setCurrentLensAtIndex(3, true, false);
118+ dashContent.setCurrentLensAtIndex(3, true, false);
114119
115− var dashContentList = findChild(dash_content, "dashContentList");
120+ var dashContentList = findChild(dashContent, "dashContentList");
116121 verify(dashContentList != undefined)
117− tryCompare(lensLoaded_spy, "count", 5);
122+ tryCompare(lensLoadedSpy, "count", 5);
118123
119124 dashContentList.movementStarted();
120− compare(movementStarted_spy.count, 1, "DashContent should have emitted movementStarted signal when content list did.");
121− compare(lens_status["MockLens1"].movementStarted, 1, "MockLens1 should have emitted movementStarted signal when content list did.");
122− compare(lens_status["MockLens2"].movementStarted, 1, "MockLens2 should have emitted movementStarted signal when content list did.");
123− compare(lens_status["MockLens3"].movementStarted, 1, "MockLens3 should have emitted movementStarted signal when content list did.");
124− compare(lens_status["MockLens4"].movementStarted, 1, "MockLens4 should have emitted movementStarted signal when content list did.");
125− compare(lens_status["MockLens5"].movementStarted, 1, "MockLens5 should have emitted movementStarted signal when content list did.");
125+ compare(movementStartedSpy.count, 1, "DashContent should have emitted movementStarted signal when content list did.");
126+ compare(lensStatus["MockLens1"].movementStarted, 1, "MockLens1 should have emitted movementStarted signal when content list did.");
127+ compare(lensStatus["MockLens2"].movementStarted, 1, "MockLens2 should have emitted movementStarted signal when content list did.");
128+ compare(lensStatus["MockLens3"].movementStarted, 1, "MockLens3 should have emitted movementStarted signal when content list did.");
129+ compare(lensStatus["MockLens4"].movementStarted, 1, "MockLens4 should have emitted movementStarted signal when content list did.");
130+ compare(lensStatus["MockLens5"].movementStarted, 1, "MockLens5 should have emitted movementStarted signal when content list did.");
126131 }
127132
128133 function test_positioned_at_beginning_signal() {
129− dash_content.setCurrentLensAtIndex(3, true, false);
134+ dashContent.setCurrentLensAtIndex(3, true, false);
130135
131− tryCompare(lensLoaded_spy, "count", 5);
136+ tryCompare(lensLoadedSpy, "count", 5);
132137
133− dash_content.positionedAtBeginning();
134− compare(lens_status["MockLens1"].positionedAtBeginning, 1, "MockLens1 should have emitted positionedAtBeginning signal when DashContent did.");
135− compare(lens_status["MockLens2"].positionedAtBeginning, 1, "MockLens2 should have emitted positionedAtBeginning signal when DashContent did.");
136− compare(lens_status["MockLens3"].positionedAtBeginning, 1, "MockLens3 should have emitted positionedAtBeginning signal when DashContent did.");
137− compare(lens_status["MockLens4"].positionedAtBeginning, 1, "MockLens4 should have emitted positionedAtBeginning signal when DashContent did.");
138− compare(lens_status["MockLens5"].positionedAtBeginning, 1, "MockLens5 should have emitted positionedAtBeginning signal when DashContent did.");
138+ dashContent.positionedAtBeginning();
139+ compare(lensStatus["MockLens1"].positionedAtBeginning, 1, "MockLens1 should have emitted positionedAtBeginning signal when DashContent did.");
140+ compare(lensStatus["MockLens2"].positionedAtBeginning, 1, "MockLens2 should have emitted positionedAtBeginning signal when DashContent did.");
141+ compare(lensStatus["MockLens3"].positionedAtBeginning, 1, "MockLens3 should have emitted positionedAtBeginning signal when DashContent did.");
142+ compare(lensStatus["MockLens4"].positionedAtBeginning, 1, "MockLens4 should have emitted positionedAtBeginning signal when DashContent did.");
143+ compare(lensStatus["MockLens5"].positionedAtBeginning, 1, "MockLens5 should have emitted positionedAtBeginning signal when DashContent did.");
139144 }
140145
141146 function test_lens_loaded() {
142− tryCompare(lensLoaded_spy, "count", 5);
147+ tryCompare(lensLoadedSpy, "count", 5);
143148 }
144149
145150 function test_content_end_reached() {
146− var dashContentList = findChild(dash_content, "dashContentList");
151+ var dashContentList = findChild(dashContent, "dashContentList");
147152 verify(dashContentList != undefined);
148− tryCompare(lensLoaded_spy, "count", 5);
153+ tryCompare(lensLoadedSpy, "count", 5);
149154
150− dash_content.setCurrentLensAtIndex(0, true, false);
155+ dashContent.setCurrentLensAtIndex(0, true, false);
151156 dashContentList.currentItem.item.endReached();
152157
153− compare(contentEndReached_spy.count, 1);
158+ compare(contentEndReachedSpy.count, 1);
154159 }
155160
156161 // This tests that setting the current lens index will end up at the correct index even if
@@ -159,19 +164,19 @@ Item {
159164 verify(lensesModel.loaded == false);
160165
161166 // next index is 1 if current is -1, otherwise it's current + 1
162− var next_index = ((dash_content.currentIndex == -1 ? 0 : dash_content.currentIndex) + 1) % 5
167+ var next_index = ((dashContent.currentIndex == -1 ? 0 : dashContent.currentIndex) + 1) % 5
163168
164− dash_content.setCurrentLensAtIndex(next_index, true, false);
165− tryCompare(dash_content, "currentIndex", next_index);
169+ dashContent.setCurrentLensAtIndex(next_index, true, false);
170+ tryCompare(dashContent, "currentIndex", next_index);
166171 verify(lensesModel.loaded == true);
167172
168173 // test greater than lens count.
169− dash_content.setCurrentLensAtIndex(lensesModel.count, true, false);
170− compare(dash_content.currentIndex, 4);
174+ dashContent.setCurrentLensAtIndex(lensesModel.count, true, false);
175+ compare(dashContent.currentIndex, 4);
171176 }
172177
173178 function get_current_item_object_name() {
174− var dashContentList = findChild(dash_content, "dashContentList");
179+ var dashContentList = findChild(dashContent, "dashContentList");
175180 verify(dashContentList != undefined);
176181
177182 if (dashContentList.currentItem != undefined) {
@@ -193,7 +198,7 @@ Item {
193198 }
194199
195200 function test_lens_mapping(data) {
196− dash_content.setCurrentLensAtIndex(data.index, true, false);
201+ dashContent.setCurrentLensAtIndex(data.index, true, false);
197202 tryCompareFunction(get_current_item_object_name, data.objectName)
198203 }
199204