Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1)

Unified Diff: third_party/WebKit/LayoutTests/webaudio/audio-scheduled-source-basic.html

Issue 2471353004: Implement AudioScheduledSourceNode (Closed)
Patch Set: Rebaseline test Created 3 years, 12 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..5fa8268bfc17d5c5f9acb163f27dcacd13d808b0
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/webaudio/audio-scheduled-source-basic.html
@@ -0,0 +1,69 @@
+<!doctype html>
+<html>
+ <head>
+ <title>Test AudioScheduledSourceNode</title>
+ <script src="../resources/testharness.js"></script>
+ <script src="../resources/testharnessreport.js"></script>
+ <script src="resources/audit.js"></script>
+ </head>
+
+ <body>
+ <script>
+ var context = new AudioContext();
+
+ var audit = Audit.createTaskRunner();
+
+ audit.define("construction", function (task, should) {
+ task.describe("Construct AudioScheduledSourceNode");
+ should(function () {
+ return new AudioScheduledSourceNode(context);
+ }, "new AudioScheduledSourceNode(c)").throw("TypeError");
+
+ task.done();
+ });
+
+ audit.define("properties", function (task, should) {
+ task.describe("Test properties on derived nodes");
+ var expectedProperties = ["start", "stop", "onended"];
+
+ // AudioScheduledSourceNode must have these properties.
+ for (p in expectedProperties) {
+ should(AudioScheduledSourceNode.prototype.hasOwnProperty(
+ expectedProperties[p]),
+ "AudioScheduledSourceNode." + expectedProperties[p])
+ .beTrue();
+ }
+
+ // ConstantSource and Oscillator must not
+ var nodes = ["ConstantSourceNode", "OscillatorNode"];
+ for (n in nodes) {
+ for (p in expectedProperties) {
+ should(window[nodes[n]].prototype.hasOwnProperty(
+ expectedProperties[p]),
+ nodes[n] + "." + expectedProperties[p])
+ .beFalse();
+ }
+ }
+
+ // AudioBufferSourceNode has it's own start method, but should not have
+ // the others.
+ for (p in expectedProperties) {
+ if (expectedProperties[p] !== "start") {
+ should(AudioBufferSourceNode.prototype.hasOwnProperty(
+ expectedProperties[p]),
+ "AudioBufferSourceNode." + expectedProperties[p])
+ .beFalse();
+ }
+ }
+
+ should(AudioBufferSourceNode.prototype.hasOwnProperty("start"),
+ "AudioBufferSourceNode.start")
+ .beTrue();
+
+ task.done();
+ });
+
+ audit.run();
+ </script>
+ </body>
+</html>

Powered by Google App Engine
This is Rietveld 408576698