2014-04-25 00:45:00 +00:00
|
|
|
SimpleTest.requestLongerTimeout(3);
|
2010-08-27 02:11:46 +00:00
|
|
|
var manager = new MediaTestManager;
|
2009-07-10 03:08:34 +00:00
|
|
|
|
2013-03-01 14:18:58 +00:00
|
|
|
// https://bugzilla.mozilla.org/show_bug.cgi?id=634747
|
|
|
|
if (navigator.platform.startsWith("Win")) {
|
|
|
|
SimpleTest.expectAssertions(0, 5);
|
2013-03-01 16:58:12 +00:00
|
|
|
} else {
|
2013-03-01 16:08:54 +00:00
|
|
|
// This is "###!!! ASSERTION: Page read cursor should be inside range: 'mPageOffset <= endOffset'"
|
2013-03-01 16:58:12 +00:00
|
|
|
// https://bugzilla.mozilla.org/show_bug.cgi?id=846769
|
2013-03-02 09:23:39 +00:00
|
|
|
SimpleTest.expectAssertions(0, 5);
|
2013-03-01 14:18:58 +00:00
|
|
|
}
|
|
|
|
|
2010-08-27 02:11:46 +00:00
|
|
|
function createTestArray() {
|
|
|
|
var tests = [];
|
|
|
|
var tmpVid = document.createElement("video");
|
|
|
|
|
|
|
|
for (var testNum=0; testNum<gSeekTests.length; testNum++) {
|
|
|
|
var test = gSeekTests[testNum];
|
|
|
|
if (!tmpVid.canPlayType(test.type)) {
|
|
|
|
continue;
|
|
|
|
}
|
2009-07-10 03:08:34 +00:00
|
|
|
|
2014-07-31 18:37:00 +00:00
|
|
|
var t = new Object;
|
|
|
|
t.name = test.name;
|
|
|
|
t.type = test.type;
|
|
|
|
t.duration = test.duration;
|
|
|
|
t.number = SEEK_TEST_NUMBER;
|
|
|
|
tests.push(t);
|
2009-07-10 03:08:34 +00:00
|
|
|
}
|
2010-08-27 02:11:46 +00:00
|
|
|
return tests;
|
|
|
|
}
|
|
|
|
|
|
|
|
function startTest(test, token) {
|
|
|
|
var v = document.createElement('video');
|
2014-06-18 05:07:02 +00:00
|
|
|
v.token = token += "-seek" + test.number + ".js";
|
|
|
|
manager.started(v.token);
|
2010-08-27 02:11:46 +00:00
|
|
|
v.src = test.name;
|
2013-07-31 07:35:44 +00:00
|
|
|
v.preload = "metadata";
|
2010-08-27 02:11:46 +00:00
|
|
|
document.body.appendChild(v);
|
|
|
|
var name = test.name + " seek test " + test.number;
|
|
|
|
var localIs = function(name) { return function(a, b, msg) {
|
|
|
|
is(a, b, name + ": " + msg);
|
|
|
|
}}(name);
|
|
|
|
var localOk = function(name) { return function(a, msg) {
|
|
|
|
ok(a, name + ": " + msg);
|
|
|
|
}}(name);
|
|
|
|
var localFinish = function(v, manager) { return function() {
|
2014-04-25 00:45:00 +00:00
|
|
|
v.onerror = null;
|
|
|
|
removeNodeAndSource(v);
|
2014-06-18 05:07:02 +00:00
|
|
|
dump("SEEK-TEST: Finished " + name + " token: " + v.token + "\n");
|
2010-08-27 02:11:46 +00:00
|
|
|
manager.finished(v.token);
|
|
|
|
}}(v, manager);
|
2010-10-25 21:50:02 +00:00
|
|
|
dump("SEEK-TEST: Started " + name + "\n");
|
2010-08-27 02:11:46 +00:00
|
|
|
window['test_seek' + test.number](v, test.duration/2, localIs, localOk, localFinish);
|
2009-07-10 03:08:34 +00:00
|
|
|
}
|