From c1d821b50120a8e7b2089507973f8524ea5f5a64 Mon Sep 17 00:00:00 2001 From: Bobby Holley Date: Thu, 11 Jun 2015 16:04:28 -0700 Subject: [PATCH] Bug 1163223 - Switch test_buffered to use timeupdate rather than loadedmetadata. r=cpearce The problem is that we can't compute buffered until we know the start time, but don't necessarily know the start time by the time we fire loadedmetadata (we just know the duration). Chris determined that there was nothing in the spec that requires any particular behavior from .buffered after loadedmetadata, so this should be fine. --- dom/media/test/test_buffered.html | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/dom/media/test/test_buffered.html b/dom/media/test/test_buffered.html index 892e39ef2d8e..407ae7404055 100644 --- a/dom/media/test/test_buffered.html +++ b/dom/media/test/test_buffered.html @@ -25,6 +25,7 @@ var manager = new MediaTestManager; function testBuffered(e) { var v = e.target; + v.removeEventListener('timeupdate', testBuffered); // The whole media should be buffered... var b = v.buffered; @@ -94,12 +95,12 @@ function startTest(test, token) { // we have deterministic behaviour. var onfetched = function(uri) { var v = document.createElement('video'); - v.preload = "metadata"; + v.autoplay = true; v._token = token; v.src = uri; v._name = test.name; v._test = test; - v.addEventListener("loadedmetadata", testBuffered, false); + v.addEventListener("timeupdate", testBuffered, false); document.body.appendChild(v); };