OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 | 2 |
3 <html> | 3 <html> |
4 <head> | 4 <head> |
5 <script src="../resources/js-test.js"></script> | 5 <script src="../resources/js-test.js"></script> |
6 <script src="resources/compatibility.js"></script> | 6 <script src="resources/compatibility.js"></script> |
7 <script type="text/javascript" src="resources/audio-testing.js"></script> | 7 <script type="text/javascript" src="resources/audio-testing.js"></script> |
8 </head> | 8 </head> |
9 | 9 |
10 <body> | 10 <body> |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 // Create a new context and try to connect the other context's node to this
one. | 62 // Create a new context and try to connect the other context's node to this
one. |
63 try { | 63 try { |
64 context2 = new AudioContext(); | 64 context2 = new AudioContext(); |
65 window.audioNode.connect(context2.destination); | 65 window.audioNode.connect(context2.destination); |
66 testFailed("exception should be thrown when connecting to other context'
s node."); | 66 testFailed("exception should be thrown when connecting to other context'
s node."); |
67 } catch(e) { | 67 } catch(e) { |
68 testPassed("exception thrown when connecting to other context's node."); | 68 testPassed("exception thrown when connecting to other context's node."); |
69 } | 69 } |
70 | 70 |
71 // 3-arg AudioContext doesn't create an offline context anymore. | 71 // 3-arg AudioContext doesn't create an offline context anymore. |
72 shouldNotThrow("context3 = new AudioContext(1, 44100, 44100)"); | 72 shouldThrow("context3 = new AudioContext(1, 44100, 44100)"); |
73 if (context3 instanceof OfflineAudioContext) | |
74 testFailed("context3 should not be an OfflineAudioContext"); | |
75 else | |
76 testPassed("context3 is not an OfflineAudioContext"); | |
77 | 73 |
78 // Ensure it is an EventTarget | 74 // Ensure it is an EventTarget |
79 try { | 75 try { |
80 audioNode.addEventListener('testEvent', function(){ | 76 audioNode.addEventListener('testEvent', function(){ |
81 testPassed("AudioNode is an EventTarget"); | 77 testPassed("AudioNode is an EventTarget"); |
82 }); | 78 }); |
83 audioNode.dispatchEvent(new Event('testEvent')); | 79 audioNode.dispatchEvent(new Event('testEvent')); |
84 } catch(e) { | 80 } catch(e) { |
85 testFailed("exception shouldn't be thrown when testing whether audio nod
e is an event target"); | 81 testFailed("exception shouldn't be thrown when testing whether audio nod
e is an event target"); |
86 } | 82 } |
87 | 83 |
88 finishJSTest(); | 84 finishJSTest(); |
89 } | 85 } |
90 | 86 |
91 runTest(); | 87 runTest(); |
92 | 88 |
93 </script> | 89 </script> |
94 | 90 |
95 </body> | 91 </body> |
96 </html> | 92 </html> |
OLD | NEW |