Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
michael@0 | 1 | <!DOCTYPE HTML> |
michael@0 | 2 | <html> |
michael@0 | 3 | <head> |
michael@0 | 4 | <title>Test whether we can create an AudioContext interface</title> |
michael@0 | 5 | <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script> |
michael@0 | 6 | <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" /> |
michael@0 | 7 | </head> |
michael@0 | 8 | <body> |
michael@0 | 9 | <pre id="test"> |
michael@0 | 10 | <script src="webaudio.js" type="text/javascript"></script> |
michael@0 | 11 | <script class="testbody" type="text/javascript"> |
michael@0 | 12 | |
michael@0 | 13 | SimpleTest.waitForExplicitFinish(); |
michael@0 | 14 | addLoadEvent(function() { |
michael@0 | 15 | var context1 = new AudioContext(); |
michael@0 | 16 | var context2 = new AudioContext(); |
michael@0 | 17 | |
michael@0 | 18 | var destination1 = context1.destination; |
michael@0 | 19 | var destination2 = context2.destination; |
michael@0 | 20 | |
michael@0 | 21 | isnot(destination1, destination2, "Destination nodes should not be the same"); |
michael@0 | 22 | isnot(destination1.context, destination2.context, "Destination nodes should not have the same context"); |
michael@0 | 23 | |
michael@0 | 24 | var source1 = context1.createBufferSource(); |
michael@0 | 25 | |
michael@0 | 26 | expectException(function() { |
michael@0 | 27 | source1.connect(destination1, 1); |
michael@0 | 28 | }, DOMException.INDEX_SIZE_ERR); |
michael@0 | 29 | expectException(function() { |
michael@0 | 30 | source1.connect(destination1, 0, 1); |
michael@0 | 31 | }, DOMException.INDEX_SIZE_ERR); |
michael@0 | 32 | expectException(function() { |
michael@0 | 33 | source1.connect(destination2); |
michael@0 | 34 | }, DOMException.SYNTAX_ERR); |
michael@0 | 35 | |
michael@0 | 36 | source1.connect(destination1); |
michael@0 | 37 | |
michael@0 | 38 | expectException(function() { |
michael@0 | 39 | source1.disconnect(1); |
michael@0 | 40 | }, DOMException.INDEX_SIZE_ERR); |
michael@0 | 41 | |
michael@0 | 42 | SimpleTest.finish(); |
michael@0 | 43 | }); |
michael@0 | 44 | |
michael@0 | 45 | </script> |
michael@0 | 46 | </pre> |
michael@0 | 47 | </body> |
michael@0 | 48 | </html> |