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,
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).