Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / webaudio / mediaelementaudiosourcenode.html
blob37f82ba63935de8f1d72e079a93de6af0d5f8526
1 <!DOCTYPE html>
3 <html>
4 <head>
5 <script src="../resources/js-test.js"></script>
6 <script src="resources/compatibility.js"></script>
7 <script src="resources/audio-testing.js"></script>
8 </head>
10 <body>
11 <div id="description"></div>
12 <div id="console"></div>
14 <script>
15 description("Basic tests for MediaElementAudioSourceNode API.");
17 var context = 0;
18 var audioElement = 0;
19 var audioNode = 0;
21 function runTest() {
22 window.jsTestIsAsync = true;
24 context = new AudioContext();
26 audioElement = new Audio();
27 mediaSource = context.createMediaElementSource(audioElement);
28 audioNode = mediaSource;
30 // Check number of inputs and outputs.
31 shouldBeEqualToNumber("audioNode.numberOfInputs", 0);
32 shouldBeEqualToNumber("audioNode.numberOfOutputs", 1);
34 // Try calling connect() method with illegal values: illegal destination, illegal output index,
35 // and illegal input index.
36 shouldThrow("audioNode.connect(0, 0, 0)");
37 shouldThrow("audioNode.connect(context.destination, 5, 0)");
38 shouldThrow("audioNode.connect(context.destination, 0, 5)");
40 // Try calling connect() with proper values.
41 shouldNotThrow("audioNode.connect(context.destination, 0, 0)");
43 // Try creating another MediaElementAudioSourceNode using the same audio element.
44 shouldThrow("context.createMediaElementSource(audioElement)");
46 finishJSTest();
49 runTest();
51 </script>
53 </body>
54 </html>