Chromium Code Reviews| Index: third_party/WebKit/LayoutTests/webaudio/audio-scheduled-source-basic.html |
| diff --git a/third_party/WebKit/LayoutTests/webaudio/audio-scheduled-source-basic.html b/third_party/WebKit/LayoutTests/webaudio/audio-scheduled-source-basic.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..3f12f68308a385d445edc1fd76e2871c2e7fb2f0 |
| --- /dev/null |
| +++ b/third_party/WebKit/LayoutTests/webaudio/audio-scheduled-source-basic.html |
| @@ -0,0 +1,75 @@ |
| +<!doctype html> |
| +<html> |
| + <head> |
| + <title>Test AudioScheduledSourceNode</title> |
| + <script src="../resources/testharness.js"></script> |
| + <script src="../resources/testharnessreport.js"></script> |
| + <script src="resources/audio-testing.js"></script> |
|
hongchan
2016/12/01 00:11:22
I know this might be too late - but can I ask you
Raymond Toy
2016/12/01 00:13:36
Maybe. The test file is short enough to be conver
Raymond Toy
2016/12/01 18:48:32
Done.
|
| + </head> |
| + |
| + <body> |
| + <script> |
| + var context = new AudioContext(); |
| + |
| + var audit = Audit.createTaskRunner(); |
| + |
| + audit.defineTask("construction", function (taskDone) { |
| + var success = true; |
| + |
| + success = Should("new AudioScheduledSourceNode(c)", function () { |
| + return new AudioScheduledSourceNode(context); |
| + }).throw("TypeError") && success; |
| + |
| + taskDone(); |
| + }); |
| + |
| + audit.defineTask("properties", function (taskDone) { |
| + var success = true; |
| + var expectedProperties = ["start", "stop", "onended"]; |
| + |
| + // AudioScheduledSourceNode must have these properties. |
| + for (p in expectedProperties) { |
| + success = Should("AudioScheduledSourceNode." + expectedProperties[ |
| + p], |
| + AudioScheduledSourceNode.prototype.hasOwnProperty( |
| + expectedProperties[p])) |
| + .beEqualTo(true) && success; |
| + } |
| + |
| + // ConstantSource and Oscillator must not |
| + var nodes = ["ConstantSourceNode", "OscillatorNode"]; |
| + for (n in nodes) { |
| + for (p in expectedProperties) { |
| + success = Should(nodes[n] + "." + expectedProperties[p], |
| + window[nodes[n]].prototype.hasOwnProperty( |
| + expectedProperties[p])) |
| + .beEqualTo(false) && success; |
| + } |
| + } |
| + |
| + // AudioBufferSourceNode has it's own start method, but should not have |
| + // the others. |
| + for (p in expectedProperties) { |
| + if (expectedProperties[p] !== "start") { |
| + success = Should("AudioBufferSourceNode." + expectedProperties[ |
| + p], |
| + AudioBufferSourceNode.prototype.hasOwnProperty( |
| + expectedProperties[p])) |
| + .beEqualTo(false) && success; |
| + } |
| + } |
| + |
| + success = Should("AudioBufferSourceNode.start", |
| + AudioBufferSourceNode.prototype.hasOwnProperty("start")) |
| + .beEqualTo(true) && success; |
| + |
| + Should("Properties were defined", success) |
| + .summarize("correctly", "incorrectly"); |
| + |
| + taskDone(); |
| + }); |
| + |
| + audit.runTasks(); |
| + </script> |
| + </body> |
| +</html> |