Bug 1240120 - Move external-media-tests to subdirectory to generate correct packaging; r=maja_zf,whimboo

--HG--
rename : dom/media/test/external-media-tests/MANIFEST.in => dom/media/test/external/MANIFEST.in
rename : dom/media/test/external-media-tests/README.md => dom/media/test/external/README.md
rename : dom/media/test/external-media-tests/harness/__init__.py => dom/media/test/external/external_media_harness/__init__.py
rename : dom/media/test/external-media-tests/harness/runtests.py => dom/media/test/external/external_media_harness/runtests.py
rename : dom/media/test/external-media-tests/harness/testcase.py => dom/media/test/external/external_media_harness/testcase.py
rename : dom/media/test/external-media-tests/media_tests/__init__.py => dom/media/test/external/external_media_tests/__init__.py
rename : dom/media/test/external-media-tests/media_tests/manifest.ini => dom/media/test/external/external_media_tests/manifest.ini
rename : dom/media/test/external-media-tests/media_utils/__init__.py => dom/media/test/external/external_media_tests/media_utils/__init__.py
rename : dom/media/test/external-media-tests/media_utils/video_puppeteer.py => dom/media/test/external/external_media_tests/media_utils/video_puppeteer.py
rename : dom/media/test/external-media-tests/media_utils/youtube_puppeteer.py => dom/media/test/external/external_media_tests/media_utils/youtube_puppeteer.py
rename : dom/media/test/external-media-tests/media_tests/playback/eme.ini => dom/media/test/external/external_media_tests/playback/eme.ini
rename : dom/media/test/external-media-tests/media_tests/playback/limiting_bandwidth.ini => dom/media/test/external/external_media_tests/playback/limiting_bandwidth.ini
rename : dom/media/test/external-media-tests/media_tests/playback/manifest.ini => dom/media/test/external/external_media_tests/playback/manifest.ini
rename : dom/media/test/external-media-tests/media_tests/playback/netflix_limiting_bandwidth.ini => dom/media/test/external/external_media_tests/playback/netflix_limiting_bandwidth.ini
rename : dom/media/test/external-media-tests/media_tests/playback/test_eme_playback.py => dom/media/test/external/external_media_tests/playback/test_eme_playback.py
rename : dom/media/test/external-media-tests/media_tests/playback/test_full_playback.py => dom/media/test/external/external_media_tests/playback/test_full_playback.py
rename : dom/media/test/external-media-tests/media_tests/playback/test_playback_limiting_bandwidth.py => dom/media/test/external/external_media_tests/playback/test_playback_limiting_bandwidth.py
rename : dom/media/test/external-media-tests/media_tests/playback/test_ultra_low_bandwidth.py => dom/media/test/external/external_media_tests/playback/test_ultra_low_bandwidth.py
rename : dom/media/test/external-media-tests/media_tests/playback/test_video_playback.py => dom/media/test/external/external_media_tests/playback/test_video_playback.py
rename : dom/media/test/external-media-tests/media_tests/playback/youtube/manifest.ini => dom/media/test/external/external_media_tests/playback/youtube/manifest.ini
rename : dom/media/test/external-media-tests/media_tests/playback/youtube/test_basic_playback.py => dom/media/test/external/external_media_tests/playback/youtube/test_basic_playback.py
rename : dom/media/test/external-media-tests/media_tests/playback/youtube/test_prefs.py => dom/media/test/external/external_media_tests/playback/youtube/test_prefs.py
rename : dom/media/test/external-media-tests/media_tests/resources/mozilla.html => dom/media/test/external/external_media_tests/resources/mozilla.html
rename : dom/media/test/external-media-tests/media_tests/test_example.py => dom/media/test/external/external_media_tests/test_example.py
rename : dom/media/test/external-media-tests/media_tests/urls/default.ini => dom/media/test/external/external_media_tests/urls/default.ini
rename : dom/media/test/external-media-tests/media_tests/urls/netflix/default.ini => dom/media/test/external/external_media_tests/urls/netflix/default.ini
rename : dom/media/test/external-media-tests/media_tests/urls/youtube/archive/crash_videos.ini => dom/media/test/external/external_media_tests/urls/youtube/archive/crash_videos.ini
rename : dom/media/test/external-media-tests/media_tests/urls/youtube/archive/other_videos.ini => dom/media/test/external/external_media_tests/urls/youtube/archive/other_videos.ini
rename : dom/media/test/external-media-tests/media_tests/urls/youtube/archive/video_data.ini => dom/media/test/external/external_media_tests/urls/youtube/archive/video_data.ini
rename : dom/media/test/external-media-tests/media_tests/urls/youtube/archive/youtube.ini => dom/media/test/external/external_media_tests/urls/youtube/archive/youtube.ini
rename : dom/media/test/external-media-tests/media_tests/urls/youtube/long1-720.ini => dom/media/test/external/external_media_tests/urls/youtube/long1-720.ini
rename : dom/media/test/external-media-tests/media_tests/urls/youtube/long2-720.ini => dom/media/test/external/external_media_tests/urls/youtube/long2-720.ini
rename : dom/media/test/external-media-tests/media_tests/urls/youtube/long3-crashes-720.ini => dom/media/test/external/external_media_tests/urls/youtube/long3-crashes-720.ini
rename : dom/media/test/external-media-tests/media_tests/urls/youtube/long4-crashes-900.ini => dom/media/test/external/external_media_tests/urls/youtube/long4-crashes-900.ini
rename : dom/media/test/external-media-tests/media_tests/urls/youtube/massive-6000.ini => dom/media/test/external/external_media_tests/urls/youtube/massive-6000.ini
rename : dom/media/test/external-media-tests/media_tests/urls/youtube/medium1-60.ini => dom/media/test/external/external_media_tests/urls/youtube/medium1-60.ini
rename : dom/media/test/external-media-tests/media_tests/urls/youtube/medium2-60.ini => dom/media/test/external/external_media_tests/urls/youtube/medium2-60.ini
rename : dom/media/test/external-media-tests/media_tests/urls/youtube/medium3-120.ini => dom/media/test/external/external_media_tests/urls/youtube/medium3-120.ini
rename : dom/media/test/external-media-tests/media_tests/urls/youtube/short0-10.ini => dom/media/test/external/external_media_tests/urls/youtube/short0-10.ini
rename : dom/media/test/external-media-tests/media_tests/urls/youtube/short1-15.ini => dom/media/test/external/external_media_tests/urls/youtube/short1-15.ini
rename : dom/media/test/external-media-tests/media_tests/urls/youtube/short2-15.ini => dom/media/test/external/external_media_tests/urls/youtube/short2-15.ini
rename : dom/media/test/external-media-tests/media_tests/urls/youtube/short3-crashes-15.ini => dom/media/test/external/external_media_tests/urls/youtube/short3-crashes-15.ini
rename : dom/media/test/external-media-tests/media_tests/utils.py => dom/media/test/external/external_media_tests/utils.py
rename : dom/media/test/external-media-tests/requirements.txt => dom/media/test/external/requirements.txt
rename : dom/media/test/external-media-tests/setup.py => dom/media/test/external/setup.py
extra : rebase_source : a17808ecf767f02f60e1618ce71e9928092b9980
This commit is contained in:
Syd Polk 2016-01-21 23:00:59 -06:00
Родитель 08649cc5e3
Коммит 51f0851bc2
47 изменённых файлов: 52 добавлений и 53 удалений

