on xenial help sign in
Fix some tst_OrientedShell tests
4765af4Daniel d'Andrada
plugins/WindowManager/Window.cpp+1−1
@@ -156,7 +156,7 @@ void Window::setSurface(unityapi::MirSurfaceInterface *surface)
156 if (m_positionRequested) {
156 if (m_positionRequested) {
157 m_surface->setRequestedPosition(m_requestedPosition);
157 m_surface->setRequestedPosition(m_requestedPosition);
158 }
158 }
159− if (m_stateRequested) {
159+ if (m_stateRequested && m_surface->state() == Mir::RestoredState) {
160 m_surface->requestState(m_state);
160 m_surface->requestState(m_state);
161 }
161 }
162
162
tests/mocks/Unity/Application/MirSurface.cpp+1−1
@@ -91,7 +91,7 @@ MirSurface::MirSurface(const QString& name,
91 , m_slowToResize(false)
91 , m_slowToResize(false)
92 , m_shellChrome(Mir::NormalChrome)
92 , m_shellChrome(Mir::NormalChrome)
93{
93{
94− DEBUG_MSG("");
94+ DEBUG_MSG("state=" << stateToStr(state));
95
95
96 QQmlEngine::setObjectOwnership(this, QQmlEngine::CppOwnership);
96 QQmlEngine::setObjectOwnership(this, QQmlEngine::CppOwnership);
97
97
tests/qmltests/tst_OrientedShell.qml+10−4
@@ -980,6 +980,11 @@ Rectangle {
980 function test_launchLandscapeOnlyAppOverPortraitOnlyDashThenSwitchToDash() {
980 function test_launchLandscapeOnlyAppOverPortraitOnlyDashThenSwitchToDash() {
981 loadShell("mako");
981 loadShell("mako");
982
982
983+ var dashSurfaceId = topLevelSurfaceList.nextId;
984+ var dashApp = ApplicationManager.startApplication("unity8-dash");
985+ verify(dashApp);
986+ waitUntilAppWindowIsFullyLoaded(dashSurfaceId);
987+
983 // starts as portrait, as unity8-dash is portrait only
988 // starts as portrait, as unity8-dash is portrait only
984 tryCompare(shell, "transformRotationAngle", 0);
989 tryCompare(shell, "transformRotationAngle", 0);
985
990
@@ -999,7 +1004,10 @@ Rectangle {
999 var rotationStates = findInvisibleChild(orientedShell, "rotationStates");
1004 var rotationStates = findInvisibleChild(orientedShell, "rotationStates");
1000 waitUntilTransitionsEnd(rotationStates);
1005 waitUntilTransitionsEnd(rotationStates);
1001
1006
1002− performLeftEdgeSwipeToSwitchToDash();
1007+ performLeftEdgeSwipe();
1008+
1009+ // should have switched to dash
1010+ tryCompare(ApplicationManager, "focusedApplicationId", "unity8-dash");
1003
1011
1004 // Should be back to portrait
1012 // Should be back to portrait
1005 tryCompare(shell, "transformRotationAngle", 0);
1013 tryCompare(shell, "transformRotationAngle", 0);
@@ -1391,7 +1399,7 @@ Rectangle {
1391 waitUntilTransitionsEnd(rotationStates);
1399 waitUntilTransitionsEnd(rotationStates);
1392 }
1400 }
1393
1401
1394− function performLeftEdgeSwipeToSwitchToDash() {
1402+ function performLeftEdgeSwipe() {
1395 var swipeLength = shell.width * 0.7;
1403 var swipeLength = shell.width * 0.7;
1396
1404
1397 var touchStartX = 1;
1405 var touchStartX = 1;
@@ -1399,8 +1407,6 @@ Rectangle {
1399 touchFlick(shell,
1407 touchFlick(shell,
1400 touchStartX, touchStartY,
1408 touchStartX, touchStartY,
1401 touchStartX + swipeLength, touchStartY);
1409 touchStartX + swipeLength, touchStartY);
1402−
1403− tryCompare(ApplicationManager, "focusedApplicationId", "unity8-dash");
1404 }
1410 }
1405
1411
1406 function performEdgeSwipeToSwitchToPreviousApp() {
1412 function performEdgeSwipeToSwitchToPreviousApp() {