mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-25 22:01:30 +00:00
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.
This commit is contained in:
parent
3ae1cac20c
commit
c1d821b501
@ -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);
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user