on xenial help sign in
test updates
commit75777221f420ef0067562500e2183419beff040a authorMichael Zanetti <michael.zanetti@canonical.com> dateTue 15 Nov 2016, 10:29 (10 years ago) parent57306f8
2 files changed+2−209
tests/qmltests/tst_Shell.qml+2−143 tests/qmltests/tst_ShellWithPin.qml−66
tests/qmltests/tst_Shell.qml+2−143
@@ -605,38 +605,6 @@ Rectangle {
605605 compare(ApplicationManager.get(0).appId, "unity8-dash");
606606 }
607607
608− function test_phoneLeftEdgeDrag_data() {
609− return [
610− {tag: "without launcher",
611− revealLauncher: false, swipeLength: units.gu(30), appHides: true, focusedApp: "dialer-app",
612− launcherHides: true, greeterShown: false},
613−
614− {tag: "with launcher",
615− revealLauncher: true, swipeLength: units.gu(30), appHides: true, focusedApp: "dialer-app",
616− launcherHides: true, greeterShown: false},
617−
618− {tag: "small swipe",
619− revealLauncher: false, swipeLength: units.gu(25), appHides: false, focusedApp: "dialer-app",
620− launcherHides: false, greeterShown: false},
621−
622− {tag: "long swipe",
623− revealLauncher: false, swipeLength: units.gu(30), appHides: true, focusedApp: "dialer-app",
624− launcherHides: true, greeterShown: false},
625−
626− {tag: "small swipe with greeter",
627− revealLauncher: false, swipeLength: units.gu(25), appHides: false, focusedApp: "dialer-app",
628− launcherHides: false, greeterShown: true},
629−
630− {tag: "long swipe with greeter",
631− revealLauncher: false, swipeLength: units.gu(30), appHides: true, focusedApp: "dialer-app",
632− launcherHides: true, greeterShown: true},
633−
634− {tag: "swipe over dash",
635− revealLauncher: false, swipeLength: units.gu(30), appHides: true, focusedApp: "unity8-dash",
636− launcherHides: false, greeterShown: false},
637− ];
638− }
639−
640608 function test_snapDecisionDismissalReturnsFocus() {
641609 loadShell("phone");
642610 swipeAwayGreeter();
@@ -701,80 +669,6 @@ Rectangle {
701669 mockNotificationsModel.append(n)
702670 }
703671
704− function test_phoneLeftEdgeDrag(data) {
705− loadShell("phone");
706− swipeAwayGreeter();
707− dragLauncherIntoView();
708− var appSurfaceId = topLevelSurfaceList.nextId;
709− tapOnAppIconInLauncher();
710− waitUntilAppWindowIsFullyLoaded(appSurfaceId);
711−
712− var greeter = findChild(shell, "greeter");
713− if (data.greeterShown) {
714− showGreeter();
715− }
716−
717− if (data.revealLauncher) {
718− dragLauncherIntoView();
719− }
720−
721− swipeFromLeftEdge(data.swipeLength);
722− if (data.appHides) {
723− waitUntilDashIsFocused();
724− tryCompare(greeter, "shown", false);
725− } else {
726− tryCompare(greeter, "fullyShown", data.greeterShown);
727− }
728−
729− var launcher = findChild(shell, "launcherPanel");
730− tryCompare(launcher, "x", data.launcherHides ? -launcher.width : 0)
731−
732− //FIXME: This check fails. Don't understand the rationale behind it.
733− /*
734− // Make sure the helper for sliding out the launcher wasn't touched. We want to fade it out here.
735− var animateTimer = findInvisibleChild(shell, "animateTimer");
736− compare(animateTimer.nextState, "visible");
737− */
738− }
739−
740− function test_tabletLeftEdgeDrag_data() {
741− return [
742− {tag: "without password", user: "no-password", loggedIn: true},
743− {tag: "with password", user: "has-password", loggedIn: false},
744− ]
745− }
746−
747− function test_tabletLeftEdgeDrag(data) {
748− setLightDMMockMode("full");
749− loadShell("tablet");
750−
751− selectUser(data.user)
752−
753− swipeFromLeftEdge(shell.width * 0.75)
754− wait(500) // to give time to handle dash() signal from Launcher
755− confirmLoggedIn(data.loggedIn)
756− }
757−
758− function test_longLeftEdgeSwipeTakesToAppsAndResetSearchString() {
759− loadShell("phone");
760− swipeAwayGreeter();
761− dragLauncherIntoView();
762− dashCommunicatorSpy.clear();
763−
764− var appSurfaceId = topLevelSurfaceList.nextId;
765− tapOnAppIconInLauncher();
766− waitUntilAppWindowIsFullyLoaded(appSurfaceId);
767−
768− tryCompareFunction(function() { return ApplicationManager.focusedApplicationId !== "unity8-dash"; }, true);
769−
770− //Long left swipe
771− swipeFromLeftEdge(units.gu(30));
772−
773− tryCompare(ApplicationManager, "focusedApplicationId", "unity8-dash");
774−
775− compare(dashCommunicatorSpy.count, 1);
776− }
777−
778672 function test_ClickUbuntuIconInLauncherTakesToAppsAndResetSearchString() {
779673 loadShell("phone");
780674 swipeAwayGreeter();
@@ -913,39 +807,6 @@ Rectangle {
913807 LightDM.Users.mockMode = mode;
914808 }
915809
916− /*
917− Regression test for bug https://bugs.launchpad.net/touch-preview-images/+bug/1193419
918−
919− When the user minimizes an application (left-edge swipe) he should always end up in the
920− "Applications" scope view.
921−
922− Steps:
923− - reveal launcher and launch an app that covers the dash
924− - perform long left edge swipe to go minimize the app and go back to the dash.
925− - verify the setCurrentScope() D-Bus call to the dash has been called for the correct scope id.
926− */
927− function test_minimizingAppTakesToDashApps() {
928− loadShell("phone");
929− swipeAwayGreeter();
930− dragLauncherIntoView();
931−
932− // Launch an app from the launcher
933− var appSurfaceId = topLevelSurfaceList.nextId;
934− tapOnAppIconInLauncher();
935− waitUntilAppWindowIsFullyLoaded(appSurfaceId);
936−
937− verify(ApplicationManager.focusedApplicationId !== "unity8-dash")
938−
939− dashCommunicatorSpy.clear();
940− // Minimize the application we just launched
941− swipeFromLeftEdge(shell.width * 0.75);
942−
943− tryCompare(ApplicationManager, "focusedApplicationId", "unity8-dash");
944−
945− compare(dashCommunicatorSpy.count, 1);
946− compare(dashCommunicatorSpy.signalArguments[0][0], 0);
947− }
948−
949810 function test_showInputMethod() {
950811 loadShell("phone");
951812 swipeAwayGreeter();
@@ -1166,7 +1027,7 @@ Rectangle {
11661027
11671028 // Place the mouse against the window/screen edge and push beyond the barrier threshold
11681029 mouseMove(shell, 0, shell.height / 2);
1169− launcher.pushEdge(EdgeBarrierSettings.pushThreshold * 1.1);
1030+ launcher.pushEdge(EdgeBarrierSettings.pushThreshold * .8);
11701031
11711032 var panel = findChild(launcher, "launcherPanel");
11721033 verify(panel);
@@ -1186,9 +1047,7 @@ Rectangle {
11861047 waitUntilAppWindowIsFullyLoaded(appSurfaceId);
11871048
11881049 // Minimize the application we just launched
1189− swipeFromLeftEdge(shell.width * 0.75);
1190−
1191− waitUntilDashIsFocused();
1050+ swipeFromLeftEdge(units.gu(15));
11921051
11931052 showGreeter();
11941053
tests/qmltests/tst_ShellWithPin.qml−66
@@ -547,71 +547,5 @@ Item {
547547 var lockscreen = findChild(shell, "lockscreen");
548548 verify(lockscreen.shown);
549549 }
550−
551− /*
552− Regression test for https://bugs.launchpad.net/ubuntu/+source/unity8/+bug/1393447
553−
554− Do a left edge drag that is long enough to start displacing the greeter
555− but short engough so that the greeter comes back into place once the
556− finger is lifted.
557−
558− In this situation the launcher should remaing fully shown and hide itself
559− only after its idle timeout is triggered.
560− */
561− function test_shortLeftEdgeSwipeMakesLauncherStayVisible() {
562− showGreeter();
563−
564− var launcher = testCase.findChild(shell, "launcher")
565− var launcherPanel = testCase.findChild(launcher, "launcherPanel");
566−
567− var toX = shell.width * 0.45;
568− touchFlick(shell,
569− 1 /* fromX */, shell.height * 0.5 /* fromY */,
570− toX /* toX */, shell.height * 0.5 /* toY */,
571− true /* beginTouch */, false /* endTouch */,
572− 50, 100);
573−
574− // Launcher must be fully shown by now
575− tryCompare(launcherPanel, "x", 0);
576−
577− // Greeter should be displaced
578− var coverPage = findChild(shell, "coverPage");
579− tryCompareFunction(function() { return coverPage.mapToItem(shell, 0, 0).x > shell.width*0.2; }, true);
580−
581− touchRelease(shell, toX, shell.height * 0.5);
582−
583− // Upon release the greeter should have slid back into full view
584− tryCompareFunction(function() { return coverPage.mapToItem(shell, 0, 0).x === 0; }, true);
585−
586− // And the launcher should stay fully shown
587− for (var i = 0; i < 10; ++i) {
588− wait(50);
589− compare(launcherPanel.x, 0);
590− }
591− }
592−
593− function test_longLeftEdgeDrags() {
594− var coverPage = findChild(shell, "coverPage");
595− var lockscreen = findChild(shell, "lockscreen");
596− var launcher = findChild(shell, "launcherPanel");
597− var galleryApp = ApplicationManager.startApplication("gallery-app");
598− tryCompare(shell, "mainApp", galleryApp);
599−
600− // Show greeter
601− showGreeter();
602−
603− // Swipe cover page away
604− touchFlick(shell, 2, shell.height / 2, units.gu(30), shell.height / 2);
605− tryCompare(launcher, "x", -launcher.width);
606− tryCompare(coverPage, "showProgress", 0);
607− compare(lockscreen.shown, true);
608− tryCompare(shell, "mainApp", galleryApp);
609−
610− // Now attempt a swipe on lockscreen
611− touchFlick(shell, 2, shell.height / 2, units.gu(30), shell.height / 2);
612− tryCompare(launcher, "x", 0);
613− compare(lockscreen.shown, true);
614− tryCompare(shell, "mainApp", galleryApp);
615− }
616550 }
617551}