Backed out changeset f8c07a51e7ce (bug 1257526) for marionette failures

This commit is contained in:
Carsten "Tomcat" Book 2016-03-22 13:21:35 +01:00
parent dd50937aa3
commit 5d87e982dd
4 changed files with 10 additions and 34 deletions

View File

@ -2583,9 +2583,6 @@ GeckoDriver.prototype.takeScreenshot = function(cmd, resp) {
* landscape-secondary. * landscape-secondary.
*/ */
GeckoDriver.prototype.getScreenOrientation = function(cmd, resp) { GeckoDriver.prototype.getScreenOrientation = function(cmd, resp) {
if (this.appName == "Firefox") {
throw new UnsupportedOperationError();
}
resp.body.value = this.getCurrentWindow().screen.mozOrientation; resp.body.value = this.getCurrentWindow().screen.mozOrientation;
}; };
@ -2601,10 +2598,6 @@ GeckoDriver.prototype.getScreenOrientation = function(cmd, resp) {
* and "portrait-secondary" as well as "landscape-secondary". * and "portrait-secondary" as well as "landscape-secondary".
*/ */
GeckoDriver.prototype.setScreenOrientation = function(cmd, resp) { GeckoDriver.prototype.setScreenOrientation = function(cmd, resp) {
if (this.appName == "Firefox") {
throw new UnsupportedOperationError();
}
const ors = [ const ors = [
"portrait", "landscape", "portrait", "landscape",
"portrait-primary", "landscape-primary", "portrait-primary", "landscape-primary",

View File

@ -11,7 +11,6 @@ from .marionette_test import (
MarionetteTestCase, MarionetteTestCase,
skip, skip,
skip_if_b2g, skip_if_b2g,
skip_if_desktop,
SkipTest, SkipTest,
skip_unless_protocol, skip_unless_protocol,
) )

View File

@ -1,26 +1,22 @@
# -*- fill-column: 100; comment-column: 100; -*-
# This Source Code Form is subject to the terms of the Mozilla Public # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this # License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/. # file, You can obtain one at http://mozilla.org/MPL/2.0/.
from marionette_driver import errors from marionette_driver.errors import MarionetteException
from marionette import MarionetteTestCase, skip_if_b2g, skip_if_desktop from marionette import MarionetteTestCase
from mozrunner.devices.emulator_screen import EmulatorScreen from mozrunner.devices.emulator_screen import EmulatorScreen
default_orientation = "portrait-primary" default_orientation = "portrait-primary"
unknown_orientation = "Unknown screen orientation: %s" unknown_orientation = "Unknown screen orientation: %s"
class TestScreenOrientation(MarionetteTestCase): class TestScreenOrientation(MarionetteTestCase):
def setUp(self):
MarionetteTestCase.setUp(self)
self.is_mobile = self.marionette.session_capabilities["platformName"] != "Firefox"
def tearDown(self): def tearDown(self):
if self.is_mobile:
self.marionette.set_orientation(default_orientation) self.marionette.set_orientation(default_orientation)
self.assertEqual(self.marionette.orientation, default_orientation, "invalid state") self.assertEqual(self.marionette.orientation, default_orientation, "invalid state")
MarionetteTestCase.tearDown(self) super(MarionetteTestCase, self).tearDown()
@skip_if_desktop
def test_set_orientation_to_portrait_primary(self): def test_set_orientation_to_portrait_primary(self):
self.marionette.set_orientation("portrait-primary") self.marionette.set_orientation("portrait-primary")
new_orientation = self.marionette.orientation new_orientation = self.marionette.orientation
@ -30,7 +26,6 @@ class TestScreenOrientation(MarionetteTestCase):
emulator_orientation = self.marionette.emulator.screen.orientation emulator_orientation = self.marionette.emulator.screen.orientation
self.assertEqual(emulator_orientation, EmulatorScreen.SO_PORTRAIT_PRIMARY) self.assertEqual(emulator_orientation, EmulatorScreen.SO_PORTRAIT_PRIMARY)
@skip_if_desktop
def test_set_orientation_to_landscape_primary(self): def test_set_orientation_to_landscape_primary(self):
self.marionette.set_orientation("landscape-primary") self.marionette.set_orientation("landscape-primary")
new_orientation = self.marionette.orientation new_orientation = self.marionette.orientation
@ -40,7 +35,6 @@ class TestScreenOrientation(MarionetteTestCase):
emulator_orientation = self.marionette.emulator.screen.orientation emulator_orientation = self.marionette.emulator.screen.orientation
self.assertEqual(emulator_orientation, EmulatorScreen.SO_LANDSCAPE_PRIMARY) self.assertEqual(emulator_orientation, EmulatorScreen.SO_LANDSCAPE_PRIMARY)
@skip_if_desktop
def test_set_orientation_to_portrait_secondary(self): def test_set_orientation_to_portrait_secondary(self):
self.marionette.set_orientation("portrait-secondary") self.marionette.set_orientation("portrait-secondary")
new_orientation = self.marionette.orientation new_orientation = self.marionette.orientation
@ -50,7 +44,6 @@ class TestScreenOrientation(MarionetteTestCase):
emulator_orientation = self.marionette.emulator.screen.orientation emulator_orientation = self.marionette.emulator.screen.orientation
self.assertEqual(emulator_orientation, EmulatorScreen.SO_PORTRAIT_SECONDARY) self.assertEqual(emulator_orientation, EmulatorScreen.SO_PORTRAIT_SECONDARY)
@skip_if_desktop
def test_set_orientation_to_landscape_secondary(self): def test_set_orientation_to_landscape_secondary(self):
self.marionette.set_orientation("landscape-secondary") self.marionette.set_orientation("landscape-secondary")
new_orientation = self.marionette.orientation new_orientation = self.marionette.orientation
@ -60,7 +53,6 @@ class TestScreenOrientation(MarionetteTestCase):
emulator_orientation = self.marionette.emulator.screen.orientation emulator_orientation = self.marionette.emulator.screen.orientation
self.assertEqual(emulator_orientation, EmulatorScreen.SO_LANDSCAPE_SECONDARY) self.assertEqual(emulator_orientation, EmulatorScreen.SO_LANDSCAPE_SECONDARY)
@skip_if_desktop
def test_set_orientation_to_shorthand_portrait(self): def test_set_orientation_to_shorthand_portrait(self):
# Set orientation to something other than portrait-primary first, since the default is # Set orientation to something other than portrait-primary first, since the default is
# portrait-primary. # portrait-primary.
@ -75,7 +67,6 @@ class TestScreenOrientation(MarionetteTestCase):
emulator_orientation = self.marionette.emulator.screen.orientation emulator_orientation = self.marionette.emulator.screen.orientation
self.assertEqual(emulator_orientation, EmulatorScreen.SO_PORTRAIT_PRIMARY) self.assertEqual(emulator_orientation, EmulatorScreen.SO_PORTRAIT_PRIMARY)
@skip_if_desktop
def test_set_orientation_to_shorthand_landscape(self): def test_set_orientation_to_shorthand_landscape(self):
self.marionette.set_orientation("landscape") self.marionette.set_orientation("landscape")
new_orientation = self.marionette.orientation new_orientation = self.marionette.orientation
@ -85,23 +76,15 @@ class TestScreenOrientation(MarionetteTestCase):
emulator_orientation = self.marionette.emulator.screen.orientation emulator_orientation = self.marionette.emulator.screen.orientation
self.assertEqual(emulator_orientation, EmulatorScreen.SO_LANDSCAPE_PRIMARY) self.assertEqual(emulator_orientation, EmulatorScreen.SO_LANDSCAPE_PRIMARY)
@skip_if_desktop
def test_set_orientation_with_mixed_casing(self): def test_set_orientation_with_mixed_casing(self):
self.marionette.set_orientation("lAnDsCaPe") self.marionette.set_orientation("lAnDsCaPe")
new_orientation = self.marionette.orientation new_orientation = self.marionette.orientation
self.assertEqual(new_orientation, "landscape-primary") self.assertEqual(new_orientation, "landscape-primary")
@skip_if_desktop
def test_set_invalid_orientation(self): def test_set_invalid_orientation(self):
with self.assertRaisesRegexp(errors.MarionetteException, unknown_orientation % "cheese"): with self.assertRaisesRegexp(MarionetteException, unknown_orientation % "cheese"):
self.marionette.set_orientation("cheese") self.marionette.set_orientation("cheese")
@skip_if_desktop
def test_set_null_orientation(self): def test_set_null_orientation(self):
with self.assertRaisesRegexp(errors.MarionetteException, unknown_orientation % "null"): with self.assertRaisesRegexp(MarionetteException, unknown_orientation % "null"):
self.marionette.set_orientation(None) self.marionette.set_orientation(None)
@skip_if_b2g
def test_unsupported_operation_on_desktop(self):
with self.assertRaises(errors.UnsupportedOperationException):
self.marionette.set_orientation("landscape-primary")

View File

@ -134,6 +134,7 @@ disabled = "Bug 925688"
b2g = false b2g = false
[test_chrome_async_finish.js] [test_chrome_async_finish.js]
[test_screen_orientation.py] [test_screen_orientation.py]
browser = false
[test_errors.py] [test_errors.py]
[test_execute_isolate.py] [test_execute_isolate.py]