on xenial help sign in
added dash drag test
commit6737ae15f85ba34a1bbf1dfc47bbf0ea0ae55470 authorNick Dedekind <nick.dedekind@canonical.com> dateTue 14 Jun 2016, 16:38 (10 years ago) parent0b18dd1
2 files changed+35−1
tests/mocks/Unity/Application/ApplicationManager.cpp−1 tests/qmltests/Stages/tst_TabletStage.qml+35
tests/mocks/Unity/Application/ApplicationManager.cpp−1
@@ -302,7 +302,6 @@ void ApplicationManager::buildListOfAvailableApplications()
302302 application->setAppId("unity8-dash");
303303 application->setName("Unity 8 Mock Dash");
304304 application->setScreenshotId("unity8-dash");
305− application->setSupportedOrientations(Qt::PrimaryOrientation);
306305 m_availableApplications.append(application);
307306
308307 application = new ApplicationInfo(this);
tests/qmltests/Stages/tst_TabletStage.qml+35
@@ -570,6 +570,8 @@ Rectangle {
570570 pos >= end_pos;
571571 });
572572
573+ var spreadView = findChild(tabletStageLoader, "spreadView")
574+ tryCompare(spreadView, "surfaceDragging", false);
573575 tryCompare(appDelegate, "stage", ApplicationInfoInterface.SideStage);
574576 }
575577
@@ -598,6 +600,8 @@ Rectangle {
598600 return pos <= end_pos;
599601 });
600602
603+ var spreadView = findChild(tabletStageLoader, "spreadView")
604+ tryCompare(spreadView, "surfaceDragging", false);
601605 tryCompare(appDelegate, "stage", ApplicationInfoInterface.MainStage);
602606 }
603607
@@ -752,7 +756,38 @@ Rectangle {
752756 pos >= end_pos;
753757 });
754758
759+ var spreadView = findChild(tabletStageLoader, "spreadView")
760+ tryCompare(spreadView, "surfaceDragging", false);
755761 tryCompare(appDelegate.surface, "activeFocus", true);
756762 }
763+
764+ function test_dashDoesNotDragToSidestage() {
765+ sideStage.showNow();
766+ compare(topSurfaceList.applicationAt(0).appId, "unity8-dash");
767+ var dashSurfaceId = topSurfaceList.idAt(0);
768+
769+ var appDelegate = findChild(tabletStage, "spreadDelegate_" + dashSurfaceId);
770+ verify(appDelegate);
771+ compare(appDelegate.stage, ApplicationInfoInterface.MainStage);
772+
773+ var pos = tabletStage.width - sideStage.width - (tabletStage.width - sideStage.width) / 2;
774+ var end_pos = tabletStage.width - sideStage.width / 2;
775+
776+ multiTouchDragUntil([0,1,2],
777+ tabletStage,
778+ pos,
779+ tabletStage.height / 2,
780+ units.gu(3),
781+ 0,
782+ function() {
783+ pos += units.gu(3);
784+ return sideStage.shown && !sideStage.showAnimation.running &&
785+ pos >= end_pos;
786+ });
787+
788+ var spreadView = findChild(tabletStageLoader, "spreadView")
789+ tryCompare(spreadView, "surfaceDragging", false);
790+ tryCompare(appDelegate, "stage", ApplicationInfoInterface.MainStage);
791+ }
757792 }
758793}