95
143
name: "DashPreview"
98
function test_close() {
99
var title = findChild(preview, "titleLabel")
100
mouseClick(title, 1, 1)
101
compare(closeSpy.count, 1, "Close signal not emitted")
104
146
function test_columns_data() {
106
148
{tag: "1 columns", width: units.gu(5), height: units.gu(10), columns: 1},
107
{tag: "2 columns", width: units.gu(50), height: units.gu(10), columns: 2}
149
{tag: "3 columns", width: units.gu(50), height: units.gu(10), columns: 3}
111
153
function test_columns(data) {
112
154
var leftCol = findChild(preview, "leftColumn")
155
var centerCol = findChild(preview, "centerColumn")
113
156
var rightCol = findChild(preview, "rightColumn")
115
158
root.width = data.width
116
159
root.height = data.height
118
// there are 2 columns in DashPreview. On portrait form factors
119
// only the left one is used and the right one should be empty.
120
// to find out if the content is in the correct column, we get a
161
// there are 3 columns in DashPreview. On portrait form factors
162
// only the left one is used and the center and right ones should be empty.
163
// To find out if the content is in the correct column, we get a
121
164
// reference to the column objects and search only the subtree
122
165
// to see if the content is in the correct column.
123
// 1 colum -> content should be in leftColumn
124
// 2 colums -> content should be in rightColumn
166
// 1 colum -> all content should be in leftColumn
167
// 3 colums -> content should be in centerColumn, rating in rightColumn
126
169
switch(data.columns) {
128
171
var testContent = findChild(leftCol, "testContent")
129
172
compare(testContent.objectName, "testContent")
173
testContent = findChild(leftCol, "ratings")
174
compare(testContent.objectName, "ratings")
132
var testContent = findChild(rightCol, "testContent")
177
var testContent = findChild(centerCol, "testContent")
133
178
compare(testContent.objectName, "testContent")
179
testContent = findChild(rightCol, "ratings")
180
compare(testContent.objectName, "ratings")