Bug 1343407 - Fix attribute name video_uri -> base_uri when logging stalls. r=maja_zf
authorBryce Van Dyk <bvandyk@mozilla.com>
Wed, 01 Mar 2017 14:12:06 +1300
changeset 490863 c6a4bbb143946b614aa02da0a88bf1c80ea9918e
parent 490862 51b368d536a3b1ae2985dcd0bc8414cd2d2cec66
child 490864 93829484f746d0d2d6ad5eee55b0b1df000401c0
push id47245
push userbmo:sledru@mozilla.com
push dateWed, 01 Mar 2017 10:58:52 +0000
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
--- 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,
         # 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).