Bug 1343407 - Fix attribute name video_uri -> base_uri when logging stalls. r?maja_zf draft
authorBryce Van Dyk <bvandyk@mozilla.com>
Wed, 01 Mar 2017 14:12:06 +1300
changeset 490643 0a055fcf2bbb9a680930feb76d993521a6d3ea76
parent 484601 c0807d6938c13e43add377d5838df7168a59971e
child 547326 cdb3bccad269bfbba6442f55adcfa69d188f5cb8
push id47172
push userbvandyk@mozilla.com
push dateWed, 01 Mar 2017 01:15:28 +0000
reviewersmaja_zf
bugs1343407
milestone54.0a1
Bug 1343407 - Fix attribute name video_uri -> base_uri when logging stalls. r?maja_zf When logging a stall a non-existent attribute was attempting to be printed. This changeset fixes the name being used so that the logging will work correctly. Also contains a drive by change to make _video_var_script more consistent. There was a inconsistency with how objects were referenced which has been removed. MozReview-Commit-ID: hTHC9VIxBW
dom/media/test/external/external_media_tests/media_utils/video_puppeteer.py
--- a/dom/media/test/external/external_media_tests/media_utils/video_puppeteer.py
+++ b/dom/media/test/external/external_media_tests/media_utils/video_puppeteer.py
@@ -55,17 +55,17 @@ class VideoPuppeteer(object):
      of the video.
     :param stall_wait_time: The amount of time to wait to see if a stall has
      cleared. If 0, do not check for stalls.
     :param timeout: The amount of time to wait until the video starts.
     """
 
     _video_var_script = (
         'var video = arguments[0];'
-        'var baseURI = arguments[0].baseURI;'
+        'var baseURI = video.baseURI;'
         'var currentTime = video.wrappedJSObject.currentTime;'
         'var duration = video.wrappedJSObject.duration;'
         'var buffered = video.wrappedJSObject.buffered;'
         'var bufferedRanges = [];'
         'for (var i = 0; i < buffered.length; i++) {'
         'bufferedRanges.push([buffered.start(i), buffered.end(i)]);'
         '}'
         'var played = video.wrappedJSObject.played;'
@@ -200,17 +200,17 @@ class VideoPuppeteer(object):
         if self._last_seen_video_state.remaining_time < self.interval:
             return True
 
         # Check to see if the video has stalled. Accumulate the amount of lag
         # since the video started, and if it is too high, then raise.
         if (self.stall_wait_time and
                 self._last_seen_video_state.lag > self.stall_wait_time):
             raise VideoException('Video {} stalled.\n{}'
-                                 .format(self._last_seen_video_state.video_uri,
+                                 .format(self._last_seen_video_state.base_uri,
                                          self))
 
         # We are cruising, so we are not done.
         return False
 
     def _update_expected_duration(self):
         """
         Update the duration of the target video at self.test_url (in seconds).