Bug 1238733 - Use BaseFirefoxTestCase in external media tests; r?sydpolk
MozReview-Commit-ID: 8fqFpUfuU4Q
--- a/dom/media/test/external/external_media_harness/testcase.py
+++ b/dom/media/test/external/external_media_harness/testcase.py
@@ -1,30 +1,30 @@
# 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 os
-from marionette import BrowserMobProxyTestCaseMixin
+from marionette import BrowserMobProxyTestCaseMixin, MarionetteTestCase
from marionette_driver import Wait
from marionette_driver.errors import TimeoutException
from marionette.marionette_test import SkipTest
-from firefox_puppeteer.testcases import FirefoxTestCase
+from firefox_puppeteer.testcases import BaseFirefoxTestCase
from external_media_tests.utils import (timestamp_now, verbose_until)
from external_media_tests.media_utils.video_puppeteer import (playback_done, playback_started,
VideoException, VideoPuppeteer as VP)
-class MediaTestCase(FirefoxTestCase):
+class MediaTestCase(BaseFirefoxTestCase, MarionetteTestCase):
def __init__(self, *args, **kwargs):
self.video_urls = kwargs.pop('video_urls', False)
- FirefoxTestCase.__init__(self, *args, **kwargs)
+ super(MediaTestCase, self).__init__(*args, **kwargs)
def save_screenshot(self):
screenshot_dir = os.path.join(self.marionette.instance.workspace or '',
'screenshots')
filename = ''.join([self.id().replace(' ', '-'),
'_',
str(timestamp_now()),
'.png'])
@@ -71,27 +71,27 @@ class MediaTestCase(FirefoxTestCase):
gets recognized a skip in marionette.marionette_test.CommonTestCase.run
"""
raise SkipTest(reason)
class NetworkBandwidthTestCase(MediaTestCase):
def __init__(self, *args, **kwargs):
- MediaTestCase.__init__(self, *args, **kwargs)
+ super(NetworkBandwidthTestCase, self).__init__(*args, **kwargs)
BrowserMobProxyTestCaseMixin.__init__(self, *args, **kwargs)
self.proxy = None
def setUp(self):
- MediaTestCase.setUp(self)
+ super(NetworkBandwidthTestCase, self).setUp()
BrowserMobProxyTestCaseMixin.setUp(self)
self.proxy = self.create_browsermob_proxy()
def tearDown(self):
- MediaTestCase.tearDown(self)
+ super(NetworkBandwidthTestCase, self).tearDown()
BrowserMobProxyTestCaseMixin.tearDown(self)
self.proxy = None
def run_videos(self):
with self.marionette.using_context('content'):
for url in self.video_urls:
video = VP(self.marionette, url,
--- a/dom/media/test/external/requirements.txt
+++ b/dom/media/test/external/requirements.txt
@@ -10,14 +10,11 @@ mozInstall==1.12
mozlog==3.1
moznetwork==0.27
mozprocess==0.22
mozprofile==0.28
mozrunner==6.11
moztest==0.7
mozversion==1.4
wptserve==1.3.0
-marionette-client == 2.2.0
-marionette-driver == 1.3.0
-firefox-puppeteer==3.2.0
-
-# Install the firefox media tests package
-./
+marionette-client==2.2.0
+marionette-driver==1.3.0
+firefox-puppeteer==4.0.0
--- a/dom/media/test/external/setup.py
+++ b/dom/media/test/external/setup.py
@@ -1,23 +1,23 @@
# 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 os
from setuptools import setup, find_packages
-PACKAGE_VERSION = '1.0'
+PACKAGE_VERSION = '2.0'
+
+THIS_DIR = os.path.dirname(os.path.realpath(__name__))
-deps = [
- 'marionette-client == 2.2.0',
- 'marionette-driver == 1.3.0',
- 'mozlog == 3.1',
- 'manifestparser == 1.1',
- 'firefox-puppeteer >= 3.2.0, <4.0.0',
-]
+
+def read(*parts):
+ with open(os.path.join(THIS_DIR, *parts)) as f:
+ return f.read()
setup(name='external-media-tests',
version=PACKAGE_VERSION,
description=('A collection of Mozilla Firefox media playback tests run '
'with Marionette'),
classifiers=[
'Environment :: Console',
'Intended Audience :: Developers',
@@ -29,14 +29,14 @@ setup(name='external-media-tests',
],
keywords='mozilla',
author='Mozilla Automation and Tools Team',
author_email='tools@lists.mozilla.org',
url='https://hg.mozilla.org/mozilla-central/dom/media/test/external/',
license='MPL 2.0',
packages=find_packages(),
zip_safe=False,
- install_requires=deps,
+ install_requires=read('requirements.txt').splitlines(),
include_package_data=True,
entry_points="""
[console_scripts]
external-media-tests = external_media_harness:cli
""")