~aacid/unity8/dash_overview

« back to all changes in this revision

Viewing changes to tests/qmltests/Dash/tst_GenericScopeView.qml

  • Committer: Albert Astals
  • Date: 2014-08-07 15:27:32 UTC
  • mfrom: (1155.1.29 do_merged)
  • Revision ID: albert.astals@canonical.com-20140807152732-0zf22298f1lsxrz8
Merge

Show diffs side-by-side

added added

removed removed

Lines of Context:
61
61
            property Item header: findChild(genericScopeView, "scopePageHeader")
62
62
 
63
63
            function init() {
64
 
                genericScopeView.scope = scopes.getScope(1)
65
 
                shell.width = units.gu(120)
 
64
                genericScopeView.scope = scopes.getScope(2);
 
65
                shell.width = units.gu(120);
66
66
                genericScopeView.categoryView.positionAtBeginning();
67
67
                waitForRendering(genericScopeView.categoryView);
68
68
            }
88
88
 
89
89
            function test_showDash() {
90
90
                testCase.previewListView.open = true;
91
 
                scopes.getScope(1).showDash();
 
91
                genericScopeView.scope.showDash();
92
92
                tryCompare(testCase.previewListView, "open", false);
93
93
            }
94
94
 
95
95
            function test_hideDash() {
96
96
                testCase.previewListView.open = true;
97
 
                scopes.getScope(1).hideDash();
 
97
                genericScopeView.scope.hideDash();
98
98
                tryCompare(testCase.previewListView, "open", false);
99
99
            }
100
100
 
111
111
 
112
112
            function test_changeScope() {
113
113
                genericScopeView.scope.searchQuery = "test"
114
 
                genericScopeView.scope = scopes.getScope(2)
115
 
                genericScopeView.scope = scopes.getScope(1)
 
114
                var originalScopeId = genericScopeView.scope.id;
 
115
                genericScopeView.scope = scopes.getScope(originalScopeId + 1)
 
116
                genericScopeView.scope = scopes.getScope(originalScopeId)
116
117
                tryCompare(genericScopeView.scope, "searchQuery", "test")
117
118
            }
118
119
 
129
130
                var initialHeight = category.height;
130
131
                mouseClick(seeAll, seeAll.width / 2, seeAll.height / 2);
131
132
                verify(category.expanded);
132
 
                tryCompareFunction(function() { return category.height > initialHeight; }, true);
 
133
                tryCompare(category, "height", category.item.expandedHeight + seeAll.height);
133
134
 
 
135
                waitForRendering(seeAll);
134
136
                mouseClick(seeAll, seeAll.width / 2, seeAll.height / 2);
135
137
                verify(!category.expanded);
136
138
            }
197
199
                openPreview(4, 0);
198
200
 
199
201
                compare(testCase.previewListView.count, 12, "There should only be 12 items in preview.");
 
202
 
 
203
                closePreview();
200
204
            }
201
205
 
202
206
            function test_narrow_delegate_ranges_expand() {
231
235
            }
232
236
 
233
237
            function test_single_category_expansion() {
234
 
                genericScopeView.scope = scopes.getScope(4);
 
238
                genericScopeView.scope = scopes.getScope(3);
235
239
 
236
240
                tryCompareFunction(function() { return findChild(genericScopeView, "dashCategory0") != undefined; }, true);
237
241
                var category = findChild(genericScopeView, "dashCategory0")
319
323
                                                units.gu(2),
320
324
                                                testCase.previewListView.height / 2);
321
325
                    tryCompare(previewListViewList, "moving", false);
322
 
                    tryCompare(testCase.previewListView.currentItem, "objectName", "previewItem" + i);
 
326
                    tryCompare(testCase.previewListView.currentItem, "objectName", "preview" + i);
323
327
 
324
328
                }
325
329
                closePreview();
328
332
            function test_header_style_data() {
329
333
                return [
330
334
                    { tag: "Default", index: 0, foreground: "grey", background: "", logo: "" },
331
 
                    { tag: "Foreground", index: 2, foreground: "yellow", background: "", logo: "" },
332
 
                    { tag: "Logo+Background", index: 3, foreground: "grey", background: "gradient:///lightgrey/grey",
 
335
                    { tag: "Foreground", index: 1, foreground: "yellow", background: "", logo: "" },
 
336
                    { tag: "Logo+Background", index: 2, foreground: "grey", background: "gradient:///lightgrey/grey",
333
337
                      logo: Qt.resolvedUrl("../Components/tst_PageHeader/logo-ubuntu-orange.svg") },
334
338
                ];
335
339
            }