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

Unified 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, 4 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/webaudio/AudioNode.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/webaudio/channel-mode-interp-basic.html
diff --git a/third_party/WebKit/LayoutTests/webaudio/channel-mode-interp-basic.html b/third_party/WebKit/LayoutTests/webaudio/channel-mode-interp-basic.html
new file mode 100644
index 0000000000000000000000000000000000000000..a24ac7ffb014940bb4b63a178c83a9c5bb77cd66
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/webaudio/channel-mode-interp-basic.html
@@ -0,0 +1,57 @@
+<!doctype html>
+<html>
+ <head>
+ <title>Test Setting of channelCountMode and channelInterpretation</title>
+ <script src="../resources/testharness.js"></script>
+ <script src="../resources/testharnessreport.js"></script>
+ <script src="resources/audio-testing.js"></script>
+ </head>
+
+ <body>
+ <script>
+ // Fairly arbitrary sample rate and number of frames, except the number of
+ // frames should be more than a few render quantums.
+ var sampleRate = 16000;
+ var renderFrames = 10 * 128;
+
+ var audit = Audit.createTaskRunner();
+
+ audit.defineTask("interp", function (taskDone) {
+ var context = new OfflineAudioContext(1, renderFrames, sampleRate);
+ var node = context.createGain();
+
+ // Set a new interpretation and verify that it changed.
+ node.channelInterpretation = "discrete";
+ var value = node.channelInterpretation;
+ Should("node.channelInterpretation", value).beEqualTo("discrete");
+ node.connect(context.destination);
+
+ context.startRendering().then(function (buffer) {
+ // After rendering, the value should have been changed.
+ Should("After rendering node.channelInterpretation",
+ node.channelInterpretation)
+ .beEqualTo("discrete");
+ }).then(taskDone);
+ });
+
+ audit.defineTask("mode", function (taskDone) {
+ var context = new OfflineAudioContext(1, renderFrames, sampleRate);
+ var node = context.createGain();
+
+ // Set a new mode and verify that it changed.
+ node.channelCountMode = "explicit";
+ var value = node.channelCountMode;
+ Should("node.channelCountMode", value).beEqualTo("explicit");
+ node.connect(context.destination);
+
+ context.startRendering().then(function (buffer) {
+ // After rendering, the value should have been changed.
+ Should("After rendering node.channelCountMode",
+ node.channelCountMode)
+ .beEqualTo("explicit");
+ }).then(taskDone);
+ });
+ audit.runTasks();
+ </script>
+ </body>
+</html>
« 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