2008-07-30 04:55:27 +00:00
|
|
|
<!DOCTYPE HTML>
|
|
|
|
<html>
|
|
|
|
<head>
|
2009-02-11 01:23:19 +00:00
|
|
|
<title>Media test: autoplay attribute</title>
|
2008-07-30 04:55:27 +00:00
|
|
|
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
|
|
|
|
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
|
2010-08-27 02:11:46 +00:00
|
|
|
<script type="text/javascript" src="manifest.js"></script>
|
2008-07-30 04:55:27 +00:00
|
|
|
</head>
|
|
|
|
<body>
|
2010-11-05 00:44:33 +00:00
|
|
|
<video id='v1'"></video><audio id='a1'></audio>
|
|
|
|
<video id='v2' autoplay></video><audio id='a2' autoplay></audio>
|
2008-07-30 04:55:27 +00:00
|
|
|
<pre id="test">
|
|
|
|
<script class="testbody" type="text/javascript">
|
|
|
|
var v1 = document.getElementById('v1');
|
|
|
|
var a1 = document.getElementById('a1');
|
|
|
|
var v2 = document.getElementById('v2');
|
|
|
|
var a2 = document.getElementById('a2');
|
|
|
|
ok(!v1.autoplay, "v1.autoplay should be false by default");
|
|
|
|
ok(!a1.autoplay, "v1.autoplay should be false by default");
|
|
|
|
ok(v2.autoplay, "v2.autoplay should be true");
|
|
|
|
ok(a2.autoplay, "v2.autoplay should be true");
|
|
|
|
|
|
|
|
v1.autoplay = true;
|
2009-05-18 02:00:44 +00:00
|
|
|
a1.autoplay = true;
|
2008-07-30 04:55:27 +00:00
|
|
|
ok(v1.autoplay, "video.autoplay not true");
|
2009-05-18 02:00:44 +00:00
|
|
|
ok(a1.autoplay, "audio.autoplay not true");
|
|
|
|
is(v1.getAttribute("autoplay"), "", "video autoplay attribute not set");
|
|
|
|
is(a1.getAttribute("autoplay"), "", "video autoplay attribute not set");
|
2010-08-27 02:11:46 +00:00
|
|
|
|
|
|
|
mediaTestCleanup();
|
|
|
|
|
2008-07-30 04:55:27 +00:00
|
|
|
</script>
|
|
|
|
</pre>
|
|
|
|
</body>
|
|
|
|
</html>
|