2009-07-09 20:08:34 -07:00
|
|
|
<!DOCTYPE HTML>
|
|
|
|
<html>
|
|
|
|
<head>
|
|
|
|
<title>Media test: seek tests</title>
|
|
|
|
<script type="text/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="text/javascript" src="seek1.js"></script>
|
|
|
|
<script type="text/javascript" src="seek2.js"></script>
|
|
|
|
<script type="text/javascript" src="seek3.js"></script>
|
|
|
|
<script type="text/javascript" src="seek4.js"></script>
|
|
|
|
<script type="text/javascript" src="seek5.js"></script>
|
|
|
|
<script type="text/javascript" src="seek6.js"></script>
|
|
|
|
<script type="text/javascript" src="seek7.js"></script>
|
|
|
|
<script type="text/javascript" src="seek8.js"></script>
|
|
|
|
<script type="text/javascript" src="seek9.js"></script>
|
2009-10-20 20:24:21 -07:00
|
|
|
<script type="text/javascript" src="seek10.js"></script>
|
2010-05-30 15:02:06 -07:00
|
|
|
<script type="text/javascript" src="seek11.js"></script>
|
2011-01-31 18:57:13 -08:00
|
|
|
<script type="text/javascript" src="seek12.js"></script>
|
|
|
|
<script type="text/javascript" src="seek13.js"></script>
|
2009-07-09 20:08:34 -07:00
|
|
|
</head>
|
|
|
|
<body>
|
|
|
|
<pre id="test">
|
|
|
|
<script class="testbody" type="text/javascript">
|
|
|
|
|
2014-04-24 17:45:00 -07:00
|
|
|
SimpleTest.requestLongerTimeout(3);
|
2010-08-26 19:11:46 -07:00
|
|
|
var manager = new MediaTestManager;
|
2009-07-09 20:08:34 -07:00
|
|
|
|
2013-03-01 06:18:58 -08:00
|
|
|
// https://bugzilla.mozilla.org/show_bug.cgi?id=634747
|
|
|
|
if (navigator.platform.startsWith("Win")) {
|
|
|
|
SimpleTest.expectAssertions(0, 5);
|
2013-03-01 08:58:12 -08:00
|
|
|
} else {
|
2013-03-01 08:08:54 -08:00
|
|
|
// This is "###!!! ASSERTION: Page read cursor should be inside range: 'mPageOffset <= endOffset'"
|
2013-03-01 08:58:12 -08:00
|
|
|
// https://bugzilla.mozilla.org/show_bug.cgi?id=846769
|
2013-03-02 01:23:39 -08:00
|
|
|
SimpleTest.expectAssertions(0, 5);
|
2013-03-01 06:18:58 -08:00
|
|
|
}
|
|
|
|
|
2011-01-31 18:57:13 -08:00
|
|
|
const NUM_SEEK_TESTS = 13;
|
2009-07-09 20:08:34 -07:00
|
|
|
|
2010-08-26 19:11:46 -07: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-09 20:08:34 -07:00
|
|
|
|
2010-08-26 19:11:46 -07:00
|
|
|
for (var i = 1; i <= NUM_SEEK_TESTS; ++i) {
|
|
|
|
var t = new Object;
|
|
|
|
t.name = test.name;
|
|
|
|
t.type = test.type;
|
|
|
|
t.duration = test.duration;
|
|
|
|
t.number = i;
|
|
|
|
tests.push(t);
|
|
|
|
}
|
2009-07-09 20:08:34 -07:00
|
|
|
}
|
2010-08-26 19:11:46 -07:00
|
|
|
return tests;
|
|
|
|
}
|
|
|
|
|
|
|
|
function startTest(test, token) {
|
|
|
|
var v = document.createElement('video');
|
2014-06-13 13:20:37 -07:00
|
|
|
manager.started(token);
|
2010-08-26 19:11:46 -07:00
|
|
|
v.src = test.name;
|
2013-07-31 00:35:44 -07:00
|
|
|
v.preload = "metadata";
|
2014-06-13 13:20:37 -07:00
|
|
|
v.token = token;
|
2010-08-26 19:11:46 -07: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-24 17:45:00 -07:00
|
|
|
v.onerror = null;
|
|
|
|
removeNodeAndSource(v);
|
2014-06-13 13:20:37 -07:00
|
|
|
dump("SEEK-TEST: Finished " + name + "\n");
|
2010-08-26 19:11:46 -07:00
|
|
|
manager.finished(v.token);
|
|
|
|
}}(v, manager);
|
2010-10-25 14:50:02 -07:00
|
|
|
dump("SEEK-TEST: Started " + name + "\n");
|
2010-08-26 19:11:46 -07:00
|
|
|
window['test_seek' + test.number](v, test.duration/2, localIs, localOk, localFinish);
|
2009-07-09 20:08:34 -07:00
|
|
|
}
|
|
|
|
|
2010-08-26 19:11:46 -07:00
|
|
|
manager.runTests(createTestArray(), startTest);
|
2009-07-09 20:08:34 -07:00
|
|
|
|
|
|
|
</script>
|
|
|
|
</pre>
|
|
|
|
</body>
|
|
|
|
</html>
|