Bug 668973 - Part 1 - remove flooding logs in frequent 'timeupdate' handler which make debugging hard. r=cpearce

This commit is contained in:
JW Wang 2014-10-07 19:55:00 +02:00
Родитель a6baba18bf
Коммит 7d399e8275
1 изменённых файлов: 17 добавлений и 14 удалений

Просмотреть файл

@ -21,23 +21,24 @@ function startTest(test, token) {
var v = document.createElement('video');
v.preload = "metadata";
v.token = token;
v.prevTime = 0;
manager.started(token);
v.src = test.name;
v.name = test.name;
var check = function(test, v) { return function() {
is(test.name, v.name, "Name should match test.name #1");
is(test.name, v.name, test.name + ": Name should match #1");
checkMetadata(test.name, v, test);
}}(test, v);
var noLoad = function(test, v) { return function() {
ok(false, test.name + " should not fire 'load' event");
}}(test, v);
var checkEnded = function(test, v) { return function() {
if (test.duration) {
ok(Math.abs(v.currentTime - test.duration) < 0.1,
test.name + " current time at end: " + v.currentTime + " should be: " + test.duration);
}
is(test.name, v.name, "Name should match test.name #2");
checkMetadata(test.name, v, test);
is(test.name, v.name, test.name + ": Name should match #2");
is(v.readyState, v.HAVE_CURRENT_DATA, test.name + " checking readyState");
ok(v.readyState != v.NETWORK_LOADED, test.name + " shouldn't report NETWORK_LOADED");
ok(v.ended, test.name + " checking playback has ended");
@ -48,10 +49,12 @@ function startTest(test, token) {
manager.finished(v.token);
}
}}(test, v);
var checkSuspended = function(test, v) { return function() {
is(test.name, v.name, "Name should match test.name #3");
if (v.seenSuspend)
is(test.name, v.name, test.name + ": Name should match #3");
if (v.seenSuspend) {
return;
}
v.seenSuspend = true;
ok(true, test.name + " got suspend");
@ -62,15 +65,15 @@ function startTest(test, token) {
manager.finished(v.token);
}
}}(test, v);
v.prevTime = 0;
var timeUpdate = function(test, v) { return function() {
is(test.name, v.name, "Name should match test.name #4");
checkMetadata(test.name, v, test);
ok(v.prevTime <= v.currentTime,
test.name + " time should run forwards: p=" +
v.prevTime + " c=" + v.currentTime);
if (v.prevTime > v.currentTime) {
ok(false, test.name + " time should run forwards: p=" +
v.prevTime + " c=" + v.currentTime);
}
v.prevTime = v.currentTime;
}}(test, v);
v.addEventListener("load", noLoad, false);
v.addEventListener("loadedmetadata", check, false);
v.addEventListener("timeupdate", timeUpdate, false);