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

Side by Side Diff: third_party/WebKit/LayoutTests/webaudio/channel-mode-interp-basic.html

Issue 2282483002: Return the correct channelCountMode and channelInterpretation (Closed)
Patch Set: Define setters for the mode and interpretation Created 4 years, 3 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/webaudio/AudioNode.h » ('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 Setting of channelCountMode and channelInterpretation</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 // Fairly arbitrary sample rate and number of frames, except the number of
13 // frames should be more than a few render quantums.
14 var sampleRate = 16000;
15 var renderFrames = 10 * 128;
16
17 var audit = Audit.createTaskRunner();
18
19 audit.defineTask("interp", function (taskDone) {
20 var context = new OfflineAudioContext(1, renderFrames, sampleRate);
21 var node = context.createGain();
22
23 // Set a new interpretation and verify that it changed.
24 node.channelInterpretation = "discrete";
25 var value = node.channelInterpretation;
26 Should("node.channelInterpretation", value).beEqualTo("discrete");
27 node.connect(context.destination);
28
29 context.startRendering().then(function (buffer) {
30 // After rendering, the value should have been changed.
31 Should("After rendering node.channelInterpretation",
32 node.channelInterpretation)
33 .beEqualTo("discrete");
34 }).then(taskDone);
35 });
36
37 audit.defineTask("mode", function (taskDone) {
38 var context = new OfflineAudioContext(1, renderFrames, sampleRate);
39 var node = context.createGain();
40
41 // Set a new mode and verify that it changed.
42 node.channelCountMode = "explicit";
43 var value = node.channelCountMode;
44 Should("node.channelCountMode", value).beEqualTo("explicit");
45 node.connect(context.destination);
46
47 context.startRendering().then(function (buffer) {
48 // After rendering, the value should have been changed.
49 Should("After rendering node.channelCountMode",
50 node.channelCountMode)
51 .beEqualTo("explicit");
52 }).then(taskDone);
53 });
54 audit.runTasks();
55 </script>
56 </body>
57 </html>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/modules/webaudio/AudioNode.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698