content/media/webaudio/test/test_scriptProcessorNodeNotConnected.html

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

     1 <!DOCTYPE HTML>
     2 <html>
     3 <head>
     4   <title>Test AudioBufferSourceNode: should not fire audioprocess if not connected.</title>
     5   <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
     6   <script type="text/javascript" src="webaudio.js"></script>
     7   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
     8 </head>
     9 <body>
    10 <pre id="test">
    11 <script class="testbody" type="text/javascript">
    12 SimpleTest.waitForExplicitFinish();
    13 addLoadEvent(function() {
    14   var context = new AudioContext();
    16   var sp = context.createScriptProcessor(2048, 2, 2);
    17   sp.onaudioprocess = function(e) {
    18     ok(false, "Should not call onaudioprocess if the node is not connected.");
    19     sp.onaudioprocess = null;
    20     SimpleTest.finish();
    21   };
    22   setTimeout(function() {
    23     console.log(sp.onaudioprocess);
    24     if (sp.onaudioprocess) {
    25       ok(true, "onaudioprocess not fired.");
    26       SimpleTest.finish();
    27     }
    28   }, 4000);
    29 });
    30 </script>
    31 </pre>
    32 </body>
    33 </html>

mercurial