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

Unified Diff: third_party/WebKit/LayoutTests/webaudio/constructor/mediastreamaudiosource.html

Issue 2431653003: Add constructor for MediaStreamAudioSourceNode (Closed)
Patch Set: Created 4 years, 2 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/modules/modules_idl_files.gni » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/webaudio/constructor/mediastreamaudiosource.html
diff --git a/third_party/WebKit/LayoutTests/webaudio/constructor/mediastreamaudiosource.html b/third_party/WebKit/LayoutTests/webaudio/constructor/mediastreamaudiosource.html
new file mode 100644
index 0000000000000000000000000000000000000000..e6749017b5d6816cf42cabc95dc9b0aef52102be
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/webaudio/constructor/mediastreamaudiosource.html
@@ -0,0 +1,66 @@
+<!doctype html>
+<html>
+ <head>
+ <title>Test Constructor: MediaStreamAudioSource</title>
+ <script src="../../resources/testharness.js"></script>
+ <script src="../../resources/testharnessreport.js"></script>
+ <script src="../resources/audio-testing.js"></script>
+ </head>
+
+ <body>
+ <script>
+ var context = new AudioContext();
+
+ var audit = Audit.createTaskRunner();
+
+ audit.defineTask("invalid constructor", function (taskDone) {
+ var node;
+ var success = true;
+
+ success = Should("new MediaStreamAudioSourceNode()", function () {
+ node = new MediaStreamAudioSourceNode();
+ }).throw("TypeError");
+ success = Should("new MediaStreamAudioSourceNode(1)", function () {
+ node = new MediaStreamAudioSourceNode(1) && success;
+ }).throw("TypeError");
+ success = Should("new MediaStreamAudioSourceNode(context, 42)",
+ function () {
+ node = new MediaStreamAudioSourceNode(context, 42) && success;
+ }).throw("TypeError");
+
+ Should("Invalid constructors", success)
+ .summarize(
+ "correctly threw errors",
+ "did not throw errors in all cases");
+
+ taskDone();
+ });
+
+ audit.defineTask("constructor options", function (taskDone) {
+ var node;
+ var success = true;
+
+ var options = {
+ mediaStream: new MediaStream()
+ };
+
+ // We throw because the mediaStream has no tracks. But otherwise the
+ // constructor worked.
+ success = Should("node = new MediaStreamAudioSourceNode(, " + JSON.stringify(
+ options) + ")",
+ function () {
+ node = new MediaStreamAudioSourceNode(context, options);
+ }).throw("InvalidStateError") && success;
+
+ Should("new MediaStreamAudioSourceNode(c, options)", success)
+ .summarize(
+ "constructed with correct attributes",
+ "was not constructed correctly");
+
+ taskDone();
+ });
+
+ audit.runTasks();
+ </script>
+ </body>
+</html>
« no previous file with comments | « no previous file | third_party/WebKit/Source/modules/modules_idl_files.gni » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698