mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-02 10:00:54 +00:00
Bug 462957 - Test case for HTMLMediaElement.buffered. r=roc a=blocking2.0
This commit is contained in:
parent
22df23bd6e
commit
03731903d8
@ -93,6 +93,7 @@ _TEST_FILES = \
|
||||
test_audio2.html \
|
||||
test_autobuffer.html \
|
||||
test_autoplay.html \
|
||||
test_buffered.html \
|
||||
test_bug448534.html \
|
||||
test_bug463162.xhtml \
|
||||
test_bug465498.html \
|
||||
|
68
content/media/test/test_buffered.html
Normal file
68
content/media/test/test_buffered.html
Normal file
@ -0,0 +1,68 @@
|
||||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<!--
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id=462957
|
||||
-->
|
||||
<head>
|
||||
<title>Test for Bug 462957</title>
|
||||
<script type="application/javascript" src="/MochiKit/packed.js"></script>
|
||||
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
|
||||
<script type="text/javascript" src="manifest.js"></script>
|
||||
<script type="application/javascript" src="use_large_cache.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=462957">Mozilla Bug 462957</a>
|
||||
|
||||
<p id="display"></p>
|
||||
<div id="content" style="display: none">
|
||||
|
||||
</div>
|
||||
<pre id="test">
|
||||
<script type="application/javascript">
|
||||
|
||||
// Test for Bug 462957; HTMLMediaElement.buffered.
|
||||
|
||||
var videos = [];
|
||||
|
||||
function ended(e) {
|
||||
var v = e.target;
|
||||
|
||||
// The whole media should be buffered...
|
||||
var b = v.buffered;
|
||||
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.end(0), v.duration, v._name + ": First range end should be media end");
|
||||
|
||||
v._finished = true;
|
||||
if (AllFinished(videos)) {
|
||||
SimpleTest.finish();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
for (var i=0; i<gSeekTests.length; ++i) {
|
||||
var v = document.createElement('video');
|
||||
var test = gSeekTests[i];
|
||||
if (!v.canPlayType(test.type))
|
||||
continue;
|
||||
v.src = test.name;
|
||||
v._name = test.name;
|
||||
v._test = test;
|
||||
v._finished = false;
|
||||
v.autoplay = true;
|
||||
v.addEventListener("ended", ended, false);
|
||||
document.body.appendChild(v);
|
||||
videos.push(v);
|
||||
}
|
||||
|
||||
if (videos.length == 0) {
|
||||
todo(false, "No types supported");
|
||||
} else {
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
}
|
||||
|
||||
</script>
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
Loading…
Reference in New Issue
Block a user