content/media/test/test_autoplay.html

Fri, 16 Jan 2015 04:50:19 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Fri, 16 Jan 2015 04:50:19 +0100
branch
TOR_BUG_9701
changeset 13
44a2da4a2ab2
permissions
-rw-r--r--

Replace accessor implementation with direct member state manipulation, by
request https://trac.torproject.org/projects/tor/ticket/9701#comment:32

     1 <!DOCTYPE HTML>
     2 <html>
     3 <head>
     4   <title>Media test: autoplay attribute</title>
     5   <script type="text/javascript" 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 var v1 = document.getElementById('v1');
    15 var a1 = document.getElementById('a1');
    16 var v2 = document.getElementById('v2');
    17 var a2 = document.getElementById('a2');
    18 ok(!v1.autoplay, "v1.autoplay should be false by default");
    19 ok(!a1.autoplay, "v1.autoplay should be false by default");
    20 ok(v2.autoplay, "v2.autoplay should be true");
    21 ok(a2.autoplay, "v2.autoplay should be true");
    23 v1.autoplay = true;
    24 a1.autoplay = true;
    25 ok(v1.autoplay, "video.autoplay not true");
    26 ok(a1.autoplay, "audio.autoplay not true");
    27 is(v1.getAttribute("autoplay"), "", "video autoplay attribute not set");
    28 is(a1.getAttribute("autoplay"), "", "video autoplay attribute not set");
    30 mediaTestCleanup();
    32 </script>
    33 </pre>
    34 </body>
    35 </html>

mercurial