OLD | NEW |
---|---|
(Empty) | |
1 <!doctype html> | |
2 <html> | |
3 <head> | |
4 <title>Test Constructor: MediaStreamAudioDestinationNode</title> | |
5 <script src="../../resources/testharness.js"></script> | |
6 <script src="../../resources/testharnessreport.js"></script> | |
7 <script src="../resources/audit-util.js"></script> | |
8 <script src="../resources/audio-testing.js"></script> | |
hongchan
2016/12/19 18:29:55
Why do we need this?
Raymond Toy
2016/12/19 18:33:38
You mean instead of audit.js?
audionodeoptions.js
hongchan
2016/12/19 23:40:37
Acknowledged.
| |
9 <script src="audionodeoptions.js"></script> | |
10 </head> | |
11 | |
12 <body> | |
13 <script> | |
14 var context = new AudioContext(); | |
15 | |
16 var audit = Audit.createTaskRunner(); | |
17 | |
18 audit.defineTask("invalid constructor", function (taskDone) { | |
19 var node; | |
20 var success = true; | |
21 | |
22 success = Should("new MediaStreamAudioDestinationNode()", | |
23 function () { | |
24 node = new MediaStreamAudioDestinationNode(); | |
25 }) | |
26 .throw("TypeError"); | |
27 success = Should("new MediaStreamAudioDestinationNode(1)", | |
28 function () { | |
29 node = new MediaStreamAudioDestinationNode(1) | |
30 }) | |
31 .throw("TypeError") && success;; | |
32 success = Should("new MediaStreamAudioDestinationNode(context, 42)", | |
33 function () { | |
34 node = new MediaStreamAudioDestinationNode(context, 42) | |
35 }) | |
36 .throw("TypeError") && success;; | |
37 | |
38 taskDone(); | |
39 }); | |
40 | |
41 audit.defineTask("default constructor", function (taskDone) { | |
42 var node; | |
43 var success; | |
44 | |
45 success = Should("new MediaStreamAudioDestinationNode(context)", | |
46 function () { | |
47 node = new MediaStreamAudioDestinationNode(context); | |
48 }).notThrow() && success; | |
49 | |
50 success = Should("node instanceof MediaStreamAudioDestinationNode", | |
51 node instanceof MediaStreamAudioDestinationNode) | |
52 .beEqualTo(true) && success; | |
53 success = Should("node.channelCount", node.channelCount) | |
54 .beEqualTo(2) && success; | |
55 | |
56 taskDone(); | |
57 }); | |
58 | |
59 audit.defineTask("test AudioNodeOptions", function (taskDone) { | |
60 testAudioNodeOptions(context, "MediaStreamAudioDestinationNode", { | |
61 expectedChannelCount: { | |
62 // An arbitrary but valid, non-default count for this node. | |
63 value: 7 | |
64 } | |
65 }); | |
66 taskDone(); | |
67 }); | |
68 | |
69 audit.runTasks(); | |
70 </script> | |
71 </body> | |
72 </html> | |
OLD | NEW |