@@ -1,5 +1,6 @@
11/*
22 * Copyright (C) 2013-2016 Canonical, Ltd.
3+ * Copyright (C) 2019 UBports Foundation
34 *
45 * This program is free software; you can redistribute it and/or modify
56 * it under the terms of the GNU General Public License as published by
@@ -869,6 +870,30 @@ Rectangle {
869870 tryCompare(launcher, "state", "visibleTemporary");
870871 }
871872
873+ function waitUntilFocusedApplicationIsShowingItsSurface()
874+ {
875+ var spreadDelegate = findChild(shell, "appDelegate_" + topLevelSurfaceList.idAt(0));
876+ var appState = findInvisibleChild(spreadDelegate, "applicationWindowStateGroup");
877+ tryCompare(appState, "state", "surface");
878+ var transitions = appState.transitions;
879+ for (var i = 0; i < transitions.length; ++i) {
880+ var transition = transitions[i];
881+ tryCompare(transition, "running", false, 2000);
882+ }
883+ }
884+
885+ function swipeFromRightEdgeToShowAppSpread()
886+ {
887+ // perform a right-edge drag to show the spread
888+ var touchStartX = shell.width - (shell.edgeSize / 2)
889+ var touchStartY = shell.height / 2;
890+ touchFlick(shell, touchStartX, touchStartY, units.gu(1) /* endX */, touchStartY /* endY */);
891+
892+ // check if it's indeed showing the spread
893+ var stage = findChild(shell, "stage");
894+ tryCompare(stage, "state", "spread");
895+ }
896+
872897 function test_snapDecisionDismissalReturnsFocus() {
873898 loadShell("phone");
874899 swipeAwayGreeter();
@@ -1351,30 +1376,6 @@ Rectangle {
13511376 tryCompare(topmostSurfaceItem, "touchReleaseCount", 0);
13521377 }
13531378
1354− function waitUntilFocusedApplicationIsShowingItsSurface()
1355− {
1356− var spreadDelegate = findChild(shell, "appDelegate_" + topLevelSurfaceList.idAt(0));
1357− var appState = findInvisibleChild(spreadDelegate, "applicationWindowStateGroup");
1358− tryCompare(appState, "state", "surface");
1359− var transitions = appState.transitions;
1360− for (var i = 0; i < transitions.length; ++i) {
1361− var transition = transitions[i];
1362− tryCompare(transition, "running", false, 2000);
1363− }
1364− }
1365−
1366− function swipeFromRightEdgeToShowAppSpread()
1367− {
1368− // perform a right-edge drag to show the spread
1369− var touchStartX = shell.width - (shell.edgeSize / 2)
1370− var touchStartY = shell.height / 2;
1371− touchFlick(shell, touchStartX, touchStartY, units.gu(1) /* endX */, touchStartY /* endY */);
1372−
1373− // check if it's indeed showing the spread
1374− var stage = findChild(shell, "stage");
1375− tryCompare(stage, "state", "spread");
1376− }
1377−
13781379 function test_physicalHomeKeyPressDoesNothingWithActiveGreeter() {
13791380 loadShell("phone");
13801381
@@ -2652,13 +2653,7 @@ Rectangle {
26522653 var cursor = findChild(shell, "cursor");
26532654 var indicators = findChild(shell, "indicators");
26542655
2655− // Open indicators
2656− var touchX = shell.width - units.gu(5);
2657− touchFlick(shell,
2658− touchX /* fromX */, indicators.minimizedPanelHeight * 0.5 /* fromY */,
2659− touchX /* toX */, shell.height * 0.9 /* toY */,
2660− true /* beginTouch */, true /* endTouch */);
2661− tryCompare(indicators, "fullyOpened", true);
2656+ showIndicators();
26622657
26632658 // push the right edge
26642659 mouseMove(shell, shell.width - 1, units.gu(10));