зеркало из https://github.com/mozilla/gecko-dev.git
Bug 668973 - Part 1 - remove flooding logs in frequent 'timeupdate' handler which make debugging hard. r=cpearce
This commit is contained in:
Родитель
a6baba18bf
Коммит
7d399e8275
|
@ -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);
|
||||
|
|
Загрузка…
Ссылка в новой задаче