on xenial help sign in
Test uri dispatcher does what it has to do

The uri dispatcher calls are not dbus activated but fake signals, but here we're not testing the uri dispatcher itself that is on the SDK just checking that when it's activated it does what it should

commit882aaef188bba0384b01dcbdfd7cdd7f1a96cce5 authorAlbert Astals Cid <albert.astals@canonical.com> dateFri 27 Mar 2015, 13:15 (12 years ago) parent4f246ba
1 file changed+48
tests/qmltests/Dash/tst_Dash.qml+48
tests/qmltests/Dash/tst_Dash.qml+48
@@ -517,5 +517,53 @@ Item {
517517 tryCompare(dashTempScopeItem, "x", dash.width);
518518 tryCompare(dashTempScopeItem, "visible", false);
519519 }
520+
521+ function test_UriDispatcher()
522+ {
523+ var dashContentList = findChild(dash, "dashContentList");
524+
525+ UriHandler.opened("scopes://clickscope");
526+ tryCompare(dashContentList, "currentIndex", 1);
527+
528+ // Show the manage dash
529+ touchFlick(dash, dash.width / 2, dash.height - 1, dash.width / 2, units.gu(2));
530+ var bottomEdgeController = findInvisibleChild(dash, "bottomEdgeController");
531+ tryCompare(bottomEdgeController, "progress", 1);
532+
533+ // UriHandler changes to a scope and closes the manage scopes
534+ UriHandler.opened("scopes://MockScope1");
535+ tryCompare(dashContentList, "currentIndex", 0);
536+ tryCompare(bottomEdgeController, "progress", 0);
537+
538+ // Show a preview
539+ var scopeLoader0 = findChild(dashContent, "scopeLoader0");
540+ var dashCategory0 = findChild(scopeLoader0, "dashCategory0");
541+ var delegate0 = findChild(dashCategory0, "delegate0");
542+ mouseClick(delegate0);
543+ tryCompare(dashContent, "subPageShown", true)
544+
545+ // UriHandler changes to a scope and closes the manage scopes
546+ UriHandler.opened("scopes://clickscope");
547+ tryCompare(dashContentList, "currentIndex", 1);
548+ tryCompare(dashContent, "subPageShown", false);
549+
550+ // Go to a temp scope
551+ touchFlick(dash, dash.width / 2, dash.height - 1, dash.width / 2, units.gu(2));
552+ var bottomEdgeController = findInvisibleChild(dash, "bottomEdgeController");
553+ tryCompare(bottomEdgeController, "progress", 1);
554+ var nonfavScopesListCategory = findChild(dash, "scopesListCategoryother");
555+ var nonfavScopesListCategoryList = findChild(nonfavScopesListCategory, "scopesListCategoryInnerList");
556+ tryCompare(nonfavScopesListCategoryList, "currentIndex", 0);
557+ mouseClick(nonfavScopesListCategoryList.currentItem);
558+ var dashTempScopeItem = findChild(dash, "dashTempScopeItem");
559+ tryCompare(dashTempScopeItem, "x", 0);
560+ tryCompare(dashTempScopeItem, "visible", true);
561+
562+ // UriHandler changes to a scope and closes the temp scope
563+ UriHandler.opened("scopes://MockScope1");
564+ tryCompare(dashContentList, "currentIndex", 0);
565+ tryCompare(dashTempScopeItem, "x", dashTempScopeItem.width);
566+ tryCompare(dashTempScopeItem, "visible", false);
567+ }
520568 }
521569}