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

Side by Side 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 <!doctype html>
2 <html>
3 <head>
4 <title>Test Constructor: MediaStreamAudioSource</title>
5 <script src="../../resources/testharness.js"></script>
6 <script src="../../resources/testharnessreport.js"></script>
7 <script src="../resources/audio-testing.js"></script>
8 </head>
9
10 <body>
11 <script>
12 var context = new AudioContext();
13
14 var audit = Audit.createTaskRunner();
15
16 audit.defineTask("invalid constructor", function (taskDone) {
17 var node;
18 var success = true;
19
20 success = Should("new MediaStreamAudioSourceNode()", function () {
21 node = new MediaStreamAudioSourceNode();
22 }).throw("TypeError");
23 success = Should("new MediaStreamAudioSourceNode(1)", function () {
24 node = new MediaStreamAudioSourceNode(1) && success;
25 }).throw("TypeError");
26 success = Should("new MediaStreamAudioSourceNode(context, 42)",
27 function () {
28 node = new MediaStreamAudioSourceNode(context, 42) && success;
29 }).throw("TypeError");
30
31 Should("Invalid constructors", success)
32 .summarize(
33 "correctly threw errors",
34 "did not throw errors in all cases");
35
36 taskDone();
37 });
38
39 audit.defineTask("constructor options", function (taskDone) {
40 var node;
41 var success = true;
42
43 var options = {
44 mediaStream: new MediaStream()
45 };
46
47 // We throw because the mediaStream has no tracks. But otherwise the
48 // constructor worked.
49 success = Should("node = new MediaStreamAudioSourceNode(, " + JSON.strin gify(
50 options) + ")",
51 function () {
52 node = new MediaStreamAudioSourceNode(context, options);
53 }).throw("InvalidStateError") && success;
54
55 Should("new MediaStreamAudioSourceNode(c, options)", success)
56 .summarize(
57 "constructed with correct attributes",
58 "was not constructed correctly");
59
60 taskDone();
61 });
62
63 audit.runTasks();
64 </script>
65 </body>
66 </html>
OLDNEW
« 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