2009-05-18 22:18:41 -07:00
|
|
|
<!DOCTYPE HTML>
|
|
|
|
<html>
|
|
|
|
<head>
|
2009-07-09 19:03:02 -07:00
|
|
|
<title>Media test: Audio Constructor Test 1</title>
|
2009-05-18 22:18:41 -07:00
|
|
|
<script type="text/javascript" src="/MochiKit/MochiKit.js"></script>
|
|
|
|
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
|
|
|
|
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
|
2009-07-09 19:03:02 -07:00
|
|
|
<script type="text/javascript" src="use_large_cache.js"></script>
|
|
|
|
<script type="text/javascript" src="manifest.js"></script>
|
2009-05-18 22:18:41 -07:00
|
|
|
</head>
|
|
|
|
<body>
|
|
|
|
<pre id="test">
|
|
|
|
<script class="testbody" type="text/javascript">
|
2009-07-09 19:03:02 -07:00
|
|
|
var testsWaiting = 0;
|
|
|
|
|
|
|
|
var tmpAudio = new Audio();
|
|
|
|
for (var i = 0; i < gAudioTests.length; ++i) {
|
|
|
|
var test = gAudioTests[i];
|
2009-07-14 07:04:56 -07:00
|
|
|
if (!tmpAudio.canPlayType(test.type))
|
2009-07-09 19:03:02 -07:00
|
|
|
continue;
|
|
|
|
|
|
|
|
var a1 = new Audio(test.name);
|
2009-07-26 14:31:11 -07:00
|
|
|
is(a1.getAttribute("autobuffer"), "autobuffer", "Autobuffer automatically set");
|
2009-07-09 19:03:02 -07:00
|
|
|
a1.addEventListener('load', function(event) {
|
|
|
|
is(event.target.networkState, HTMLMediaElement.NETWORK_LOADED,
|
|
|
|
"Audio " + event.target.currentSrc + " loaded");
|
|
|
|
--testsWaiting;
|
|
|
|
if (testsWaiting == 0) {
|
|
|
|
SimpleTest.finish();
|
|
|
|
}
|
|
|
|
}, false);
|
|
|
|
a1.load();
|
|
|
|
++testsWaiting;
|
|
|
|
}
|
2009-05-18 22:18:41 -07:00
|
|
|
|
|
|
|
SimpleTest.waitForExplicitFinish();
|
|
|
|
</script>
|
|
|
|
</pre>
|
|
|
|
</body>
|
|
|
|
</html>
|