on xenial help sign in
Don't break other tests that use expect the apps scope to be somewhere else
a91da85Albert Astals
tests/mocks/Unity/fake_scope.cpp+1−1
@@ -202,7 +202,7 @@ DeeModel* create_categories_model(unsigned category_count) {
202 for(unsigned i = 0; i < category_count; ++i)
202 for(unsigned i = 0; i < category_count; ++i)
203 {
203 {
204 dee_model_append(category_model,
204 dee_model_append(category_model,
205− (i == 2) ? "installed" : std::to_string(i).c_str(),
205+ (i == 2) ? "applications.scope" : std::to_string(i).c_str(),
206 ("Category "+std::to_string(i)).c_str(),
206 ("Category "+std::to_string(i)).c_str(),
207 "gtk-apply",
207 "gtk-apply",
208 i % 2 == 0 ? "grid" : "carousel",
208 i % 2 == 0 ? "grid" : "carousel",
tests/mocks/Unity/fake_scopes.cpp+1−1
@@ -54,7 +54,7 @@ Scopes::~Scopes()
54void Scopes::updateScopes()
54void Scopes::updateScopes()
55{
55{
56 clear();
56 clear();
57− addScope(new Scope("applications.scope", "People", true, this));
57+ addScope(new Scope("MockScope1", "People", true, this));
58 addScope(new Scope("MockScope2", "Music", false, this));
58 addScope(new Scope("MockScope2", "Music", false, this));
59 addScope(new Scope("home.scope", "Home", true, this));
59 addScope(new Scope("home.scope", "Home", true, this));
60 addScope(new ApplicationsScope(true, this));
60 addScope(new ApplicationsScope(true, this));
tests/qmltests/Dash/tst_GenericScopeView.qml+16−16
@@ -32,7 +32,7 @@ Item {
32 id: scopes
32 id: scopes
33
33
34 onLoadedChanged: {
34 onLoadedChanged: {
35− genericScopeView.scope = scopes.get(0)
35+ genericScopeView.scope = scopes.get(2)
36 }
36 }
37 }
37 }
38
38
@@ -76,14 +76,14 @@ Item {
76 function test_showDash() {
76 function test_showDash() {
77 previewListView.open = true;
77 previewListView.open = true;
78 tryCompare(openEffect, "live", true);
78 tryCompare(openEffect, "live", true);
79− scopes.get(0).showDash();
79+ scopes.get(2).showDash();
80 tryCompare(previewListView, "open", false);
80 tryCompare(previewListView, "open", false);
81 tryCompare(openEffect, "live", true);
81 tryCompare(openEffect, "live", true);
82 }
82 }
83
83
84 function test_hideDash() {
84 function test_hideDash() {
85 previewListView.open = true;
85 previewListView.open = true;
86− scopes.get(0).hideDash();
86+ scopes.get(2).hideDash();
87 tryCompare(previewListView, "open", false);
87 tryCompare(previewListView, "open", false);
88 }
88 }
89
89
@@ -96,7 +96,7 @@ Item {
96 var filterGrid = findChild(genericScopeView, filterGridName);
96 var filterGrid = findChild(genericScopeView, filterGridName);
97 if (filterGrid != null) {
97 if (filterGrid != null) {
98 var tile = findChild(filterGrid, "delegate0");
98 var tile = findChild(filterGrid, "delegate0");
99− return tile != undefined;
99+ return tile != null;
100 }
100 }
101 return false;
101 return false;
102 },
102 },
@@ -110,7 +110,7 @@ Item {
110 function checkArrowPosition(index) {
110 function checkArrowPosition(index) {
111 tryCompareFunction(function() {
111 tryCompareFunction(function() {
112 var tile = findChild(findChild(genericScopeView, "0"), "delegate" + index);
112 var tile = findChild(findChild(genericScopeView, "0"), "delegate" + index);
113− return tile != undefined;
113+ return tile != null;
114 },
114 },
115 true);
115 true);
116 var tile = findChild(findChild(genericScopeView, "0"), "delegate" + index);
116 var tile = findChild(findChild(genericScopeView, "0"), "delegate" + index);
@@ -254,13 +254,13 @@ Item {
254 function test_changeScope() {
254 function test_changeScope() {
255 genericScopeView.scope.searchQuery = "test"
255 genericScopeView.scope.searchQuery = "test"
256 genericScopeView.scope = scopes.get(1)
256 genericScopeView.scope = scopes.get(1)
257− genericScopeView.scope = scopes.get(0)
257+ genericScopeView.scope = scopes.get(2)
258 tryCompare(genericScopeView.scope, "searchQuery", "")
258 tryCompare(genericScopeView.scope, "searchQuery", "")
259 }
259 }
260
260
261 function test_filter_expand_collapse() {
261 function test_filter_expand_collapse() {
262 // wait for the item to be there
262 // wait for the item to be there
263− tryCompareFunction(function() { return findChild(genericScopeView, "dashSectionHeader0") != undefined; }, true);
263+ tryCompareFunction(function() { return findChild(genericScopeView, "dashSectionHeader0") != null; }, true);
264
264
265 var header = findChild(genericScopeView, "dashSectionHeader0")
265 var header = findChild(genericScopeView, "dashSectionHeader0")
266 var category = findChild(genericScopeView, "dashCategory0")
266 var category = findChild(genericScopeView, "dashCategory0")
@@ -282,7 +282,7 @@ Item {
282 }
282 }
283
283
284 function test_showPreviewCarousel() {
284 function test_showPreviewCarousel() {
285− tryCompareFunction(function() { return findChild(genericScopeView, "carouselDelegate") != undefined; }, true);
285+ tryCompareFunction(function() { return findChild(genericScopeView, "carouselDelegate") != null; }, true);
286 var tile = findChild(genericScopeView, "carouselDelegate");
286 var tile = findChild(genericScopeView, "carouselDelegate");
287 mouseClick(tile, tile.width / 2, tile.height / 2);
287 mouseClick(tile, tile.width / 2, tile.height / 2);
288 tryCompare(openEffect, "gap", 1);
288 tryCompare(openEffect, "gap", 1);
@@ -310,13 +310,13 @@ Item {
310
310
311 function test_filter_expand_expand() {
311 function test_filter_expand_expand() {
312 // wait for the item to be there
312 // wait for the item to be there
313− tryCompareFunction(function() { return findChild(genericScopeView, "dashSectionHeaderinstalled") != undefined; }, true);
313+ tryCompareFunction(function() { return findChild(genericScopeView, "dashSectionHeaderapplications.scope") != null; }, true);
314
314
315 var categoryListView = findChild(genericScopeView, "categoryListView");
315 var categoryListView = findChild(genericScopeView, "categoryListView");
316 categoryListView.contentY = categoryListView.height;
316 categoryListView.contentY = categoryListView.height;
317
317
318− var header2 = findChild(genericScopeView, "dashSectionHeaderinstalled")
318+ var header2 = findChild(genericScopeView, "dashSectionHeaderapplications.scope")
319− var category2 = findChild(genericScopeView, "dashCategoryinstalled")
319+ var category2 = findChild(genericScopeView, "dashCategoryapplications.scope")
320 var category2FilterGrid = category2.children[0].children[0].children[0];
320 var category2FilterGrid = category2.children[0].children[0].children[0];
321 verify(UT.Util.isInstanceOf(category2FilterGrid, "FilterGrid"));
321 verify(UT.Util.isInstanceOf(category2FilterGrid, "FilterGrid"));
322
322
@@ -346,17 +346,17 @@ Item {
346 tryCompare(category2FilterGrid, "filter", true);
346 tryCompare(category2FilterGrid, "filter", true);
347 }
347 }
348
348
349− function test_no_move_y_no_preview() {
349+ function test_bug1271676_no_move_y_no_preview() {
350 waitForRendering(genericScopeView);
350 waitForRendering(genericScopeView);
351 var categoryListView = findChild(genericScopeView, "categoryListView");
351 var categoryListView = findChild(genericScopeView, "categoryListView");
352 waitForRendering(categoryListView);
352 waitForRendering(categoryListView);
353− var category = findChild(genericScopeView, "dashCategoryinstalled")
353+ var category = findChild(genericScopeView, "dashCategoryapplications.scope")
354 categoryListView.contentY = category.y;
354 categoryListView.contentY = category.y;
355 waitForRendering(categoryListView);
355 waitForRendering(categoryListView);
356 var contentYBefore = categoryListView.contentY
356 var contentYBefore = categoryListView.contentY
357− openPreview("installed", false); // This actually doesn't open anything because we
357+ openPreview("applications.scope", false); // This actually doesn't open anything because we
358− // have code so that the item of installed
358+ // have code so that the item of installed
359− // does activate instead of preview and never shows a preview
359+ // does activate instead of preview and never shows a preview
360 compare(categoryListView.contentY, contentYBefore);
360 compare(categoryListView.contentY, contentYBefore);
361 }
361 }
362 }
362 }