@@ -28,55 +28,55 @@ Item {
2828
2929 property ListModel searchHistory: ListModel {}
3030
31− property var lens_status: {
32− 'MockLens1': { 'movementStarted': 0, 'positionedAtBeginning': 0 },
33− 'MockLens2': { 'movementStarted': 0, 'positionedAtBeginning': 0 },
34− 'MockLens3': { 'movementStarted': 0, 'positionedAtBeginning': 0 },
35− 'MockLens4': { 'movementStarted': 0, 'positionedAtBeginning': 0 },
36− 'MockLens5': { 'movementStarted': 0, 'positionedAtBeginning': 0 }
31+ property var scope_status: {
32+ 'MockScope1': { 'movementStarted': 0, 'positionedAtBeginning': 0 },
33+ 'MockScope2': { 'movementStarted': 0, 'positionedAtBeginning': 0 },
34+ 'MockScope3': { 'movementStarted': 0, 'positionedAtBeginning': 0 },
35+ 'MockScope4': { 'movementStarted': 0, 'positionedAtBeginning': 0 },
36+ 'MockScope5': { 'movementStarted': 0, 'positionedAtBeginning': 0 }
3737 }
3838
39− Lenses {
40− id: lensesModel
39+ Scopes {
40+ id: scopesModel
4141 }
4242
4343 DashContent {
4444 id: dash_content
4545 anchors.fill: parent
4646
47− model: lensesModel
48− scopes : lensesModel
47+ model: scopesModel
48+ scopes : scopesModel
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"
50+ scopeDelegateMapping: { "MockScope3" : "../tests/qmltests/Dash/qml/fake_lensView3.qml",
51+ "MockScope2" : "../tests/qmltests/Dash/qml/fake_lensView2.qml",
52+ "MockScope1" : "../tests/qmltests/Dash/qml/fake_lensView1.qml",
53+ "MockScope4" : "../tests/qmltests/Dash/qml/fake_lensView4.qml"
5454 }
5555
56− genericLens: "../tests/qmltests/Dash/qml/fake_generic_lensView.qml"
56+ genericScope: "../tests/qmltests/Dash/qml/fake_generic_lensView.qml"
5757 }
5858
59− function clear_lens_status() {
60− lens_status["MockLens1"].movementStarted = 0;
61− lens_status["MockLens1"].positionedAtBeginning = 0;
59+ function clear_scope_status() {
60+ scope_status["MockScope1"].movementStarted = 0;
61+ scope_status["MockScope1"].positionedAtBeginning = 0;
6262
63− lens_status["MockLens2"].movementStarted = 0;
64− lens_status["MockLens2"].positionedAtBeginning = 0;
63+ scope_status["MockScope2"].movementStarted = 0;
64+ scope_status["MockScope2"].positionedAtBeginning = 0;
6565
66− lens_status["MockLens3"].movementStarted = 0;
67− lens_status["MockLens3"].positionedAtBeginning = 0;
66+ scope_status["MockScope3"].movementStarted = 0;
67+ scope_status["MockScope3"].positionedAtBeginning = 0;
6868
69− lens_status["MockLens4"].movementStarted = 0;
70− lens_status["MockLens4"].positionedAtBeginning = 0;
69+ scope_status["MockScope4"].movementStarted = 0;
70+ scope_status["MockScope4"].positionedAtBeginning = 0;
7171
72− lens_status["MockLens5"].movementStarted = 0;
73− lens_status["MockLens5"].positionedAtBeginning = 0;
72+ scope_status["MockScope5"].movementStarted = 0;
73+ scope_status["MockScope5"].positionedAtBeginning = 0;
7474 }
7575
7676 SignalSpy {
77− id: lensLoaded_spy
77+ id: scopeLoaded_spy
7878 target: dash_content
79− signalName: "lensLoaded"
79+ signalName: "scopeLoaded"
8080 }
8181
8282 SignalSpy {
@@ -96,77 +96,77 @@ Item {
9696 when: windowShown
9797
9898 function init() {
99− lensLoaded_spy.clear();
99+ scopeLoaded_spy.clear();
100100 movementStarted_spy.clear();
101101 contentEndReached_spy.clear()
102− clear_lens_status();
102+ clear_scope_status();
103103
104− // clear, wait for dahs to empty and load lenses.
104+ // clear, wait for dahs to empty and load scopes.
105105 var dashContentList = findChild(dash_content, "dashContentList");
106106 verify(dashContentList != undefined)
107− lensesModel.clear();
107+ scopesModel.clear();
108108 tryCompare(dashContentList, "count", 0);
109− lensesModel.load();
109+ scopesModel.load();
110110 }
111111
112112 function test_movement_started_signal() {
113− dash_content.setCurrentLensAtIndex(3, true, false);
113+ dash_content.setCurrentScopeAtIndex(3, true, false);
114114
115115 var dashContentList = findChild(dash_content, "dashContentList");
116116 verify(dashContentList != undefined)
117− tryCompare(lensLoaded_spy, "count", 5);
117+ tryCompare(scopeLoaded_spy, "count", 5);
118118
119119 dashContentList.movementStarted();
120120 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.");
121+ compare(scope_status["MockScope1"].movementStarted, 1, "MockScope1 should have emitted movementStarted signal when content list did.");
122+ compare(scope_status["MockScope2"].movementStarted, 1, "MockScope2 should have emitted movementStarted signal when content list did.");
123+ compare(scope_status["MockScope3"].movementStarted, 1, "MockScope3 should have emitted movementStarted signal when content list did.");
124+ compare(scope_status["MockScope4"].movementStarted, 1, "MockScope4 should have emitted movementStarted signal when content list did.");
125+ compare(scope_status["MockScope5"].movementStarted, 1, "MockScope5 should have emitted movementStarted signal when content list did.");
126126 }
127127
128128 function test_positioned_at_beginning_signal() {
129− dash_content.setCurrentLensAtIndex(3, true, false);
129+ dash_content.setCurrentScopeAtIndex(3, true, false);
130130
131− tryCompare(lensLoaded_spy, "count", 5);
131+ tryCompare(scopeLoaded_spy, "count", 5);
132132
133133 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.");
134+ compare(scope_status["MockScope1"].positionedAtBeginning, 1, "MockScope1 should have emitted positionedAtBeginning signal when DashContent did.");
135+ compare(scope_status["MockScope2"].positionedAtBeginning, 1, "MockScope2 should have emitted positionedAtBeginning signal when DashContent did.");
136+ compare(scope_status["MockScope3"].positionedAtBeginning, 1, "MockScope3 should have emitted positionedAtBeginning signal when DashContent did.");
137+ compare(scope_status["MockScope4"].positionedAtBeginning, 1, "MockScope4 should have emitted positionedAtBeginning signal when DashContent did.");
138+ compare(scope_status["MockScope5"].positionedAtBeginning, 1, "MockScope5 should have emitted positionedAtBeginning signal when DashContent did.");
139139 }
140140
141− function test_lens_loaded() {
142− tryCompare(lensLoaded_spy, "count", 5);
141+ function test_scope_loaded() {
142+ tryCompare(scopeLoaded_spy, "count", 5);
143143 }
144144
145145 function test_content_end_reached() {
146146 var dashContentList = findChild(dash_content, "dashContentList");
147147 verify(dashContentList != undefined);
148− tryCompare(lensLoaded_spy, "count", 5);
148+ tryCompare(scopeLoaded_spy, "count", 5);
149149
150− dash_content.setCurrentLensAtIndex(0, true, false);
150+ dash_content.setCurrentScopeAtIndex(0, true, false);
151151 dashContentList.currentItem.item.endReached();
152152
153153 compare(contentEndReached_spy.count, 1);
154154 }
155155
156− // This tests that setting the current lens index will end up at the correct index even if
157− // the lenses are loaded asynchrounsly.
158− function test_set_current_lens_index_async() {
159− verify(lensesModel.loaded == false);
156+ // This tests that setting the current scope index will end up at the correct index even if
157+ // the scopes are loaded asynchrounsly.
158+ function test_set_current_scope_index_async() {
159+ verify(scopesModel.loaded == false);
160160
161161 // next index is 1 if current is -1, otherwise it's current + 1
162162 var next_index = ((dash_content.currentIndex == -1 ? 0 : dash_content.currentIndex) + 1) % 5
163163
164− dash_content.setCurrentLensAtIndex(next_index, true, false);
164+ dash_content.setCurrentScopeAtIndex(next_index, true, false);
165165 tryCompare(dash_content, "currentIndex", next_index);
166− verify(lensesModel.loaded == true);
166+ verify(scopesModel.loaded == true);
167167
168− // test greater than lens count.
169− dash_content.setCurrentLensAtIndex(lensesModel.count, true, false);
168+ // test greater than scope count.
169+ dash_content.setCurrentScopeAtIndex(scopesModel.count, true, false);
170170 compare(dash_content.currentIndex, 4);
171171 }
172172
@@ -182,18 +182,18 @@ Item {
182182 return "";
183183 }
184184
185− function test_lens_mapping_data() {
185+ function test_scope_mapping_data() {
186186 return [
187− {tag: "index0", index: 0, objectName: "fake_lensView1"},
188− {tag: "index1", index: 1, objectName: "fake_lensView2"},
189− {tag: "index2", index: 2, objectName: "fake_lensView3"},
190− {tag: "index3", index: 3, objectName: "fake_lensView4"},
191− {tag: "index4", index: 4, objectName: "fake_generic_lensView"}
187+ {tag: "index0", index: 0, objectName: "fake_scopeView1"},
188+ {tag: "index1", index: 1, objectName: "fake_scopeView2"},
189+ {tag: "index2", index: 2, objectName: "fake_scopeView3"},
190+ {tag: "index3", index: 3, objectName: "fake_scopeView4"},
191+ {tag: "index4", index: 4, objectName: "fake_generic_scopeView"}
192192 ]
193193 }
194194
195− function test_lens_mapping(data) {
196− dash_content.setCurrentLensAtIndex(data.index, true, false);
195+ function test_scope_mapping(data) {
196+ dash_content.setCurrentScopeAtIndex(data.index, true, false);
197197 tryCompareFunction(get_current_item_object_name, data.objectName)
198198 }
199199