Bug 1104410 - Add a test.

--HG--
extra : rebase_source : 5350acb0503b650ba322cebe14d39e1df5778e51
This commit is contained in:
Matthew Gregan 2014-12-02 11:59:45 +13:00
parent b978aefc5b
commit 351ed45e21
6 changed files with 6 additions and 13 deletions

View File

@ -430,6 +430,7 @@ var gSeekTests = [
{ name:"seek.ogv", type:"video/ogg", duration:3.966 }, { name:"seek.ogv", type:"video/ogg", duration:3.966 },
{ name:"320x240.ogv", type:"video/ogg", duration:0.266 }, { name:"320x240.ogv", type:"video/ogg", duration:0.266 },
{ name:"seek.webm", type:"video/webm", duration:3.966 }, { name:"seek.webm", type:"video/webm", duration:3.966 },
{ name:"sine.webm", type:"audio/webm", duration:4.001 },
{ name:"bug516323.indexed.ogv", type:"video/ogg", duration:4.208333 }, { name:"bug516323.indexed.ogv", type:"video/ogg", duration:4.208333 },
{ name:"split.webm", type:"video/webm", duration:1.967 }, { name:"split.webm", type:"video/webm", duration:1.967 },
{ name:"detodos.opus", type:"audio/ogg; codecs=opus", duration:2.9135 }, { name:"detodos.opus", type:"audio/ogg; codecs=opus", duration:2.9135 },
@ -718,9 +719,7 @@ function removeNodeAndSource(n) {
} }
} }
// Number of tests to run in parallel. Warning: Each media element requires // Number of tests to run in parallel.
// at least 3 threads (4 on Linux), and on Linux each thread uses 10MB of
// virtual address space. Beware!
var PARALLEL_TESTS = 2; var PARALLEL_TESTS = 2;
// When true, we'll loop forever on whatever test we run. Use this to debug // When true, we'll loop forever on whatever test we run. Use this to debug

View File

@ -231,6 +231,8 @@ support-files =
seek_support.js seek_support.js
seekLies.sjs seekLies.sjs
seek_with_sound.ogg^headers^ seek_with_sound.ogg^headers^
sine.webm
sine.webm^headers^
short-cenc.mp4 short-cenc.mp4
short-video.ogv short-video.ogv
short-video.ogv^headers^ short-video.ogv^headers^

BIN
dom/media/test/sine.webm Normal file

Binary file not shown.

View File

@ -0,0 +1 @@
Cache-Control: no-store

View File

@ -30,7 +30,7 @@ function testBuffered(e) {
var b = v.buffered; var b = v.buffered;
is(b.length, 1, v._name + ": Should be buffered in one range"); is(b.length, 1, v._name + ": Should be buffered in one range");
is(b.start(0), 0, v._name + ": First range start should be media start"); is(b.start(0), 0, v._name + ": First range start should be media start");
is(b.end(0), v.duration, v._name + ": First range end should be media end"); ok(Math.abs(b.end(0) - v.duration) < 0.1, v._name + ": First range end should be media end");
// Ensure INDEX_SIZE_ERR is thrown when we access outside the range // Ensure INDEX_SIZE_ERR is thrown when we access outside the range
var caught = false; var caught = false;

View File

@ -200,15 +200,6 @@ var tests = [
} }
]; ];
function rangeCheck(n1, n2) {
var THRESHOLD = 0.35;
var diff = Math.abs(n1 - n2);
if (diff < THRESHOLD) {
return true;
}
return false;
}
function createTestArray() { function createTestArray() {
var A = []; var A = [];
for (var i=0; i<tests.length; i++) { for (var i=0; i<tests.length; i++) {