Bug 1245256 - Added Widevine playback test plus other shaka-player playback tests. r=spohl

MozReview-Commit-ID: Hh3KVlV1CNj
This commit is contained in:
Kirk Steuber 2016-04-06 18:21:58 -07:00
Родитель c65d8e5f0b
Коммит 1daae03f6b
3 изменённых файлов: 83 добавлений и 8 удалений

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

@ -56,7 +56,8 @@ class VideoPuppeteer(object):
:param timeout: The amount of time to wait until the video starts.
"""
def __init__(self, marionette, url, video_selector='video', interval=1,
set_duration=0, stall_wait_time=0, timeout=60):
set_duration=0, stall_wait_time=0, timeout=60,
autostart=True):
self.marionette = marionette
self.test_url = url
self.interval = interval
@ -86,13 +87,17 @@ class VideoPuppeteer(object):
return
self.video = videos_found[0]
self.marionette.execute_script("log('video element obtained');")
# To get an accurate expected_duration, playback must have started
wait = Wait(self, timeout=self.timeout)
verbose_until(wait, self, lambda v: v.current_time > 0,
"Check if video current_time > 0")
self._start_time = self.current_time
self._start_wall_time = clock()
self.update_expected_duration()
if autostart:
self.start();
def start(self):
# To get an accurate expected_duration, playback must have started
wait = Wait(self, timeout=self.timeout)
verbose_until(wait, self, lambda v: v.current_time > 0,
"Check if video current_time > 0")
self._start_time = self.current_time
self._start_wall_time = clock()
self.update_expected_duration()
def update_expected_duration(self):
"""

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

@ -0,0 +1,40 @@
# 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 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.prefs.set_pref('media.mediasource.webm.enabled', True)
with self.marionette.using_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)

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

@ -0,0 +1,30 @@
# The Shaka-player tests take manifest URLs rather than URLs for a page that
# plays a video (since shaka-player is the page that plays the video)
# This file contains the manifest URLs that shaka-player provides in it's
# dropdown
# "Angel One" (TNG clip) - multilingual, subtitles, VP8
[http://shaka-player-demo.appspot.com/assets/angel_one.mpd]
# "Car" (YT DASH test) - MP4
[http://shaka-player-demo.appspot.com/assets/car-20120827-manifest.mpd]
# "Car/CENC" (YT DASH EME test) - MP4, ClearKey
[http://shaka-player-demo.appspot.com/assets/car_cenc-20120827-manifest.mpd]
# "Feelings" (YT DASH test) - VP9
[http://shaka-player-demo.appspot.com/assets/feelings_vp9-20130806-manifest.mpd]
# "Feelings" (YT DASH test) - Audio only
[http://shaka-player-demo.appspot.com/assets/feelings_audio_only-20130806-manifest.mpd]
# "Car/SegmentTemplate" (Chromecast test) - MP4 (no SIDX, video only), Widevine
[http://shaka-player-demo.appspot.com/assets/car_segmenttemplate.mpd]
# "GPAC/SegmentList" (conformance test)
[http://download.tsi.telecom-paristech.fr/gpac/DASH_CONFORMANCE/TelecomParisTech/mp4-main-multi/mp4-main-multi-mpd-AV-NBS.mpd]
# "Oops" (modified YT DASH EME test) - MP4, multi-DRM
[http://shaka-player-demo.appspot.com/assets/oops_cenc-20121114-signedlicenseurl-manifest.mpd]
# "Oops" (modified YT DASH EME test) - MP4, Widevine, PSSH in MPD
# This stream currently does not load
#[http://shaka-player-demo.appspot.com/assets/oops_cenc_pssh.mpd]
# "Sintel" (1080p high bitrate test) - MP4
[http://storage.googleapis.com/widevine-demo-media/sintel-1080p/dash.mpd]
# "Sintel" (4k) - MP4, VP8, VP9
[http://storage.googleapis.com/widevine-demo-media/sintel-multicodec-4k/dash.mpd]
# "Sintel" (4k) - MP4, Widevine
[http://storage.googleapis.com/widevine-demo-media/sintel-4k-widevine/sintel.mpd]