on xenial help sign in
fix testShellWithPin
commit32b483dfe3dd7b49ef452d9fbc8c603760980af1 authorMichael Zanetti <michael.zanetti@canonical.com> dateWed 21 Sep 2016, 10:38 (10 years ago) parent5eb6a54faed16c
2 files changed+10−11
tests/qmltests/Stage/tst_TabletStage.qml+1 tests/qmltests/tst_ShellWithPin.qml+9−11
tests/qmltests/Stage/tst_TabletStage.qml+1
@@ -87,6 +87,7 @@ Rectangle {
8787 Button {
8888 text: testCase.sideStage ? testCase.sideStage.shown ? "Hide Side-stage" : "Show Side-stage" : ""
8989 enabled: testCase.sideStage
90+ activeFocusOnPress: false
9091 onClicked: {
9192 if (testCase.sideStage.shown) testCase.sideStage.hide();
9293 else testCase.sideStage.show();
tests/qmltests/tst_ShellWithPin.qml+9−11
@@ -393,24 +393,23 @@ Item {
393393 // dialer to a side stage and give access to other apps. So just
394394 // confirm that such an attack doesn't work.
395395
396− var applicationsDisplayLoader = findChild(shell, "applicationsDisplayLoader")
396+ var stage = findChild(shell, "stage")
397397
398398 // We start in phone mode
399− compare(shell.usageScenario, "phone");
400− compare(applicationsDisplayLoader.usageScenario, "phone");
399+ compare(stage.usageScenario, "phone");
401400
402401 tap(findChild(shell, "emergencyCallLabel"));
403402 confirmLockedApp("dialer-app")
404403
405404 // OK, we're in. Now try (but fail) to switch to tablet mode
406405 shell.usageScenario = "tablet";
407− compare(applicationsDisplayLoader.usageScenario, "phone");
406+ compare(stage.usageScenario, "phone");
408407
409408 // And when we kill the app, we go back to locked tablet mode
410409 killApps()
411410 var greeter = findChild(shell, "greeter")
412411 tryCompare(greeter, "fullyShown", true)
413− compare(applicationsDisplayLoader.usageScenario, "tablet");
412+ compare(stage.usageScenario, "tablet");
414413 }
415414
416415 function test_emergencyDialerIncoming() {
@@ -497,13 +496,13 @@ Item {
497496
498497 function test_suspend() {
499498 var greeter = findChild(shell, "greeter");
500− var applicationsDisplayLoader = findChild(shell, "applicationsDisplayLoader")
499+ var stage = findChild(shell, "stage")
501500
502501 // Put it to sleep
503502 Powerd.setStatus(Powerd.Off, Powerd.Unknown);
504503
505− // If locked, applicationsDisplayLoader.item.suspended should be true
506− tryCompare(applicationsDisplayLoader.item, "suspended", true);
504+ // If locked, stage.suspended should be true
505+ tryCompare(stage, "suspended", true);
507506
508507 // And wake up
509508 Powerd.setStatus(Powerd.On, Powerd.Unknown);
@@ -513,13 +512,12 @@ Item {
513512 swipeAwayGreeter(true);
514513
515514 // We have a lockscreen, make sure we're still suspended
516− tryCompare(applicationsDisplayLoader.item, "suspended", true);
515+ tryCompare(stage, "suspended", true);
517516
518517 enterPin("1234")
519518
520519 // Now that the lockscreen has gone too, make sure we're waking up
521− tryCompare(applicationsDisplayLoader.item, "suspended", false);
522−
520+ tryCompare(stage, "suspended", false);
523521 }
524522
525523 /* We had a bug (1395075) where if a user kept swiping as the greeter