content/media/test/test_autoplay.html

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/content/media/test/test_autoplay.html	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,35 @@
     1.4 +<!DOCTYPE HTML>
     1.5 +<html>
     1.6 +<head>
     1.7 +  <title>Media test: autoplay attribute</title>
     1.8 +  <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
     1.9 +  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
    1.10 +  <script type="text/javascript" src="manifest.js"></script>
    1.11 +</head>
    1.12 +<body>
    1.13 +<video id='v1'"></video><audio id='a1'></audio>
    1.14 +<video id='v2' autoplay></video><audio id='a2' autoplay></audio>
    1.15 +<pre id="test">
    1.16 +<script class="testbody" type="text/javascript">
    1.17 +var v1 = document.getElementById('v1');
    1.18 +var a1 = document.getElementById('a1');
    1.19 +var v2 = document.getElementById('v2');
    1.20 +var a2 = document.getElementById('a2');
    1.21 +ok(!v1.autoplay, "v1.autoplay should be false by default");
    1.22 +ok(!a1.autoplay, "v1.autoplay should be false by default");
    1.23 +ok(v2.autoplay, "v2.autoplay should be true");
    1.24 +ok(a2.autoplay, "v2.autoplay should be true");
    1.25 +
    1.26 +v1.autoplay = true;
    1.27 +a1.autoplay = true;
    1.28 +ok(v1.autoplay, "video.autoplay not true");
    1.29 +ok(a1.autoplay, "audio.autoplay not true");
    1.30 +is(v1.getAttribute("autoplay"), "", "video autoplay attribute not set");
    1.31 +is(a1.getAttribute("autoplay"), "", "video autoplay attribute not set");
    1.32 +
    1.33 +mediaTestCleanup();
    1.34 +
    1.35 +</script>
    1.36 +</pre>
    1.37 +</body>
    1.38 +</html>

mercurial