on xenial help sign in
added dash drag test
6737ae1Nick Dedekind
tests/mocks/Unity/Application/ApplicationManager.cpp−1
@@ -302,7 +302,6 @@ void ApplicationManager::buildListOfAvailableApplications()
302 application->setAppId("unity8-dash");
302 application->setAppId("unity8-dash");
303 application->setName("Unity 8 Mock Dash");
303 application->setName("Unity 8 Mock Dash");
304 application->setScreenshotId("unity8-dash");
304 application->setScreenshotId("unity8-dash");
305− application->setSupportedOrientations(Qt::PrimaryOrientation);
306 m_availableApplications.append(application);
305 m_availableApplications.append(application);
307
306
308 application = new ApplicationInfo(this);
307 application = new ApplicationInfo(this);
tests/qmltests/Stages/tst_TabletStage.qml+35
@@ -570,6 +570,8 @@ Rectangle {
570 pos >= end_pos;
570 pos >= end_pos;
571 });
571 });
572
572
573+ var spreadView = findChild(tabletStageLoader, "spreadView")
574+ tryCompare(spreadView, "surfaceDragging", false);
573 tryCompare(appDelegate, "stage", ApplicationInfoInterface.SideStage);
575 tryCompare(appDelegate, "stage", ApplicationInfoInterface.SideStage);
574 }
576 }
575
577
@@ -598,6 +600,8 @@ Rectangle {
598 return pos <= end_pos;
600 return pos <= end_pos;
599 });
601 });
600
602
603+ var spreadView = findChild(tabletStageLoader, "spreadView")
604+ tryCompare(spreadView, "surfaceDragging", false);
601 tryCompare(appDelegate, "stage", ApplicationInfoInterface.MainStage);
605 tryCompare(appDelegate, "stage", ApplicationInfoInterface.MainStage);
602 }
606 }
603
607
@@ -752,7 +756,38 @@ Rectangle {
752 pos >= end_pos;
756 pos >= end_pos;
753 });
757 });
754
758
759+ var spreadView = findChild(tabletStageLoader, "spreadView")
760+ tryCompare(spreadView, "surfaceDragging", false);
755 tryCompare(appDelegate.surface, "activeFocus", true);
761 tryCompare(appDelegate.surface, "activeFocus", true);
756 }
762 }
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+ }
757 }
792 }
758}
793}