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

Unified Diff: third_party/WebKit/LayoutTests/webaudio/offlineaudiodestination.html

Issue 2092033003: Add OfflineAudioDestinationNode (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/LayoutTests/webaudio/offlineaudiodestination.html
diff --git a/third_party/WebKit/LayoutTests/webaudio/offlineaudiodestination.html b/third_party/WebKit/LayoutTests/webaudio/offlineaudiodestination.html
new file mode 100644
index 0000000000000000000000000000000000000000..71e8315bfee9345cfe699106e25286be17fbba9f
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/webaudio/offlineaudiodestination.html
@@ -0,0 +1,62 @@
+<!doctype html>
+<html>
+ <head>
+ <title>Test OfflineAudioDestination</title>
+ <script src="../resources/testharness.js"></script>
+ <script src="../resources/testharnessreport.js"></script>
+ <script src="resources/audio-testing.js"></script>
+ <title>Test Automation of Biquad Filters</title>
+ </head>
+ <script>
+ // Don't need to run these tests at high sampling rate, so just use a low
+ // one to reduce memory usage and complexity.
+ var sampleRate = 16000;
+
+ var audit = Audit.createTaskRunner();
+
+ audit.defineTask("test", function (done) {
+ // Create offline context with 7 channels. The number of channels is
+ // arbitrary here.
+ var context = new OfflineAudioContext(7, 1, sampleRate);
+
+ var dest = context.destination;
+
+ // Verify we have the correct values.
+ Should("dest.channelCount", dest.channelCount).beEqualTo(7);
+ Should("dest.maxChannelCount", dest.maxChannelCount).beEqualTo(dest.channelCount);
+ Should("dest.channelCountMode", dest.channelCountMode).beEqualTo("explicit");
+
+
+ // Verify that we can't change the channel count and channel mode
+ Should("dest.channelCount = 7", function () {
+ dest.channelCount = 7;
+ }).notThrow();
+
+ Should("dest.channelCount = 3", function () {
+ dest.channelCount = 3;
+ }).throw("NotSupportedError");
+
+ Should('dest.channelCountMode = "explicit"', function () {
+ dest.channelCountMode = "explicit";
+ }).notThrow();
+
+ Should('dest.channelCountMode = "max"', function () {
+ dest.channelCountMode = "max";
+ }).throw("NotSupportedError");
+
+ Should('dest.channelCountMode = "clamped-max"', function () {
+ dest.channelCountMode = "clamped-max";
+ }).throw("NotSupportedError");
+
+ // Verify that we can't change maxChannelCount.
+ dest.maxChannelCount = 14;
+ Should("dest.maxChannelCount = 14", dest.maxChannelCount)
+ .beEqualTo(dest.channelCount);
+ done();
+ });
+
+ audit.runTasks();
+ </script>
+ <body>
+ </body>
+</html>

Powered by Google App Engine
This is Rietveld 408576698