Bug 1331271 - Drive by to fix styling in youtube puppeteer. r=maja_zf
authorBryce Van Dyk <bvandyk@mozilla.com>
Thu, 12 Jan 2017 11:20:04 +1300
changeset 377482 781af10456d9e2e1a000676048feac2972cb2b35
parent 377481 177c824211caa223fe658e90d1de1f01756dca18
child 377483 5973663bb8bcea5e8c2d4b2d7435639860c9dc15
push id1419
push userjlund@mozilla.com
push dateMon, 10 Apr 2017 20:44:07 +0000
treeherdermozilla-release@5e6801b73ef6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmaja_zf
bugs1331271
milestone53.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1331271 - Drive by to fix styling in youtube puppeteer. r=maja_zf MozReview-Commit-ID: 8lAxM2MLjjv
dom/media/test/external/external_media_tests/media_utils/youtube_puppeteer.py
--- a/dom/media/test/external/external_media_tests/media_utils/youtube_puppeteer.py
+++ b/dom/media/test/external/external_media_tests/media_utils/youtube_puppeteer.py
@@ -303,17 +303,17 @@ class YouTubePuppeteer(VideoPuppeteer):
         expects a dictionary containing the following keys:
         player_duration, player_current_time, player_playback_quality,
         player_movie_id, player_movie_title, player_url, player_state,
         player_ad_state, and player_breaks_count.
 
         For more information on the above keys and their values see
         `_yt_state_named_tuple`.
 
-        :return: A named tuple 'yt_state_info', derived from arguments and
+        :return: A named tuple 'player_state_info', derived from arguments and
         state information from the puppeteer.
         """
         player_state_info_kwargs['player_remaining_time'] = (
             self.expected_duration -
             player_state_info_kwargs['player_current_time'])
         # Calculate player state convenience info
         player_state = player_state_info_kwargs['player_state']
         player_state_info_kwargs['player_unstarted'] = (
@@ -364,17 +364,17 @@ class YouTubePuppeteer(VideoPuppeteer):
                 'player_state,'
                 'player_ad_state,'
                 'player_breaks_count];')
         return self._fetch_state_script_string
 
     def _refresh_state(self):
         """
         Refresh the snapshot of the underlying video and player state. We do
-        this allin one so that the state doesn't change in between queries.
+        this all in one so that the state doesn't change in between queries.
 
         We also store information that can be derived from the snapshotted
         information, such as lag. This is stored in the last seen state to
         stress that it's based on the snapshot.
         """
         values = self._execute_yt_script(self._fetch_state_script)
         video_keys = ['base_uri', 'current_time', 'duration',
                       'raw_buffered_ranges', 'raw_played_ranges',
@@ -467,30 +467,30 @@ class YouTubePuppeteer(VideoPuppeteer):
                     message = '\n'.join(['Playback stalled', str(self)])
                     raise VideoException(message)
             if self._last_seen_player_state.player_breaks_count > 0:
                 self.process_ad()
             if remaining_time > 1.5 * rest:
                 sleep(rest)
             else:
                 sleep(rest / 2)
-            # TODO during an ad, remaining_time will be based on ad's current_time
-            # rather than current_time of target video
+            # TODO during an ad, remaining_time will be based on ad's
+            # current_time rather than current_time of target video
             remaining_time = self._last_seen_player_state.player_remaining_time
         return remaining_time
 
     def __str__(self):
         messages = [super(YouTubePuppeteer, self).__str__()]
         if not self.player:
             messages += ['\t.html5-media-player: None']
             return '\n'.join(messages)
         if not self._last_seen_player_state:
             messages += ['\t.html5-media-player: No last seen state']
             return '\n'.join(messages)
         messages += ['.html5-media-player: {']
         for field in self._last_seen_player_state._fields:
             # For compatibility with different test environments we force ascii
             field_ascii = (
-                unicode(getattr(self._last_seen_player_state, field))
-                        .encode('ascii', 'replace'))
+                unicode(getattr(self._last_seen_player_state, field)).encode(
+                    'ascii', 'replace'))
             messages += [('\t{}: {}'.format(field, field_ascii))]
         messages += '}'
         return '\n'.join(messages)