test_autoplay.html (1224B)
1 <!DOCTYPE HTML> 2 <html> 3 <head> 4 <title>Media test: autoplay attribute</title> 5 <script src="/tests/SimpleTest/SimpleTest.js"></script> 6 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" /> 7 <script type="text/javascript" src="manifest.js"></script> 8 </head> 9 <body> 10 <video id='v1'"></video><audio id='a1'></audio> 11 <video id='v2' autoplay></video><audio id='a2' autoplay></audio> 12 <pre id="test"> 13 <script class="testbody" type="text/javascript"> 14 /* import-globals-from ../../../test/manifest.js */ 15 var v1 = document.getElementById('v1'); 16 var a1 = document.getElementById('a1'); 17 var v2 = document.getElementById('v2'); 18 var a2 = document.getElementById('a2'); 19 ok(!v1.autoplay, "v1.autoplay should be false by default"); 20 ok(!a1.autoplay, "v1.autoplay should be false by default"); 21 ok(v2.autoplay, "v2.autoplay should be true"); 22 ok(a2.autoplay, "v2.autoplay should be true"); 23 24 v1.autoplay = true; 25 a1.autoplay = true; 26 ok(v1.autoplay, "video.autoplay not true"); 27 ok(a1.autoplay, "audio.autoplay not true"); 28 is(v1.getAttribute("autoplay"), "", "video autoplay attribute not set"); 29 is(a1.getAttribute("autoplay"), "", "video autoplay attribute not set"); 30 31 mediaTestCleanup(); 32 33 </script> 34 </pre> 35 </body> 36 </html>