content/media/webaudio/test/test_badConnect.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>Test whether we can create an AudioContext interface</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 </head>
     8 <body>
     9 <pre id="test">
    10 <script src="webaudio.js" type="text/javascript"></script>
    11 <script class="testbody" type="text/javascript">
    13 SimpleTest.waitForExplicitFinish();
    14 addLoadEvent(function() {
    15   var context1 = new AudioContext();
    16   var context2 = new AudioContext();
    18   var destination1 = context1.destination;
    19   var destination2 = context2.destination;
    21   isnot(destination1, destination2, "Destination nodes should not be the same");
    22   isnot(destination1.context, destination2.context, "Destination nodes should not have the same context");
    24   var source1 = context1.createBufferSource();
    26   expectException(function() {
    27     source1.connect(destination1, 1);
    28   }, DOMException.INDEX_SIZE_ERR);
    29   expectException(function() {
    30     source1.connect(destination1, 0, 1);
    31   }, DOMException.INDEX_SIZE_ERR);
    32   expectException(function() {
    33     source1.connect(destination2);
    34   }, DOMException.SYNTAX_ERR);
    36   source1.connect(destination1);
    38   expectException(function() {
    39     source1.disconnect(1);
    40   }, DOMException.INDEX_SIZE_ERR);
    42   SimpleTest.finish();
    43 });
    45 </script>
    46 </pre>
    47 </body>
    48 </html>

mercurial