Bug 1276643 - Correct variables used in error logging. Formatting for pep8. r?maja_zf
MozReview-Commit-ID: 1VKUYwxOsQC
--- a/dom/media/test/external/external_media_harness/testcase.py
+++ b/dom/media/test/external/external_media_harness/testcase.py
@@ -263,20 +263,21 @@ class EMESetupMixin(object):
adobe_result = self.marionette.execute_async_script(
reset_adobe_gmp_script,
script_timeout=60000)
widevine_result = self.marionette.execute_async_script(
reset_widevine_gmp_script,
script_timeout=60000)
if not adobe_result == 'success':
raise VideoException(
- 'ERROR: Resetting Adobe GMP failed % s' % result)
+ 'ERROR: Resetting Adobe GMP failed % s' % adobe_result)
if not widevine_result == 'success':
raise VideoException(
- 'ERROR: Resetting Widevine GMP failed % s' % result)
+ 'ERROR: Resetting Widevine GMP failed % s'
+ % widevine_result)
EMESetupMixin.version_needs_reset = False
def check_and_log_boolean_pref(self, pref_name, expected_value):
with self.marionette.using_context('chrome'):
pref_value = self.prefs.get_pref(pref_name)
if pref_value is None:
@@ -306,42 +307,43 @@ class EMESetupMixin(object):
self.logger.info('Pref %s is not an integer' % pref_name)
return False
return pref_value >= minimum_value
def chceck_and_log_version_string_pref(self, pref_name, minimum_value='0'):
"""
Compare a pref made up of integers separated by stops .s, with a
- version string of the same format. The number of integers in each string
- does not need to match. The comparison is done by converting each to an
- integer array and comparing those. Both version strings must be made
- up of only integers, or this method will raise an unhandled exception
- of type ValueError when the conversion to int fails.
+ version string of the same format. The number of integers in each
+ string does not need to match. The comparison is done by converting
+ each to an integer array and comparing those. Both version strings
+ must be made up of only integers, or this method will raise an
+ unhandled exception of type ValueError when the conversion to int
+ fails.
"""
with self.marionette.using_context('chrome'):
pref_value = self.prefs.get_pref(pref_name)
if pref_value is None:
self.logger.info('Pref %s has no value.' % pref_name)
return False
else:
self.logger.info('Pref %s = %s' % (pref_name, pref_value))
match = re.search('^\d(.\d+)*$', pref_value)
if not match:
- self.logger.info('Pref %s is not a version string' % pref_name)
+ self.logger.info('Pref %s is not a version string'
+ % pref_name)
return False
pref_ints = [int(n) for n in pref_value.split('.')]
minumum_ints = [int(n) for n in minimum_value.split('.')]
return pref_ints >= minumum_ints
-
def check_eme_prefs(self):
with self.marionette.using_context('chrome'):
return all([
self.check_and_log_boolean_pref(
'media.mediasource.enabled', True),
self.check_and_log_boolean_pref(
'media.eme.enabled', True),
self.check_and_log_boolean_pref(