Bug 1277136 - External Media Tests: Fix typos, update context usage, update gmp reset script. r?maja_zf draft
authorBryce Van Dyk <bvandyk@mozilla.com>
Wed, 01 Jun 2016 08:33:30 +1200
changeset 373726 3f0ca367f2261f2d33efea8aadd1aac88f58ae81
parent 372484 2c7440e46d8786b2c82a1d2004e2b6d9d13f4046
child 522455 ed43cb3986e804e46616368f1b550b05363daa1f
push id19821
push userbvandyk@mozilla.com
push dateWed, 01 Jun 2016 03:38:15 +0000
reviewersmaja_zf
bugs1277136
milestone49.0a1
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
dom/media/test/external/external_media_harness/testcase.py
--- 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