on xenial help sign in
fix testPhoneStage
commit4b39246852a1632cd7e9ced9a5387595c5b3b891 authorMichael Zanetti <michael.zanetti@canonical.com> dateThu 24 Jul 2014, 23:56 (12 years ago) parentb188a8a
2 files changed+17−35
tests/qmltests/Stages/tst_PhoneStage.qml+4−35 tests/qmltests/tst_Shell.qml+13
tests/qmltests/Stages/tst_PhoneStage.qml+4−35
@@ -44,7 +44,6 @@ Item {
4444
4545 Rectangle {
4646 anchors { fill: parent; leftMargin: phoneStage.width }
47−// color: "blue"
4847
4948 Column {
5049 anchors { left: parent.left; right: parent.right; top: parent.top; margins: units.gu(1) }
@@ -58,7 +57,10 @@ Item {
5857 }
5958 Button {
6059 anchors { left: parent.left; right: parent.right }
61− text: "Add App"
60+ text: "Remove App"
61+ onClicked: {
62+ ApplicationManager.stopApplication(ApplicationManager.get(0).appId)
63+ }
6264 }
6365 }
6466 }
@@ -228,39 +230,6 @@ Item {
228230 compare(ApplicationManager.focusedApplicationId, selectedApp.appId);
229231 }
230232
231− function test_fullscreenMode() {
232− var fullscreenApp = null;
233− var normalApp = null;
234−
235− for (var i = 0; i < 5; i++) {
236− addApps(1);
237− var newApp = ApplicationManager.get(0);
238− tryCompare(phoneStage, "fullscreen", newApp.fullscreen);
239− if (newApp.fullscreen && fullscreenApp == null) {
240− fullscreenApp = newApp;
241− } else if (!newApp.fullscreen && normalApp == null){
242− normalApp = newApp;
243− }
244− }
245− verify(fullscreenApp != null); // Can't continue the test without having a fullscreen app
246− verify(normalApp != null); // Can't continue the test without having a non-fullscreen app
247−
248− // Select a normal app
249− goToSpread();
250− phoneStage.select(normalApp.appId);
251− tryCompare(phoneStage, "fullscreen", false);
252−
253− // Select a fullscreen app
254− goToSpread();
255− phoneStage.select(fullscreenApp.appId);
256− tryCompare(phoneStage, "fullscreen", true);
257−
258− // Select a normal app
259− goToSpread();
260− phoneStage.select(normalApp.appId);
261− tryCompare(phoneStage, "fullscreen", false);
262− }
263−
264233 function cleanup() {
265234 while (ApplicationManager.count > 0) {
266235 var oldCount = ApplicationManager.count;
tests/qmltests/tst_Shell.qml+13
@@ -621,5 +621,18 @@ Item {
621621 swipeAwayGreeter()
622622 tryCompare(sessionSpy, "count", 1)
623623 }
624+
625+ function test_fullscreen() {
626+ var panel = findChild(shell, "panel");
627+ compare(panel.fullscreenMode, false);
628+ ApplicationManager.startApplication("camera-app");
629+ tryCompare(panel, "fullscreenMode", true);
630+ ApplicationManager.startApplication("gallery-app");
631+ tryCompare(panel, "fullscreenMode", false);
632+ ApplicationManager.requestFocusApplication("camera-app");
633+ tryCompare(panel, "fullscreenMode", true);
634+ ApplicationManager.requestFocusApplication("gallery-app");
635+ tryCompare(panel, "fullscreenMode", false);
636+ }
624637 }
625638}