on xenial help sign in
fix testPhoneStage
4b39246Michael Zanetti
tests/qmltests/Stages/tst_PhoneStage.qml+4−35
@@ -44,7 +44,6 @@ Item {
44
44
45 Rectangle {
45 Rectangle {
46 anchors { fill: parent; leftMargin: phoneStage.width }
46 anchors { fill: parent; leftMargin: phoneStage.width }
47−// color: "blue"
48
47
49 Column {
48 Column {
50 anchors { left: parent.left; right: parent.right; top: parent.top; margins: units.gu(1) }
49 anchors { left: parent.left; right: parent.right; top: parent.top; margins: units.gu(1) }
@@ -58,7 +57,10 @@ Item {
58 }
57 }
59 Button {
58 Button {
60 anchors { left: parent.left; right: parent.right }
59 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+ }
62 }
64 }
63 }
65 }
64 }
66 }
@@ -228,39 +230,6 @@ Item {
228 compare(ApplicationManager.focusedApplicationId, selectedApp.appId);
230 compare(ApplicationManager.focusedApplicationId, selectedApp.appId);
229 }
231 }
230
232
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−
264 function cleanup() {
233 function cleanup() {
265 while (ApplicationManager.count > 0) {
234 while (ApplicationManager.count > 0) {
266 var oldCount = ApplicationManager.count;
235 var oldCount = ApplicationManager.count;
tests/qmltests/tst_Shell.qml+13
@@ -621,5 +621,18 @@ Item {
621 swipeAwayGreeter()
621 swipeAwayGreeter()
622 tryCompare(sessionSpy, "count", 1)
622 tryCompare(sessionSpy, "count", 1)
623 }
623 }
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+ }
624 }
637 }
625}
638}