summaryrefslogtreecommitdiffstats
path: root/dom/media/test/external/external_media_tests/playback
diff options
context:
space:
mode:
authorMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
committerMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
commit5f8de423f190bbb79a62f804151bc24824fa32d8 (patch)
tree10027f336435511475e392454359edea8e25895d /dom/media/test/external/external_media_tests/playback
parent49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff)
downloadUXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip
Add m-esr52 at 52.6.0
Diffstat (limited to 'dom/media/test/external/external_media_tests/playback')
-rw-r--r--dom/media/test/external/external_media_tests/playback/eme.ini1
-rw-r--r--dom/media/test/external/external_media_tests/playback/limiting_bandwidth.ini2
-rw-r--r--dom/media/test/external/external_media_tests/playback/manifest.ini1
-rw-r--r--dom/media/test/external/external_media_tests/playback/netflix_limiting_bandwidth.ini1
-rw-r--r--dom/media/test/external/external_media_tests/playback/test_eme_playback.py18
-rw-r--r--dom/media/test/external/external_media_tests/playback/test_eme_playback_limiting_bandwidth.py24
-rw-r--r--dom/media/test/external/external_media_tests/playback/test_full_playback.py25
-rw-r--r--dom/media/test/external/external_media_tests/playback/test_playback_limiting_bandwidth.py17
-rw-r--r--dom/media/test/external/external_media_tests/playback/test_shaka_playback.py42
-rw-r--r--dom/media/test/external/external_media_tests/playback/test_ultra_low_bandwidth.py15
-rw-r--r--dom/media/test/external/external_media_tests/playback/test_video_playback.py15
-rw-r--r--dom/media/test/external/external_media_tests/playback/youtube/manifest.ini1
-rw-r--r--dom/media/test/external/external_media_tests/playback/youtube/test_basic_playback.py74
-rw-r--r--dom/media/test/external/external_media_tests/playback/youtube/test_prefs.py46
14 files changed, 282 insertions, 0 deletions
diff --git a/dom/media/test/external/external_media_tests/playback/eme.ini b/dom/media/test/external/external_media_tests/playback/eme.ini
new file mode 100644
index 000000000..6f08919bf
--- /dev/null
+++ b/dom/media/test/external/external_media_tests/playback/eme.ini
@@ -0,0 +1 @@
+[test_eme_playback.py]
diff --git a/dom/media/test/external/external_media_tests/playback/limiting_bandwidth.ini b/dom/media/test/external/external_media_tests/playback/limiting_bandwidth.ini
new file mode 100644
index 000000000..77c144d80
--- /dev/null
+++ b/dom/media/test/external/external_media_tests/playback/limiting_bandwidth.ini
@@ -0,0 +1,2 @@
+[test_playback_limiting_bandwidth.py]
+[test_ultra_low_bandwidth.py]
diff --git a/dom/media/test/external/external_media_tests/playback/manifest.ini b/dom/media/test/external/external_media_tests/playback/manifest.ini
new file mode 100644
index 000000000..f7271cbfb
--- /dev/null
+++ b/dom/media/test/external/external_media_tests/playback/manifest.ini
@@ -0,0 +1 @@
+[test_video_playback.py]
diff --git a/dom/media/test/external/external_media_tests/playback/netflix_limiting_bandwidth.ini b/dom/media/test/external/external_media_tests/playback/netflix_limiting_bandwidth.ini
new file mode 100644
index 000000000..dd0ce3601
--- /dev/null
+++ b/dom/media/test/external/external_media_tests/playback/netflix_limiting_bandwidth.ini
@@ -0,0 +1 @@
+[test_eme_playback_limiting_bandwidth.py]
diff --git a/dom/media/test/external/external_media_tests/playback/test_eme_playback.py b/dom/media/test/external/external_media_tests/playback/test_eme_playback.py
new file mode 100644
index 000000000..9c7eb6725
--- /dev/null
+++ b/dom/media/test/external/external_media_tests/playback/test_eme_playback.py
@@ -0,0 +1,18 @@
+# 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 external_media_harness.testcase import (
+ MediaTestCase,
+ VideoPlaybackTestsMixin,
+ EMESetupMixin
+)
+
+
+class TestEMEPlayback(MediaTestCase, VideoPlaybackTestsMixin, EMESetupMixin):
+
+ def setUp(self):
+ super(TestEMEPlayback, self).setUp()
+ self.check_eme_system()
+
+ # Tests are implemented in VideoPlaybackTestsMixin
diff --git a/dom/media/test/external/external_media_tests/playback/test_eme_playback_limiting_bandwidth.py b/dom/media/test/external/external_media_tests/playback/test_eme_playback_limiting_bandwidth.py
new file mode 100644
index 000000000..44cbb44f1
--- /dev/null
+++ b/dom/media/test/external/external_media_tests/playback/test_eme_playback_limiting_bandwidth.py
@@ -0,0 +1,24 @@
+# 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_harness import BrowserMobProxyTestCaseMixin
+
+from external_media_harness.testcase import (
+ EMESetupMixin,
+ NetworkBandwidthTestCase,
+ NetworkBandwidthTestsMixin,
+)
+
+
+class TestEMEPlaybackLimitingBandwidth(NetworkBandwidthTestCase,
+ BrowserMobProxyTestCaseMixin,
+ NetworkBandwidthTestsMixin,
+ EMESetupMixin):
+
+
+ def setUp(self):
+ super(TestEMEPlaybackLimitingBandwidth, self).setUp()
+ self.check_eme_system()
+
+ # Tests in NetworkBandwidthTestsMixin
diff --git a/dom/media/test/external/external_media_tests/playback/test_full_playback.py b/dom/media/test/external/external_media_tests/playback/test_full_playback.py
new file mode 100644
index 000000000..0db504682
--- /dev/null
+++ b/dom/media/test/external/external_media_tests/playback/test_full_playback.py
@@ -0,0 +1,25 @@
+# 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_harness import Marionette
+
+from external_media_harness.testcase import MediaTestCase
+from external_media_tests.media_utils.video_puppeteer import VideoPuppeteer
+
+
+class TestFullPlayback(MediaTestCase):
+ """ Test MSE playback in HTML5 video element.
+
+ These tests should pass on any site where a single video element plays
+ upon loading and is uninterrupted (by ads, for example). This will play
+ the full videos, so it could take a while depending on the videos playing.
+ It should be run much less frequently in automated systems.
+ """
+
+ def test_video_playback_full(self):
+ with self.marionette.using_context(Marionette.CONTEXT_CONTENT):
+ for url in self.video_urls:
+ video = VideoPuppeteer(self.marionette, url,
+ stall_wait_time=10)
+ self.run_playback(video)
diff --git a/dom/media/test/external/external_media_tests/playback/test_playback_limiting_bandwidth.py b/dom/media/test/external/external_media_tests/playback/test_playback_limiting_bandwidth.py
new file mode 100644
index 000000000..81f1e8a59
--- /dev/null
+++ b/dom/media/test/external/external_media_tests/playback/test_playback_limiting_bandwidth.py
@@ -0,0 +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/.
+
+from marionette_harness import BrowserMobProxyTestCaseMixin
+
+from external_media_harness.testcase import (
+ NetworkBandwidthTestCase, NetworkBandwidthTestsMixin
+)
+
+
+class TestPlaybackLimitingBandwidth(NetworkBandwidthTestCase,
+ NetworkBandwidthTestsMixin,
+ BrowserMobProxyTestCaseMixin):
+
+ # Tests are in NetworkBandwidthTestsMixin
+ pass
diff --git a/dom/media/test/external/external_media_tests/playback/test_shaka_playback.py b/dom/media/test/external/external_media_tests/playback/test_shaka_playback.py
new file mode 100644
index 000000000..a2ecb4a2c
--- /dev/null
+++ b/dom/media/test/external/external_media_tests/playback/test_shaka_playback.py
@@ -0,0 +1,42 @@
+# 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_harness import Marionette
+
+from external_media_harness.testcase import MediaTestCase
+from external_media_tests.media_utils.video_puppeteer import VideoPuppeteer
+
+
+class TestShakaPlayback(MediaTestCase):
+ """ Test Widevine playback in shaka-player
+
+ This test takes manifest URLs rather than URLs for pages with videos. These
+ manifests are loaded with shaka-player
+ """
+
+ def test_video_playback_partial(self):
+ """ Plays 60 seconds of the video from the manifest URLs given
+ """
+ shakaUrl = "http://shaka-player-demo.appspot.com"
+ self.marionette.set_pref('media.mediasource.webm.enabled', True)
+
+ with self.marionette.using_context(Marionette.CONTEXT_CONTENT):
+ for manifestUrl in self.video_urls:
+ vp = VideoPuppeteer(self.marionette,
+ shakaUrl,
+ stall_wait_time=10,
+ set_duration=60,
+ video_selector="video#video",
+ autostart=False)
+
+
+ manifestInput = self.marionette.find_element("id",
+ "manifestUrlInput")
+ manifestInput.clear()
+ manifestInput.send_keys(manifestUrl)
+ loadButton = self.marionette.find_element("id", "loadButton")
+ loadButton.click()
+
+ vp.start()
+ self.run_playback(vp)
diff --git a/dom/media/test/external/external_media_tests/playback/test_ultra_low_bandwidth.py b/dom/media/test/external/external_media_tests/playback/test_ultra_low_bandwidth.py
new file mode 100644
index 000000000..d49ff7d94
--- /dev/null
+++ b/dom/media/test/external/external_media_tests/playback/test_ultra_low_bandwidth.py
@@ -0,0 +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/.
+
+from marionette_harness import BrowserMobProxyTestCaseMixin
+
+from external_media_harness.testcase import NetworkBandwidthTestCase
+
+
+class TestUltraLowBandwidth(NetworkBandwidthTestCase,
+ BrowserMobProxyTestCaseMixin):
+
+ def test_playback_limiting_bandwidth_160(self):
+ self.proxy.limits({'downstream_kbps': 160})
+ self.run_videos(timeout=120)
diff --git a/dom/media/test/external/external_media_tests/playback/test_video_playback.py b/dom/media/test/external/external_media_tests/playback/test_video_playback.py
new file mode 100644
index 000000000..b841ec08c
--- /dev/null
+++ b/dom/media/test/external/external_media_tests/playback/test_video_playback.py
@@ -0,0 +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/.
+
+from external_media_harness.testcase import (
+ MediaTestCase,
+ VideoPlaybackTestsMixin
+)
+
+
+class TestVideoPlayback(MediaTestCase, VideoPlaybackTestsMixin):
+
+ # Tests are actually implemented in VideoPlaybackTestsMixin.
+
+ pass
diff --git a/dom/media/test/external/external_media_tests/playback/youtube/manifest.ini b/dom/media/test/external/external_media_tests/playback/youtube/manifest.ini
new file mode 100644
index 000000000..d9ad7eb19
--- /dev/null
+++ b/dom/media/test/external/external_media_tests/playback/youtube/manifest.ini
@@ -0,0 +1 @@
+[test_basic_playback.py ]
diff --git a/dom/media/test/external/external_media_tests/playback/youtube/test_basic_playback.py b/dom/media/test/external/external_media_tests/playback/youtube/test_basic_playback.py
new file mode 100644
index 000000000..edd0afc5e
--- /dev/null
+++ b/dom/media/test/external/external_media_tests/playback/youtube/test_basic_playback.py
@@ -0,0 +1,74 @@
+# 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 Wait
+from marionette_driver.errors import TimeoutException
+from marionette_harness import Marionette
+
+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
+
+
+class TestBasicYouTubePlayback(MediaTestCase):
+ def test_mse_is_enabled_by_default(self):
+ with self.marionette.using_context(Marionette.CONTEXT_CONTENT):
+ youtube = YouTubePuppeteer(self.marionette, self.video_urls[0],
+ timeout=60)
+ wait = Wait(youtube,
+ timeout=min(300, youtube.expected_duration * 1.3),
+ interval=1)
+ try:
+ verbose_until(wait, youtube,
+ YouTubePuppeteer.mse_enabled,
+ "Failed to find 'blob' in video src url.")
+ except TimeoutException as e:
+ raise self.failureException(e)
+
+ def test_video_playing_in_one_tab(self):
+ with self.marionette.using_context(Marionette.CONTEXT_CONTENT):
+ for url in self.video_urls:
+ self.logger.info(url)
+ youtube = YouTubePuppeteer(self.marionette, url)
+ self.logger.info('Expected duration: {}'
+ .format(youtube.expected_duration))
+
+ final_piece = 60
+ try:
+ time_left = youtube.wait_for_almost_done(
+ final_piece=final_piece)
+ except VideoException as e:
+ raise self.failureException(e)
+ duration = abs(youtube.expected_duration) + 1
+ if duration > 1:
+ self.logger.info('Almost done: {} - {} seconds left.'
+ .format(url, time_left))
+ if time_left > final_piece:
+ self.marionette.log('time_left greater than '
+ 'final_piece - {}'
+ .format(time_left),
+ level='WARNING')
+ self.save_screenshot()
+ else:
+ self.marionette.log('Duration close to 0 - {}'
+ .format(youtube),
+ level='WARNING')
+ self.save_screenshot()
+ try:
+ verbose_until(Wait(youtube,
+ timeout=max(100, time_left) * 1.3,
+ interval=1),
+ youtube,
+ YouTubePuppeteer.playback_done)
+ except TimeoutException as e:
+ raise self.failureException(e)
+
+ def test_playback_starts(self):
+ with self.marionette.using_context(Marionette.CONTEXT_CONTENT):
+ for url in self.video_urls:
+ try:
+ YouTubePuppeteer(self.marionette, url, timeout=60)
+ except TimeoutException as e:
+ raise self.failureException(e)
diff --git a/dom/media/test/external/external_media_tests/playback/youtube/test_prefs.py b/dom/media/test/external/external_media_tests/playback/youtube/test_prefs.py
new file mode 100644
index 000000000..4c07ca008
--- /dev/null
+++ b/dom/media/test/external/external_media_tests/playback/youtube/test_prefs.py
@@ -0,0 +1,46 @@
+# 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 external_media_harness.testcase import MediaTestCase
+from marionette_driver import Wait
+
+from external_media_tests.utils import verbose_until
+from external_media_tests.media_utils.youtube_puppeteer import YouTubePuppeteer
+
+
+class TestMediaSourcePrefs(MediaTestCase):
+ def setUp(self):
+ MediaTestCase.setUp(self)
+ self.test_urls = self.video_urls[:2]
+ self.max_timeout = 60
+
+ def tearDown(self):
+ MediaTestCase.tearDown(self)
+
+ def test_mse_prefs(self):
+ """ mediasource should only be used if MSE prefs are enabled."""
+ self.set_mse_enabled_prefs(False)
+ self.check_mse_src(False, self.test_urls[0])
+
+ self.set_mse_enabled_prefs(True)
+ self.check_mse_src(True, self.test_urls[0])
+
+ def set_mse_enabled_prefs(self, value):
+ with self.marionette.using_context('chrome'):
+ self.marionette.set_pref('media.mediasource.enabled', value)
+ self.marionette.set_pref('media.mediasource.mp4.enabled', value)
+ self.marionette.set_pref('media.mediasource.webm.enabled', value)
+
+ def check_mse_src(self, mse_expected, url):
+ with self.marionette.using_context('content'):
+ youtube = YouTubePuppeteer(self.marionette, url)
+ wait = Wait(youtube,
+ timeout=min(self.max_timeout,
+ youtube.expected_duration * 1.3),
+ interval=1)
+
+ def cond(y):
+ return y.mse_enabled == mse_expected
+
+ verbose_until(wait, youtube, cond)