Bug 1313312 - Remove BaseFirefoxTestCase class from Puppeteer. draft
authorHenrik Skupin <mail@hskupin.info>
Thu, 27 Oct 2016 11:35:39 +0200
changeset 430232 19010cf2f2c73ff3e8bcb127e56ecde6d32f54f5
parent 430231 311de4be0c0cb6d30153d5dae752ff38dde3f27e
child 430233 903ba18d820b9ef9e3cdea885362a7d7201f7d59
push id33778
push userbmo:hskupin@gmail.com
push dateThu, 27 Oct 2016 10:29:13 +0000
bugs1313312
milestone52.0a1
Bug 1313312 - Remove BaseFirefoxTestCase class from Puppeteer. MozReview-Commit-ID: e1r0Sa3Csm
dom/media/test/external/external_media_harness/testcase.py
testing/firefox-ui/harness/firefox_ui_harness/testcases.py
testing/puppeteer/firefox/firefox_puppeteer/__init__.py
testing/puppeteer/firefox/firefox_puppeteer/testcases/__init__.py
testing/puppeteer/firefox/firefox_puppeteer/testcases/base.py
--- a/dom/media/test/external/external_media_harness/testcase.py
+++ b/dom/media/test/external/external_media_harness/testcase.py
@@ -1,30 +1,29 @@
 # 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 re
 import os
-import time
 
 from marionette import BrowserMobProxyTestCaseMixin, MarionetteTestCase, Marionette
 from marionette_driver import Wait
 from marionette_driver.errors import TimeoutException
 from marionette.marionette_test import SkipTest
 
-from firefox_puppeteer.testcases import BaseFirefoxTestCase
+from firefox_puppeteer import FirefoxPuppeteerMixin
 from external_media_tests.utils import (timestamp_now, verbose_until)
 from external_media_tests.media_utils.video_puppeteer import (
     VideoException,
     VideoPuppeteer
 )
 
 
-class MediaTestCase(BaseFirefoxTestCase, MarionetteTestCase):
+class MediaTestCase(MarionetteTestCase, FirefoxPuppeteerMixin):
 
     """
     Necessary methods for MSE playback
 
     :param video_urls: Urls you are going to play as part of the tests.
     """
 
     def __init__(self, *args, **kwargs):
--- a/testing/firefox-ui/harness/firefox_ui_harness/testcases.py
+++ b/testing/firefox-ui/harness/firefox_ui_harness/testcases.py
@@ -7,24 +7,34 @@ import pprint
 from datetime import datetime
 
 import mozfile
 
 from marionette import MarionetteTestCase
 from marionette_driver import Wait
 from marionette_driver.errors import NoSuchWindowException
 
+from firefox_puppeteer import FirefoxPuppeteerMixin
 from firefox_puppeteer.api.prefs import Preferences
 from firefox_puppeteer.api.software_update import SoftwareUpdate
-from firefox_puppeteer.testcases import BaseFirefoxTestCase
 from firefox_puppeteer.ui.update_wizard import UpdateWizardDialog
 
 
-class FirefoxTestCase(BaseFirefoxTestCase):
-    """ Integrate MarionetteTestCase with BaseFirefoxTestCase by reordering MRO """
+class FirefoxTestCase(MarionetteTestCase, FirefoxPuppeteerMixin):
+    """Base TestCase class for Firefox Desktop tests.
+
+    This is designed to enhance MarionetteTestCase by inserting the Puppeteer
+    mixin class (so Firefox specific API modules are exposed to test scope) and
+    providing common set-up and tear-down code for Firefox tests.
+
+    If you're extending the inheritance tree further to make specialized
+    TestCases, favour the use of super() as opposed to explicit calls to a
+    parent class.
+
+    """
     pass
 
 
 class UpdateTestCase(FirefoxTestCase):
 
     TIMEOUT_UPDATE_APPLY = 300
     TIMEOUT_UPDATE_CHECK = 30
     TIMEOUT_UPDATE_DOWNLOAD = 360
--- a/testing/puppeteer/firefox/firefox_puppeteer/__init__.py
+++ b/testing/puppeteer/firefox/firefox_puppeteer/__init__.py
@@ -1,8 +1,8 @@
 # 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 firefox_puppeteer.testcases.base import BaseFirefoxTestCase
+from firefox_puppeteer.testcases.base import FirefoxPuppeteerMixin
 
 
 __version__ = '52.0.0'
--- a/testing/puppeteer/firefox/firefox_puppeteer/testcases/__init__.py
+++ b/testing/puppeteer/firefox/firefox_puppeteer/testcases/__init__.py
@@ -1,6 +1,5 @@
 # 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 firefox_puppeteer.testcases.base import BaseFirefoxTestCase
 from firefox_puppeteer.testcases.base import FirefoxPuppeteerMixin
--- a/testing/puppeteer/firefox/firefox_puppeteer/testcases/base.py
+++ b/testing/puppeteer/firefox/firefox_puppeteer/testcases/base.py
@@ -1,16 +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/.
 
 import unittest
 
-from marionette import MarionetteTestCase
-
 from firefox_puppeteer.decorators import use_class_as_property
 from firefox_puppeteer.ui.browser.window import BrowserWindow
 
 
 class FirefoxPuppeteerMixin(unittest.TestCase):
     """The puppeteer mixin class is used to expose additional ui and api libraries
     to test cases.
 
@@ -151,33 +149,8 @@ class FirefoxPuppeteerMixin(unittest.Tes
 
     @use_class_as_property('ui.windows.Windows')
     def windows(self):
         """
         Provides shortcuts to the top-level windows.
 
         See the :class:`~ui.window.Windows` reference.
         """
-
-
-class BaseFirefoxTestCase(MarionetteTestCase, FirefoxPuppeteerMixin):
-    """Base TestCase class for Firefox Desktop tests.
-
-    This is designed to enhance MarionetteTestCase by inserting the Puppeteer
-    mixin class (so Firefox specific API modules are exposed to test scope) and
-    providing common set-up and tear-down code for Firefox tests.
-
-    Child classes are expected to also subclass MarionetteTestCase such that
-    MarionetteTestCase is inserted into the MRO after FirefoxTestCase but before
-    unittest.TestCase.
-
-    example:
-    `class AwesomeTestCase(FirefoxTestCase, MarionetteTestCase)`
-
-    The key role of MarionetteTestCase is to set self.marionette appropriately
-    in `__init__`. Any TestCase class that satisfies this requirement is
-    compatible with this class.
-
-    If you're extending the inheritance tree further to make specialized
-    TestCases, favour the use of super() as opposed to explicit calls to a
-    parent class.
-
-    """