@@ -28,55 +28,55 @@ Item {
29 property ListModel searchHistory: ListModel {}
29 property ListModel searchHistory: ListModel {}
31− property var lens_status: {
31+ property var scope_status: {
32− 'MockLens1': { 'movementStarted': 0, 'positionedAtBeginning': 0 },
32+ 'MockScope1': { 'movementStarted': 0, 'positionedAtBeginning': 0 },
33− 'MockLens2': { 'movementStarted': 0, 'positionedAtBeginning': 0 },
33+ 'MockScope2': { 'movementStarted': 0, 'positionedAtBeginning': 0 },
34− 'MockLens3': { 'movementStarted': 0, 'positionedAtBeginning': 0 },
34+ 'MockScope3': { 'movementStarted': 0, 'positionedAtBeginning': 0 },
35− 'MockLens4': { 'movementStarted': 0, 'positionedAtBeginning': 0 },
35+ 'MockScope4': { 'movementStarted': 0, 'positionedAtBeginning': 0 },
36− 'MockLens5': { 'movementStarted': 0, 'positionedAtBeginning': 0 }
36+ 'MockScope5': { 'movementStarted': 0, 'positionedAtBeginning': 0 }
40− id: lensesModel
40+ id: scopesModel
43 DashContent {
43 DashContent {
44 id: dash_content
44 id: dash_content
45 anchors.fill: parent
45 anchors.fill: parent
47− model: lensesModel
47+ model: scopesModel
48− scopes : lensesModel
48+ scopes : scopesModel
50− lensDelegateMapping: { "MockLens3" : "../tests/qmltests/Dash/qml/fake_lensView3.qml",
50+ scopeDelegateMapping: { "MockScope3" : "../tests/qmltests/Dash/qml/fake_lensView3.qml",
51− "MockLens2" : "../tests/qmltests/Dash/qml/fake_lensView2.qml",
51+ "MockScope2" : "../tests/qmltests/Dash/qml/fake_lensView2.qml",
52− "MockLens1" : "../tests/qmltests/Dash/qml/fake_lensView1.qml",
52+ "MockScope1" : "../tests/qmltests/Dash/qml/fake_lensView1.qml",
53− "MockLens4" : "../tests/qmltests/Dash/qml/fake_lensView4.qml"
53+ "MockScope4" : "../tests/qmltests/Dash/qml/fake_lensView4.qml"
56− genericLens: "../tests/qmltests/Dash/qml/fake_generic_lensView.qml"
56+ genericScope: "../tests/qmltests/Dash/qml/fake_generic_lensView.qml"
59− function clear_lens_status() {
59+ function clear_scope_status() {
60− lens_status["MockLens1"].movementStarted = 0;
60+ scope_status["MockScope1"].movementStarted = 0;
61− lens_status["MockLens1"].positionedAtBeginning = 0;
61+ scope_status["MockScope1"].positionedAtBeginning = 0;
63− lens_status["MockLens2"].movementStarted = 0;
63+ scope_status["MockScope2"].movementStarted = 0;
64− lens_status["MockLens2"].positionedAtBeginning = 0;
64+ scope_status["MockScope2"].positionedAtBeginning = 0;
66− lens_status["MockLens3"].movementStarted = 0;
66+ scope_status["MockScope3"].movementStarted = 0;
67− lens_status["MockLens3"].positionedAtBeginning = 0;
67+ scope_status["MockScope3"].positionedAtBeginning = 0;
69− lens_status["MockLens4"].movementStarted = 0;
69+ scope_status["MockScope4"].movementStarted = 0;
70− lens_status["MockLens4"].positionedAtBeginning = 0;
70+ scope_status["MockScope4"].positionedAtBeginning = 0;
72− lens_status["MockLens5"].movementStarted = 0;
72+ scope_status["MockScope5"].movementStarted = 0;
73− lens_status["MockLens5"].positionedAtBeginning = 0;
73+ scope_status["MockScope5"].positionedAtBeginning = 0;
76 SignalSpy {
76 SignalSpy {
77− id: lensLoaded_spy
77+ id: scopeLoaded_spy
78 target: dash_content
78 target: dash_content
79− signalName: "lensLoaded"
79+ signalName: "scopeLoaded"
82 SignalSpy {
82 SignalSpy {
@@ -96,77 +96,77 @@ Item {
96 when: windowShown
96 when: windowShown
98 function init() {
98 function init() {
99− lensLoaded_spy.clear();
99+ scopeLoaded_spy.clear();
100 movementStarted_spy.clear();
100 movementStarted_spy.clear();
101 contentEndReached_spy.clear()
101 contentEndReached_spy.clear()
102− clear_lens_status();
102+ clear_scope_status();
104− // clear, wait for dahs to empty and load lenses.
104+ // clear, wait for dahs to empty and load scopes.
105 var dashContentList = findChild(dash_content, "dashContentList");
105 var dashContentList = findChild(dash_content, "dashContentList");
106 verify(dashContentList != undefined)
106 verify(dashContentList != undefined)
107− lensesModel.clear();
107+ scopesModel.clear();
108 tryCompare(dashContentList, "count", 0);
108 tryCompare(dashContentList, "count", 0);
109− lensesModel.load();
109+ scopesModel.load();
112 function test_movement_started_signal() {
112 function test_movement_started_signal() {
113− dash_content.setCurrentLensAtIndex(3, true, false);
113+ dash_content.setCurrentScopeAtIndex(3, true, false);
115 var dashContentList = findChild(dash_content, "dashContentList");
115 var dashContentList = findChild(dash_content, "dashContentList");
116 verify(dashContentList != undefined)
116 verify(dashContentList != undefined)
117− tryCompare(lensLoaded_spy, "count", 5);
117+ tryCompare(scopeLoaded_spy, "count", 5);
119 dashContentList.movementStarted();
119 dashContentList.movementStarted();
120 compare(movementStarted_spy.count, 1, "DashContent should have emitted movementStarted signal when content list did.");
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.");
121+ compare(scope_status["MockScope1"].movementStarted, 1, "MockScope1 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.");
122+ compare(scope_status["MockScope2"].movementStarted, 1, "MockScope2 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.");
123+ compare(scope_status["MockScope3"].movementStarted, 1, "MockScope3 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.");
124+ compare(scope_status["MockScope4"].movementStarted, 1, "MockScope4 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(scope_status["MockScope5"].movementStarted, 1, "MockScope5 should have emitted movementStarted signal when content list did.");
128 function test_positioned_at_beginning_signal() {
128 function test_positioned_at_beginning_signal() {
129− dash_content.setCurrentLensAtIndex(3, true, false);
129+ dash_content.setCurrentScopeAtIndex(3, true, false);
131− tryCompare(lensLoaded_spy, "count", 5);
131+ tryCompare(scopeLoaded_spy, "count", 5);
133 dash_content.positionedAtBeginning();
133 dash_content.positionedAtBeginning();
134− compare(lens_status["MockLens1"].positionedAtBeginning, 1, "MockLens1 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(lens_status["MockLens2"].positionedAtBeginning, 1, "MockLens2 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(lens_status["MockLens3"].positionedAtBeginning, 1, "MockLens3 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(lens_status["MockLens4"].positionedAtBeginning, 1, "MockLens4 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(lens_status["MockLens5"].positionedAtBeginning, 1, "MockLens5 should have emitted positionedAtBeginning signal when DashContent did.");
138+ compare(scope_status["MockScope5"].positionedAtBeginning, 1, "MockScope5 should have emitted positionedAtBeginning signal when DashContent did.");
141− function test_lens_loaded() {
141+ function test_scope_loaded() {
142− tryCompare(lensLoaded_spy, "count", 5);
142+ tryCompare(scopeLoaded_spy, "count", 5);
145 function test_content_end_reached() {
145 function test_content_end_reached() {
146 var dashContentList = findChild(dash_content, "dashContentList");
146 var dashContentList = findChild(dash_content, "dashContentList");
147 verify(dashContentList != undefined);
147 verify(dashContentList != undefined);
148− tryCompare(lensLoaded_spy, "count", 5);
148+ tryCompare(scopeLoaded_spy, "count", 5);
150− dash_content.setCurrentLensAtIndex(0, true, false);
150+ dash_content.setCurrentScopeAtIndex(0, true, false);
151 dashContentList.currentItem.item.endReached();
151 dashContentList.currentItem.item.endReached();
153 compare(contentEndReached_spy.count, 1);
153 compare(contentEndReached_spy.count, 1);
156− // This tests that setting the current lens index will end up at the correct index even if
156+ // This tests that setting the current scope index will end up at the correct index even if
157− // the lenses are loaded asynchrounsly.
157+ // the scopes are loaded asynchrounsly.
158− function test_set_current_lens_index_async() {
158+ function test_set_current_scope_index_async() {
159− verify(lensesModel.loaded == false);
159+ verify(scopesModel.loaded == false);
161 // next index is 1 if current is -1, otherwise it's current + 1
161 // 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
162 var next_index = ((dash_content.currentIndex == -1 ? 0 : dash_content.currentIndex) + 1) % 5
164− dash_content.setCurrentLensAtIndex(next_index, true, false);
164+ dash_content.setCurrentScopeAtIndex(next_index, true, false);
165 tryCompare(dash_content, "currentIndex", next_index);
165 tryCompare(dash_content, "currentIndex", next_index);
166− verify(lensesModel.loaded == true);
166+ verify(scopesModel.loaded == true);
168− // test greater than lens count.
168+ // test greater than scope count.
169− dash_content.setCurrentLensAtIndex(lensesModel.count, true, false);
169+ dash_content.setCurrentScopeAtIndex(scopesModel.count, true, false);
170 compare(dash_content.currentIndex, 4);
170 compare(dash_content.currentIndex, 4);
@@ -182,18 +182,18 @@ Item {
182 return "";
182 return "";
185− function test_lens_mapping_data() {
185+ function test_scope_mapping_data() {
187− {tag: "index0", index: 0, objectName: "fake_lensView1"},
187+ {tag: "index0", index: 0, objectName: "fake_scopeView1"},
188− {tag: "index1", index: 1, objectName: "fake_lensView2"},
188+ {tag: "index1", index: 1, objectName: "fake_scopeView2"},
189− {tag: "index2", index: 2, objectName: "fake_lensView3"},
189+ {tag: "index2", index: 2, objectName: "fake_scopeView3"},
190− {tag: "index3", index: 3, objectName: "fake_lensView4"},
190+ {tag: "index3", index: 3, objectName: "fake_scopeView4"},
191− {tag: "index4", index: 4, objectName: "fake_generic_lensView"}
191+ {tag: "index4", index: 4, objectName: "fake_generic_scopeView"}
195− function test_lens_mapping(data) {
195+ function test_scope_mapping(data) {
196− dash_content.setCurrentLensAtIndex(data.index, true, false);
196+ dash_content.setCurrentScopeAtIndex(data.index, true, false);
197 tryCompareFunction(get_current_item_object_name, data.objectName)
197 tryCompareFunction(get_current_item_object_name, data.objectName)