Просмотреть файл

@ -1,7 +0,0 @@
exclude MANIFEST.in
include requirements.txt
include setup.py
recursive-include firefox_media_tests *
recursive-include media_utils *

5
dom/media/test/external/MANIFEST.in поставляемый Normal file
Просмотреть файл

@ -0,0 +1,5 @@
exclude MANIFEST.in
recursive-include external_media_harness *
recursive-include external_media_tests *

Просмотреть файл

@ -1,4 +1,4 @@
firefox-media-tests
external-media-tests
===================
[Marionette Python tests][marionette-python-tests] for media playback in Mozilla Firefox. MediaTestCase uses [Firefox Puppeteer][ff-puppeteer-docs] library.
@ -6,7 +6,7 @@ firefox-media-tests
Setup
-----
The instructions below assume you have a copy of the project in `some/path/firefox-media-tests` and they refer to this path as `$PROJECT_HOME`.
Normally, you get this source by cloning a firefox repo such as mozilla-central. The path to these tests would be in <mozilla-central>/dom/media/test/external, and these instuctions refer to this path as '$PROJECT_HOME'.
* Create a virtualenv called `foo`.
@ -15,13 +15,13 @@ The instructions below assume you have a copy of the project in `some/path/firef
$ source foo/bin/activate #or `foo\Scripts\activate` on Windows
```
* Install `firefox-media-tests` in development mode. (To get an environment that is closer to what is actually used in Mozilla's automation jobs, run `pip install -r requirements.txt` first.)
* Install `external-media-tests` in development mode. (To get an environment that is closer to what is actually used in Mozilla's automation jobs, run `pip install -r requirements.txt` first.)
```sh
$ python setup.py develop
```
Now `firefox-media-tests` should be a recognized command. Try `firefox-media-tests --help` to see if it works.
Now `external-media-tests` should be a recognized command. Try `external-media-tests --help` to see if it works.
Running the Tests
@ -29,28 +29,28 @@ Running the Tests
In the examples below, `$FF_PATH` is a path to a recent Firefox binary.
This runs all the tests listed in `$PROJECT_HOME/firefox_media_tests/manifest.ini`:
This runs all the tests listed in `$PROJECT_HOME/external_media_tests/manifest.ini`:
```sh
$ firefox-media-tests --binary $FF_PATH
$ external-media-tests --binary $FF_PATH
```
You can also run all the tests at a particular path:
```sh
$ firefox-media-tests --binary $FF_PATH some/path/foo
$ external-media-tests --binary $FF_PATH some/path/foo
```
Or you can run the tests that are listed in a manifest file of your choice.
```sh
$ firefox-media-tests --binary $FF_PATH some/other/path/manifest.ini
$ external-media-tests --binary $FF_PATH some/other/path/manifest.ini
```
By default, the urls listed in `firefox_media_tests/urls/default.ini` are used for the tests, but you can also supply your own ini file of urls:
By default, the urls listed in `external_media_tests/urls/default.ini` are used for the tests, but you can also supply your own ini file of urls:
```sh
$ firefox-media-tests --binary $FF_PATH --urls some/other/path/my_urls.ini
$ external-media-tests --binary $FF_PATH --urls some/other/path/my_urls.ini
```
### Running EME tests
@ -58,7 +58,7 @@ By default, the urls listed in `firefox_media_tests/urls/default.ini` are used f
In order to run EME tests, you must use a Firefox profile that has a signed plugin-container.exe and voucher.bin. With Netflix, this will be created when you log in and save the credentials. You must also use a custom .ini file for urls to the provider's content and indicate which test to run, like above. Ex:
```sh
$ firefox-media-tests --binary $FF_PATH some/path/tests.ini --profile custom_profile --urls some/path/provider-urls.ini
$ external-media-tests --binary $FF_PATH some/path/tests.ini --profile custom_profile --urls some/path/provider-urls.ini
```
@ -84,7 +84,7 @@ What if Firefox crashes during a test run? You want to know why! To report usefu
5. Run the tests with a `--symbols-path` flag
```sh
$ firefox-media-tests --binary $FF_PATH --symbols-path path/to/example/firefox-38.0a2.en-US.win32.crashreporter-symbols
$ external-media-tests --binary $FF_PATH --symbols-path path/to/example/firefox-38.0a2.en-US.win32.crashreporter-symbols
```
To check whether the above setup is working for you, trigger a (silly) Firefox crash while the tests are running. One way to do this is with the [crashme add-on](https://github.com/luser/crashme) -- you can add it to Firefox even while the tests are running. Another way on Linux and Mac OS systems:
@ -101,7 +101,7 @@ To check whether the above setup is working for you, trigger a (silly) Firefox c
$ kill -6 1234
```
Somewhere in the output produced by `firefox-media-tests`, you should see something like:
Somewhere in the output produced by `external-media-tests`, you should see something like:
```
0:12.68 CRASH: MainThread pid:1234. Test:test_basic_playback.py TestVideoPlayback.test_playback_starts.
@ -137,11 +137,11 @@ On Windows, use browsermob-proxy.bat.
You can then call browsermob to shape the network. You can find an example in firefox_media_tests/playback/test_playback_limiting_bandwidth.py. Another example can be found at https://dxr.mozilla.org/mozilla-central/source/testing/marionette/client/marionette/tests/unit/test_browsermobproxy.py.
### A warning about video URLs
The ini files in `firefox_media_tests/urls` may contain URLs pulled from Firefox crash or bug data. Automated tests don't care about video content, but you might: visit these at your own risk and be aware that they may be NSFW. We do not intend to ever moderate or filter these URLs.
The ini files in `external_media_tests/urls` may contain URLs pulled from Firefox crash or bug data. Automated tests don't care about video content, but you might: visit these at your own risk and be aware that they may be NSFW. We do not intend to ever moderate or filter these URLs.
Writing a test
--------------
Write your test in a new or existing `test_*.py` file under `$PROJECT_HOME/firefox_media_tests`. Add it to the appropriate `manifest.ini` file(s) as well. Look in `media_utils` for useful video-playback functions.
Write your test in a new or existing `test_*.py` file under `$PROJECT_HOME/external_media_tests`. Add it to the appropriate `manifest.ini` file(s) as well. Look in `media_utils` for useful video-playback functions.
* [Marionette docs][marionette-docs]
- [Marionette Command Line Options](https://developer.mozilla.org/en-US/docs/Mozilla/Command_Line_Options)

Просмотреть файл

@ -11,9 +11,9 @@ from marionette.runner import BrowserMobProxyArguments
from marionette.runtests import MarionetteHarness, cli as mn_cli
import mozlog
import media_tests
import external_media_tests
from testcase import MediaTestCase
from media_utils.video_puppeteer import debug_script
from external_media_tests.media_utils.video_puppeteer import debug_script
class MediaTestArgumentsBase(object):
@ -21,7 +21,7 @@ class MediaTestArgumentsBase(object):
args = [
[['--urls'], {
'help': 'ini file of urls to make available to all tests',
'default': os.path.join(media_tests.urls, 'default.ini'),
'default': os.path.join(external_media_tests.urls, 'default.ini'),
}],
]
@ -35,7 +35,7 @@ class MediaTestArgumentsBase(object):
def parse_args_handler(self, args):
if not args.tests:
args.tests = [media_tests.manifest]
args.tests = [external_media_tests.manifest]
@staticmethod
@ -55,7 +55,7 @@ class MediaTestRunner(BaseMarionetteTestRunner):
def __init__(self, **kwargs):
BaseMarionetteTestRunner.__init__(self, **kwargs)
if not self.server_root:
self.server_root = media_tests.resources
self.server_root = external_media_tests.resources
# pick up prefs from marionette_driver.geckoinstance.DesktopInstance
self.app = 'fxdesktop'
self.test_handlers = [MediaTestCase]

Просмотреть файл

@ -10,8 +10,8 @@ from marionette_driver.errors import TimeoutException
from marionette.marionette_test import SkipTest
from firefox_puppeteer.testcases import FirefoxTestCase
from media_tests.utils import (timestamp_now, verbose_until)
from media_utils.video_puppeteer import (playback_done, playback_started,
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)

Просмотреть файл

@ -6,7 +6,7 @@ from time import clock, sleep
from marionette_driver import By, expected, Wait
from media_tests.utils import verbose_until
from external_media_tests.utils import verbose_until
# Adapted from

Просмотреть файл

@ -9,7 +9,7 @@ from json import loads
from marionette_driver import By, expected, Wait
from marionette_driver.errors import TimeoutException, NoSuchElementException
from video_puppeteer import VideoPuppeteer, VideoException
from media_tests.utils import verbose_until
from external_media_tests.utils import verbose_until
class YouTubePuppeteer(VideoPuppeteer):

Просмотреть файл

@ -4,7 +4,7 @@
import re
from harness.testcase import MediaTestCase, VideoPlaybackTestsMixin
from external_media_harness.testcase import MediaTestCase, VideoPlaybackTestsMixin
class TestEMEPlayback(MediaTestCase, VideoPlaybackTestsMixin):

Просмотреть файл

@ -3,8 +3,8 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from harness.testcase import MediaTestCase
from media_utils.video_puppeteer import VideoPuppeteer
from external_media_harness.testcase import MediaTestCase
from external_media_tests.media_utils.video_puppeteer import VideoPuppeteer
class TestFullPlayback(MediaTestCase):

Просмотреть файл

@ -4,7 +4,7 @@
from marionette import BrowserMobProxyTestCaseMixin
from harness.testcase import NetworkBandwidthTestCase
from external_media_harness.testcase import NetworkBandwidthTestCase
class TestPlaybackLimitingBandwidth(NetworkBandwidthTestCase,

Просмотреть файл

@ -4,7 +4,7 @@
from marionette import BrowserMobProxyTestCaseMixin
from harness.testcase import NetworkBandwidthTestCase
from external_media_harness.testcase import NetworkBandwidthTestCase
class TestUltraLowBandwidth(NetworkBandwidthTestCase,

Просмотреть файл

@ -2,7 +2,7 @@
# 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 harness.testcase import (
from external_media_harness.testcase import (
MediaTestCase,
VideoPlaybackTestsMixin
)

Просмотреть файл

@ -5,10 +5,10 @@
from marionette_driver import Wait
from marionette_driver.errors import TimeoutException
from media_tests.utils import verbose_until
from harness.testcase import MediaTestCase
from media_utils.video_puppeteer import VideoException
from media_utils.youtube_puppeteer import (YouTubePuppeteer, playback_done,
from external_media_tests.utils import verbose_until
from external_media_harness.testcase import MediaTestCase
from external_media_tests.media_utils.video_puppeteer import VideoException
from external_media_tests.media_utils.youtube_puppeteer import (YouTubePuppeteer, playback_done,
wait_for_almost_done)

Просмотреть файл

@ -2,11 +2,11 @@
# 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 harness.testcase import MediaTestCase
from external_media_harness.testcase import MediaTestCase
from marionette_driver import Wait
from media_tests.utils import verbose_until
from media_utils.youtube_puppeteer import YouTubePuppeteer
from external_media_tests.utils import verbose_until
from external_media_tests.media_utils.youtube_puppeteer import YouTubePuppeteer
class TestMediaSourcePrefs(MediaTestCase):

Просмотреть файл

@ -1,4 +1,4 @@
from harness.testcase import MediaTestCase
from external_media_harness.testcase import MediaTestCase
class TestSomethingElse(MediaTestCase):

Просмотреть файл

Просмотреть файл

@ -4,7 +4,7 @@
from setuptools import setup, find_packages
PACKAGE_VERSION = '0.4'
PACKAGE_VERSION = '1.0'
deps = [
'marionette-client == 2.0.0',
@ -14,7 +14,7 @@ deps = [
'firefox-puppeteer >= 3.1.0, <4.0.0',
]
setup(name='firefox-media-tests',
setup(name='external-media-tests',
version=PACKAGE_VERSION,
description=('A collection of Mozilla Firefox media playback tests run '
'with Marionette'),
@ -30,7 +30,7 @@ setup(name='firefox-media-tests',
keywords='mozilla',
author='Mozilla Automation and Tools Team',
author_email='tools@lists.mozilla.org',
url='https://github.com/mjzffr/firefox-media-tests',
url='https://hg.mozilla.org/mozilla-central/dom/media/test/external/',
license='MPL 2.0',
packages=find_packages(),
zip_safe=False,
@ -38,5 +38,5 @@ setup(name='firefox-media-tests',
include_package_data=True,
entry_points="""
[console_scripts]
firefox-media-tests = harness:cli
external-media-tests = external_media_harness:cli
""")

Просмотреть файл

@ -59,8 +59,9 @@ ARCHIVE_FILES = {
},
{
'source': buildconfig.topsrcdir,
'base': 'dom/media/test',
'pattern': 'external-media-tests/**',
'base': 'dom/media/test/external',
'pattern': '**',
'dest': 'external-media-tests',
},
{
'source': buildconfig.topsrcdir,