Bug 1277136 - External Media Tests: Fix typos, update context usage, update gmp reset script. r?maja_zf
- Fix a typo in media.gmp-eme-adobe.version pref strings.
- Update reset gmp script call to be from content context. This
would fail if done from the chrome process.
- Update reset gmp script to use new requestMediaKeySystemAccess
syntax.
MozReview-Commit-ID: FzDgkOWQF9A
--- a/dom/media/test/external/external_media_harness/testcase.py
+++ b/dom/media/test/external/external_media_harness/testcase.py
@@ -1,14 +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/.
import re
import os
+import time
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 BaseFirefoxTestCase
from external_media_tests.utils import (timestamp_now, verbose_until)
@@ -195,17 +196,17 @@ class NetworkBandwidthTestsMixin(object)
def test_playback_limiting_bandwidth_1000(self):
self.proxy.limits({'downstream_kbps': 1000})
self.run_videos(timeout=120)
reset_adobe_gmp_script = """
navigator.requestMediaKeySystemAccess('com.adobe.primetime',
-[{initDataType: 'cenc'}]).then(
+[{initDataTypes: ['cenc']}]).then(
function(access) {
marionetteScriptFinished('success');
},
function(ex) {
marionetteScriptFinished(ex);
}
);
"""
@@ -236,18 +237,19 @@ class EMESetupMixin(object):
# https://bugzilla.mozilla.org/show_bug.cgi?id=1187471#c28
# 2015-09-28 cpearce says this is no longer necessary, but in case
# we are working with older firefoxes...
self.prefs.set_pref('media.gmp.trial-create.enabled', False)
def reset_GMP_version(self):
if EMESetupMixin.version_needs_reset:
with self.marionette.using_context('chrome'):
- if self.prefs.get_pref('media.gm-eme-adobe.version'):
- self.prefs.set_pref('media.gm-eme-adobe.version', None)
+ if self.prefs.get_pref('media.gmp-eme-adobe.version'):
+ self.prefs.reset_pref('media.gmp-eme-adobe.version')
+ with self.marionette.using_context('content'):
result = self.marionette.execute_async_script(
reset_adobe_gmp_script,
script_timeout=60000)
if not result == 'success':
raise VideoException(
'ERROR: Resetting Adobe GMP failed % s' % result)
EMESetupMixin.version_needs_reset = False