on xenial help sign in
Added Dash tests.

Approved by PS Jenkins bot, Daniel d'Andrada.

commitfe7ed42142e67b48fdbcbf610080f1d11a432321 authorNick Dedekind <nicholas.dedekind@gmail.com> dateWed 12 Jun 2013, 16:10 (13 years ago) parent76e3916dbcb48c
12 files changed+311−129
Dash/Dash.qml+2 Dash/DashContent.qml+5−16 Dash/LensDelegateMapper.qml+35 tests/qmltests/CMakeLists.txt+1 tests/qmltests/Dash/qml/FakeLensView.qml+69−42 tests/qmltests/Dash/qml/fake_generic_lensView.qml+1−3 tests/qmltests/Dash/qml/fake_lensView1.qml+1−3 tests/qmltests/Dash/qml/fake_lensView2.qml+1−3 tests/qmltests/Dash/qml/fake_lensView3.qml+1−3 tests/qmltests/Dash/qml/fake_lensView4.qml+1−3 tests/qmltests/Dash/tst_Dash.qml+133 tests/qmltests/Dash/tst_DashContent.qml+61−56
Dash/Dash.qml+2
@@ -59,6 +59,7 @@ Showable {
5959
6060 DashContent {
6161 id: dashContent
62+ objectName: "dashContent"
6263 anchors.fill: parent
6364 model: filteredLenses
6465 lenses: lenses
@@ -79,6 +80,7 @@ Showable {
7980
8081 DashBar {
8182 id: dashbar
83+ objectName: "dashbar"
8284 anchors.bottom: parent.bottom
8385 anchors.left: parent.left
8486 anchors.right: parent.right
Dash/DashContent.qml+5−16
@@ -28,6 +28,8 @@ Item {
2828 property real contentProgress: Math.max(0, Math.min(dashContentList.contentX / (dashContentList.contentWidth - dashContentList.width), units.dp(1)))
2929 property alias currentIndex: dashContentList.currentIndex
3030
31+ property LensDelegateMapper lensMapper : LensDelegateMapper {}
32+
3133 signal movementStarted()
3234 signal movementEnded()
3335 signal contentFlickStarted()
@@ -79,14 +81,6 @@ Item {
7981 }
8082 }
8183
82− property var lensDelegateMapping: {"mockmusic.lens": "DashMusic.qml",
83− "applications.lens": "DashApps.qml",
84− "home.lens": "DashHome.qml",
85− "mockvideos.lens": "DashVideos.qml",
86− "people.lens": "DashPeople.qml",
87− }
88− property string genericLens: "GenericLensView.qml"
89−
9084 ListView {
9185 id: dashContentList
9286 objectName: "dashContentList"
@@ -121,14 +115,7 @@ Item {
121115 width: ListView.view.width
122116 height: ListView.view.height
123117 asynchronous: true
124− source: {
125− var customLens = lensDelegateMapping[lens.id]
126− if (customLens) {
127− return customLens
128− } else {
129− return genericLens
130− }
131− }
118+ source: lensMapper.map(lens.id)
132119 onLoaded: {
133120 item.lens = Qt.binding(function() { return lens })
134121 item.isCurrent = Qt.binding(function() { return ListView.isCurrentItem })
@@ -150,6 +137,8 @@ Item {
150137 }
151138 }
152139 }
140+
141+ Component.onDestruction: active = false
153142 }
154143 }
155144}
Dash/LensDelegateMapper.qmlnew file+35
@@ -0,0 +1,35 @@
1+/*
2+ * Copyright (C) 2013 Canonical, Ltd.
3+ *
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.
7+ *
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.
12+ *
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/>.
15+ */
16+
17+import QtQuick 2.0
18+
19+QtObject {
20+ property var lensDelegateMapping: {"mockmusic.lens": "DashMusic.qml",
21+ "applications.lens": "DashApps.qml",
22+ "home.lens": "DashHome.qml",
23+ "mockvideos.lens": "DashVideos.qml",
24+ "people.lens": "DashPeople.qml",
25+ }
26+ property string genericLens: "GenericLensView.qml"
27+
28+ function map(lensId) {
29+ var customLens = lensDelegateMapping[lensId]
30+ if (customLens != undefined) {
31+ return customLens
32+ }
33+ return genericLens
34+ }
35+}
tests/qmltests/CMakeLists.txt+1
@@ -37,6 +37,7 @@ add_qml_test(Components Stage IMPORT_PATHS ${qmltest_DEFAULT_IMPORT_PATHS}
3737 ${CMAKE_BINARY_DIR}/plugins)
3838add_qml_test(Components Tile)
3939add_qml_test(Components PageHeader)
40+add_qml_test(Dash Dash IMPORT_PATHS ${CMAKE_BINARY_DIR}/plugins ${qmltest_DEFAULT_IMPORT_PATHS})
4041add_qml_test(Dash DashBar IMPORT_PATHS ${CMAKE_BINARY_DIR}/plugins ${CMAKE_CURRENT_BINARY_DIR}/plugins ${qmltest_DEFAULT_IMPORT_PATHS})
4142add_qml_test(Dash DashContent IMPORT_PATHS ${qmltest_DEFAULT_IMPORT_PATHS})
4243add_qml_test(Dash DashPreview)
tests/qmltests/Dash/qml/FakeLensView.qml+69−42
@@ -22,71 +22,98 @@ FocusScope {
2222 property Lens lens : null
2323 property bool isCurrent : false
2424
25− property alias rect_color1 : rect1.color
26− property alias rect_color2 : rect2.color
27− property alias rect_color3 : rect3.color
28−
2925 property ListModel searchHistory
3026
3127 signal endReached
3228 signal movementStarted
3329 signal positionedAtBeginning
3430
31+ property alias backColor : back.color
32+
3533 onEndReached: {
36− if (shell != undefined && shell.lens_status != undefined) {
37− shell.lens_status[lens.id].endReached++;
34+ if (shell != undefined && shell.lensStatus != undefined) {
35+ shell.lensStatus[lens.id].endReached++;
3836 }
3937 }
4038 onMovementStarted: {
41− if (shell != undefined && shell.lens_status != undefined) {
42− shell.lens_status[lens.id].movementStarted++;
39+ if (shell != undefined && shell.lensStatus != undefined) {
40+ shell.lensStatus[lens.id].movementStarted++;
4341 }
4442 }
4543 onPositionedAtBeginning: {
46− if (shell != undefined && shell.lens_status != undefined) {
47− shell.lens_status[lens.id].positionedAtBeginning++;
44+ if (shell != undefined && shell.lensStatus != undefined) {
45+ shell.lensStatus[lens.id].positionedAtBeginning++;
4846 }
4947 }
5048
49+ Rectangle {
50+ id: back
51+ anchors.fill: parent
52+ color: "grey"
53+ }
54+
55+ function randomBg()
56+ {
57+ var hex1=new Array("4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", "F")
58+ var bg="#"+hex1[Math.floor(Math.random()*hex1.length)]+
59+ hex1[Math.floor(Math.random()*hex1.length)]+
60+ hex1[Math.floor(Math.random()*hex1.length)]+
61+ hex1[Math.floor(Math.random()*hex1.length)]+
62+ hex1[Math.floor(Math.random()*hex1.length)]+
63+ hex1[Math.floor(Math.random()*hex1.length)]
64+ return bg
65+ }
5166
52− Column {
67+
68+ ListView {
69+ id: listView
5370 anchors.fill: parent
54− Rectangle {
55− id: rect1
56− height: parent.height/3; width: parent.width;
71+ model: lens ? lens.categories : null
72+ orientation: ListView.Vertical
5773
58− Text {
59− id: label1
60− anchors.fill: parent
61− verticalAlignment: Text.AlignVCenter
62− horizontalAlignment: Text.AlignHCenter
63− text: lens ? lens.id : ""
64− }
65− }
74+ delegate: Column {
75+ id: column
76+ width: listView.width
77+ height: childrenRect.height
6678
67− Rectangle {
68− id: rect2
69− height: parent.height/3; width: parent.width
79+ Rectangle {
80+ width: listView.width
81+ height: units.gu(3)
82+ color: randomBg()
7083
71− Text {
72− id: label2
73− anchors.fill: parent
74− verticalAlignment: Text.AlignVCenter
75− horizontalAlignment: Text.AlignHCenter
76− text: lens ? lens.id : ""
84+ Text {
85+ text: name
86+ font.family: "Ubuntu"
87+ font.weight: Font.Bold
88+ font.pixelSize: 20
89+ anchors.horizontalCenter: parent.horizontalCenter
90+ }
7791 }
78− }
79−
80− Rectangle {
81− id: rect3
82− height: parent.height/3; width: parent.width
92+ GridView {
93+ id: resultsGrid
94+ model: results
95+ cellWidth: units.gu(10); cellHeight: units.gu(10)
96+ height: childrenRect.height
97+ width: listView.width
98+ interactive: false
8399
84− Text {
85− id: label3
86− anchors.fill: parent
87− verticalAlignment: Text.AlignVCenter
88− horizontalAlignment: Text.AlignHCenter
89− text: lens ? lens.id : ""
100+ delegate: Component {
101+ id: resultDelegate
102+ Item {
103+ width: resultsGrid.cellWidth; height: resultsGrid.cellHeight
104+ Column {
105+ anchors.verticalCenter: parent.verticalCenter
106+ anchors.horizontalCenter: parent.horizontalCenter
107+ Image {
108+ width: units.gu(5)
109+ height: units.gu(5)
110+ source: column_1
111+ anchors.horizontalCenter: parent.horizontalCenter
112+ }
113+ Text { text: column_4; anchors.horizontalCenter: parent.horizontalCenter }
114+ }
115+ }
116+ }
90117 }
91118 }
92119 }
tests/qmltests/Dash/qml/fake_generic_lensView.qml+1−3
@@ -20,7 +20,5 @@ FakeLensView {
2020 id: fake_generic_lensView
2121 objectName: "fake_generic_lensView"
2222
23− rect_color1: "blue"
24− rect_color2: "orange"
25− rect_color3: "teal"
23+ backColor: "#D0D0D0"
2624}
tests/qmltests/Dash/qml/fake_lensView1.qml+1−3
@@ -20,7 +20,5 @@ FakeLensView {
2020 id: fake_lensView1
2121 objectName: "fake_lensView1"
2222
23− rect_color1: "red"
24− rect_color2: "green"
25− rect_color3: "blue"
23+ backColor: "#909090"
2624}
tests/qmltests/Dash/qml/fake_lensView2.qml+1−3
@@ -20,7 +20,5 @@ FakeLensView {
2020 id: fake_lensView2
2121 objectName: "fake_lensView2"
2222
23− rect_color1: "orange"
24− rect_color2: "grey"
25− rect_color3: "purple"
23+ backColor: "#A0A0A0"
2624}
tests/qmltests/Dash/qml/fake_lensView3.qml+1−3
@@ -20,7 +20,5 @@ FakeLensView {
2020 id: fake_lensView3
2121 objectName: "fake_lensView3"
2222
23− rect_color1: "yellow"
24− rect_color2: "cyan"
25− rect_color3: "white"
23+ backColor: "#B0B0B0"
2624}
tests/qmltests/Dash/qml/fake_lensView4.qml+1−3
@@ -20,7 +20,5 @@ FakeLensView {
2020 id: fake_lensView4
2121 objectName: "fake_lensView4"
2222
23− rect_color1: "grey"
24− rect_color2: "purple"
25− rect_color3: "red"
23+ backColor: "#C0C0C0"
2624}
tests/qmltests/Dash/tst_Dash.qmlnew file+133
@@ -0,0 +1,133 @@
1+/*
2+ * Copyright 2013 Canonical Ltd.
3+ *
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.
7+ *
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.
12+ *
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/>.
15+ */
16+
17+import QtQuick 2.0
18+import QtTest 1.0
19+import "../../../Dash"
20+import Ubuntu.Components 0.1
21+import Unity.Test 0.1 as UT
22+
23+Item {
24+ id: shell
25+ width: units.gu(40)
26+ height: units.gu(80)
27+
28+ property ListModel searchHistory : ListModel {}
29+
30+ Dash {
31+ id: dash
32+ anchors.fill: parent
33+ showLensOnLoaded: "MockLens2"
34+ }
35+
36+ LensDelegateMapper {
37+ id: lensDelegateMapper
38+ lensDelegateMapping: {
39+ "MockLens1": "../tests/qmltests/Dash/qml/fake_lensView1.qml",
40+ "MockLens2": "../tests/qmltests/Dash/qml/fake_lensView2.qml",
41+ "MockLens3": "../tests/qmltests/Dash/qml/fake_lensView3.qml",
42+ "MockLens4": "../tests/qmltests/Dash/qml/fake_lensView4.qml"
43+ }
44+ genericLens: "../tests/qmltests/Dash/qml/fake_generic_lensView.qml"
45+ }
46+
47+ UT.UnityTestCase {
48+ name: "Dash"
49+ when: windowShown
50+
51+ property var lenses
52+
53+ Component.onCompleted: {
54+ var dashContent = findChild(dash, "dashContent");
55+ dashContent.lensMapper = lensDelegateMapper;
56+ lenses = dashContent.lenses;
57+ }
58+
59+ function init() {
60+ // clear and reload the lenses.
61+ lenses.clear();
62+ var dashContentList = findChild(dash, "dashContentList");
63+ verify(dashContentList != undefined);
64+ tryCompare(dashContentList, "count", 0);
65+ lenses.load();
66+ }
67+
68+ function get_lens_data() {
69+ return [
70+ { tag: "MockLens1", visualIndex: 0, shouldBeVisible: true },
71+ { tag: "MockLens2", visualIndex: -1, shouldBeVisible: false },
72+ { tag: "MockLens3", visualIndex: 1, shouldBeVisible: true },
73+ { tag: "MockLens4", visualIndex: 2, shouldBeVisible: true },
74+ { tag: "MockLens5", visualIndex: 3, shouldBeVisible: true },
75+ ]
76+ }
77+
78+ function test_set_current_lens_data() {
79+ return get_lens_data()
80+ }
81+
82+ function test_set_current_lens(data) {
83+ // wait for lenses to load
84+ tryCompare(lenses, "loaded", true);
85+
86+ var dashbar = findChild(dash, "dashbar");
87+ verify(dashbar != undefined)
88+ var dashContent = findChild(dash, "dashContent");
89+ var current_index = dashContent.currentIndex;
90+
91+ dash.setCurrentLens(data.tag, true /* animate */, false /* reset */);
92+ compare(dashContent.currentIndex, data.shouldBeVisible ? data.visualIndex : current_index);
93+ compare(dashbar.currentIndex, data.shouldBeVisible ? data.visualIndex : current_index);
94+ }
95+
96+ function test_show_lens_on_load_data() {
97+ return get_lens_data()
98+ }
99+
100+ function test_show_lens_on_load(data) {
101+ if (data.shouldBeVisible == false) {
102+ console.log("Not testing " + data.tag + ": not visible");
103+ return;
104+ }
105+ dash.showLensOnLoaded = data.tag
106+
107+ var dashContentList = findChild(dash, "dashContentList");
108+ verify(dashContentList != undefined);
109+ tryCompare(dashContentList, "currentIndex", data.visualIndex);
110+ }
111+
112+ function test_dash_bar_set_index_connection_data() {
113+ return get_lens_data()
114+ }
115+
116+ function test_dash_bar_set_index_connection(data) {
117+ if (data.shouldBeVisible == false) {
118+ console.log("Not testing " + data.tag + ": not visible");
119+ return;
120+ }
121+ // wait for lenses to load
122+ tryCompare(lenses, "loaded", true);
123+
124+ var dashbar = findChild(dash, "dashbar");
125+ verify(dashbar != undefined)
126+ var dashContent = findChild(dash, "dashContent");
127+ var current_index = dashContent.currentIndex;
128+
129+ dashbar.itemSelected(data.visualIndex);
130+ compare(dashContent.currentIndex, data.shouldBeVisible ? data.visualIndex : current_index);
131+ }
132+ }
133+}
tests/qmltests/Dash/tst_DashContent.qml+61−56
@@ -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