Bug 1272109: Remove skip_if_b2g decorator for tests draft
authorDavid Burns <dburns@mozilla.com>
Thu, 12 May 2016 11:51:08 +0100
changeset 367799 f991fe1635505be4ff41d0690f5e543d5573b86e
parent 367798 bf8e154424285858764166414875f63404edd7db
child 521098 5c8470a63cf1cb8f3702493b61b5d1b008989dcc
push id18344
push userdburns@mozilla.com
push dateTue, 17 May 2016 10:11:20 +0000
bugs1272109, 965308
milestone49.0a1
Bug 1272109: Remove skip_if_b2g decorator for tests It looks like when I landed bug 965308 it stopped looking at any tests that had @skip_if_b2g decorator. Since we no longer need to support b2g we should just remove the decorator. MozReview-Commit-ID: 6EJoSTSCKDu
testing/marionette/harness/marionette/__init__.py
testing/marionette/harness/marionette/marionette_test.py
testing/marionette/harness/marionette/tests/unit/test_elementsize.py
testing/marionette/harness/marionette/tests/unit/test_execute_script.py
testing/marionette/harness/marionette/tests/unit/test_key_actions.py
testing/marionette/harness/marionette/tests/unit/test_navigation.py
testing/marionette/harness/marionette/tests/unit/test_pagesource.py
testing/marionette/harness/marionette/tests/unit/test_screen_orientation.py
testing/marionette/harness/marionette/tests/unit/test_typing.py
testing/marionette/harness/marionette/tests/unit/test_window_title.py
--- a/testing/marionette/harness/marionette/__init__.py
+++ b/testing/marionette/harness/marionette/__init__.py
@@ -5,17 +5,16 @@
 __version__ = '2.3.0'
 
 from .marionette_test import (
     CommonTestCase,
     expectedFailure,
     MarionetteJSTestCase,
     MarionetteTestCase,
     skip,
-    skip_if_b2g,
     skip_if_desktop,
     SkipTest,
     skip_unless_protocol,
 )
 from .runner import (
     B2GTestCaseMixin,
     B2GTestResultMixin,
     BaseMarionetteArguments,
--- a/testing/marionette/harness/marionette/marionette_test.py
+++ b/testing/marionette/harness/marionette/marionette_test.py
@@ -88,23 +88,16 @@ def skip_if_chrome(target):
 
 def skip_if_desktop(target):
     def wrapper(self, *args, **kwargs):
         if self.marionette.session_capabilities.get('b2g') is None:
             raise SkipTest('skipping due to desktop')
         return target(self, *args, **kwargs)
     return wrapper
 
-def skip_if_b2g(target):
-    def wrapper(self, *args, **kwargs):
-        if self.marionette.session_capabilities.get('b2g') == True:
-            raise SkipTest('skipping due to b2g')
-        return target(self, *args, **kwargs)
-    return wrapper
-
 def skip_if_e10s(target):
     def wrapper(self, *args, **kwargs):
         with self.marionette.using_context('chrome'):
             multi_process_browser = self.marionette.execute_script("""
             try {
               return Services.appinfo.browserTabsRemoteAutostart;
             } catch (e) {
               return false;
--- a/testing/marionette/harness/marionette/tests/unit/test_elementsize.py
+++ b/testing/marionette/harness/marionette/tests/unit/test_elementsize.py
@@ -1,27 +1,26 @@
 # 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
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-from marionette import MarionetteTestCase, skip_if_b2g
+from marionette import MarionetteTestCase
 from marionette_driver.by import By
 
 
 class TestElementSize(MarionetteTestCase):
     def testShouldReturnTheSizeOfALink(self):
         test_html = self.marionette.absolute_url("testSize.html")
         self.marionette.navigate(test_html)
         shrinko = self.marionette.find_element(By.ID, 'linkId')
         size = shrinko.rect
         self.assertTrue(size['width'] > 0)
         self.assertTrue(size['height'] > 0)
 
 
-@skip_if_b2g
 class TestElementSizeChrome(MarionetteTestCase):
     def setUp(self):
         MarionetteTestCase.setUp(self)
         self.marionette.set_context("chrome")
         self.win = self.marionette.current_window_handle
         self.marionette.execute_script(
             "window.open('chrome://marionette/content/test2.xul', 'foo', 'chrome,centerscreen');")
         self.marionette.switch_to_window('foo')
--- a/testing/marionette/harness/marionette/tests/unit/test_execute_script.py
+++ b/testing/marionette/harness/marionette/tests/unit/test_execute_script.py
@@ -1,17 +1,17 @@
 # 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
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 import urllib
 import os
 
 from marionette_driver import By, errors
-from marionette import MarionetteTestCase, skip_if_b2g
+from marionette import MarionetteTestCase
 
 
 def inline(doc):
     return "data:text/html;charset=utf-8,%s" % urllib.quote(doc)
 
 
 elements = inline("<p>foo</p> <p>bar</p>")
 
@@ -228,17 +228,16 @@ class TestExecuteContent(MarionetteTestC
             exists = send("return typeof %s != 'undefined'" % property)
             self.assertTrue(exists, "property %s is undefined" % property)
         # TODO(ato): For some reason this fails, probably Sandbox bug?
         # self.assertTrue(send("return typeof Components == 'undefined'"))
         self.assertTrue(
             send("return typeof window.wrappedJSObject == 'undefined'"))
 
 
-@skip_if_b2g
 class TestExecuteChrome(TestExecuteContent):
     def setUp(self):
         super(TestExecuteChrome, self).setUp()
         self.win = self.marionette.current_window_handle
         self.marionette.set_context("chrome")
         self.marionette.execute_script(
             "window.open('chrome://marionette/content/test.xul', 'xul', 'chrome')")
         self.marionette.switch_to_window("xul")
--- a/testing/marionette/harness/marionette/tests/unit/test_key_actions.py
+++ b/testing/marionette/harness/marionette/tests/unit/test_key_actions.py
@@ -1,13 +1,13 @@
 # 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
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-from marionette import MarionetteTestCase, skip_if_b2g
+from marionette import MarionetteTestCase
 from marionette_driver.keys import Keys
 from marionette_driver.marionette import Actions
 from marionette_driver.by import By
 
 
 class TestKeyActions(MarionetteTestCase):
 
     def setUp(self):
@@ -64,17 +64,16 @@ class TestKeyActions(MarionetteTestCase)
         self.key_action.key_down('a').key_down('b').key_down('c').perform()
         (self.key_action.key_down(self.mod_key)
                         .key_down('a')
                         .wait(.5)
                         .key_down('x')
                         .perform())
         self.assertEqual(self.key_reporter_value, "")
 
-    @skip_if_b2g
     def test_open_in_new_window_shortcut(self):
         el = self.marionette.find_element(By.ID, 'updatediv')
         start_win = self.marionette.current_chrome_window_handle
         (self.key_action.key_down(Keys.SHIFT)
                         .press(el)
                         .release()
                         .key_up(Keys.SHIFT)
                         .perform())
--- a/testing/marionette/harness/marionette/tests/unit/test_navigation.py
+++ b/testing/marionette/harness/marionette/tests/unit/test_navigation.py
@@ -1,13 +1,13 @@
 # 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
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-from marionette import MarionetteTestCase, skip_if_b2g
+from marionette import MarionetteTestCase
 from marionette_driver.errors import MarionetteException, TimeoutException
 from marionette_driver.by import By
 
 
 class TestNavigate(MarionetteTestCase):
     def setUp(self):
         MarionetteTestCase.setUp(self)
         self.marionette.execute_script("window.location.href = 'about:blank'")
@@ -20,17 +20,16 @@ class TestNavigate(MarionetteTestCase):
         self.assertEqual(self.test_doc, self.location_href)
         self.assertEqual("Marionette Test", self.marionette.title)
 
     def test_navigate(self):
         self.marionette.navigate(self.test_doc)
         self.assertNotEqual("about:blank", self.location_href)
         self.assertEqual("Marionette Test", self.marionette.title)
 
-    @skip_if_b2g # we currently allow this in b2g
     def test_navigate_chrome_error(self):
         with self.marionette.using_context("chrome"):
             self.assertRaisesRegexp(MarionetteException, "Cannot navigate in chrome context",
                                     self.marionette.navigate, "about:blank")
 
     def test_get_current_url_returns_top_level_browsing_context_url(self):
         self.marionette.navigate(self.iframe_doc)
         self.assertEqual(self.iframe_doc, self.location_href)
@@ -75,17 +74,16 @@ class TestNavigate(MarionetteTestCase):
         self.assertFalse(self.marionette.execute_script(
             "return window.document.getElementById('someDiv') == undefined"))
         self.marionette.refresh()
         self.assertEqual("Marionette Test", self.marionette.title)
         self.assertTrue(self.marionette.execute_script(
             "return window.document.getElementById('someDiv') == undefined"))
 
     """ Disabled due to Bug 977899
-    @skip_if_b2g
     def test_navigate_frame(self):
         self.marionette.navigate(self.marionette.absolute_url("test_iframe.html"))
         self.marionette.switch_to_frame(0)
         self.marionette.navigate(self.marionette.absolute_url("empty.html"))
         self.assertTrue('empty.html' in self.marionette.get_url())
         self.marionette.switch_to_frame()
         self.assertTrue('test_iframe.html' in self.marionette.get_url())
     """
@@ -98,17 +96,16 @@ class TestNavigate(MarionetteTestCase):
             self.fail("The socket shouldn't have timed out when navigating to a non-existent URL")
         except MarionetteException as e:
             self.assertIn("Error loading page", str(e))
         except Exception as e:
             import traceback
             print traceback.format_exc()
             self.fail("Should have thrown a MarionetteException instead of %s" % type(e))
 
-    @skip_if_b2g # about:blocked isn't a well formed uri on b2g
     def test_should_navigate_to_requested_about_page(self):
         self.marionette.navigate("about:neterror")
         self.assertEqual(self.marionette.get_url(), "about:neterror")
         self.marionette.navigate(self.marionette.absolute_url("test.html"))
         self.marionette.navigate("about:blocked")
         self.assertEqual(self.marionette.get_url(), "about:blocked")
 
     def test_find_element_state_complete(self):
--- a/testing/marionette/harness/marionette/tests/unit/test_pagesource.py
+++ b/testing/marionette/harness/marionette/tests/unit/test_pagesource.py
@@ -1,13 +1,14 @@
 # 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
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-from marionette import MarionetteTestCase, skip_if_b2g
+from marionette import MarionetteTestCase
+
 
 class TestPageSource(MarionetteTestCase):
     def testShouldReturnTheSourceOfAPage(self):
         test_html = self.marionette.absolute_url("testPageSource.html")
         self.marionette.navigate(test_html)
         source = self.marionette.page_source
         self.assertTrue("<html" in source)
         self.assertTrue("PageSource" in source)
--- a/testing/marionette/harness/marionette/tests/unit/test_screen_orientation.py
+++ b/testing/marionette/harness/marionette/tests/unit/test_screen_orientation.py
@@ -1,14 +1,14 @@
 # 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
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 from marionette_driver import errors
-from marionette import MarionetteTestCase, skip_if_b2g, skip_if_desktop
+from marionette import MarionetteTestCase, skip_if_desktop
 from mozrunner.devices.emulator_screen import EmulatorScreen
 
 default_orientation = "portrait-primary"
 unknown_orientation = "Unknown screen orientation: %s"
 
 class TestScreenOrientation(MarionetteTestCase):
     def setUp(self):
         MarionetteTestCase.setUp(self)
@@ -96,12 +96,11 @@ class TestScreenOrientation(MarionetteTe
         with self.assertRaisesRegexp(errors.MarionetteException, unknown_orientation % "cheese"):
             self.marionette.set_orientation("cheese")
 
     @skip_if_desktop
     def test_set_null_orientation(self):
         with self.assertRaisesRegexp(errors.MarionetteException, unknown_orientation % "null"):
             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")
--- a/testing/marionette/harness/marionette/tests/unit/test_typing.py
+++ b/testing/marionette/harness/marionette/tests/unit/test_typing.py
@@ -1,15 +1,15 @@
 # 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
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 import urllib
 
-from marionette import MarionetteTestCase, skip_if_b2g
+from marionette import MarionetteTestCase
 from marionette_driver.keys import Keys
 from marionette_driver.errors import ElementNotVisibleException
 from marionette_driver.by import By
 
 
 def inline(doc):
     return "data:text/html;charset=utf-8,%s" % urllib.quote(doc)
 
@@ -51,17 +51,16 @@ class TestTyping(MarionetteTestCase):
     def testShouldBeAbleToTypeCapitalLetters(self):
         test_html = self.marionette.absolute_url("javascriptPage.html")
         self.marionette.navigate(test_html)
 
         keyReporter = self.marionette.find_element(By.ID, "keyReporter")
         keyReporter.send_keys("ABC DEF")
         self.assertEqual(keyReporter.get_attribute("value"), "ABC DEF")
 
-    @skip_if_b2g
     def testCutAndPasteShortcuts(self):
         # Test that modifier keys work via copy/paste shortcuts.
         if self.marionette.session_capabilities['platformName'] == 'Darwin':
             mod_key = Keys.META
         else:
             mod_key = Keys.CONTROL
 
         test_html = self.marionette.absolute_url("javascriptPage.html")
--- a/testing/marionette/harness/marionette/tests/unit/test_window_title.py
+++ b/testing/marionette/harness/marionette/tests/unit/test_window_title.py
@@ -1,15 +1,14 @@
 # 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
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-from marionette import MarionetteTestCase, skip_if_b2g
+from marionette import MarionetteTestCase
 
-@skip_if_b2g
 class TestTitleChrome(MarionetteTestCase):
     def setUp(self):
         MarionetteTestCase.setUp(self)
         self.marionette.set_context("chrome")
         self.win = self.marionette.current_window_handle
         self.marionette.execute_script("window.open('chrome://marionette/content/test.xul', 'foo', 'chrome,centerscreen');")
         self.marionette.switch_to_window('foo')
         self.assertNotEqual(self.win, self.marionette.current_window_handle)