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

Unified Diff: third_party/WebKit/LayoutTests/webaudio/scriptprocessor-offlineaudiocontext.html

Issue 2581463002: Refactor WebAudio test directory (Closed)
Patch Set: Use correct path for wav result files Created 4 years 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/scriptprocessor-offlineaudiocontext.html
diff --git a/third_party/WebKit/LayoutTests/webaudio/scriptprocessor-offlineaudiocontext.html b/third_party/WebKit/LayoutTests/webaudio/scriptprocessor-offlineaudiocontext.html
deleted file mode 100644
index 8b0b2308325e33161d228a77c02bbedfec545f46..0000000000000000000000000000000000000000
--- a/third_party/WebKit/LayoutTests/webaudio/scriptprocessor-offlineaudiocontext.html
+++ /dev/null
@@ -1,95 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
- <title>ScriptProcessorNode on OfflineAudioContext</title>
- <script src="../resources/testharness.js"></script>
- <script src="../resources/testharnessreport.js"></script>
- <script src="resources/audit-util.js"></script>
- <script src="resources/audio-testing.js"></script>
-</head>
-<body>
- <script>
- var audit = Audit.createTaskRunner();
-
-
- // Fill the output of script processor with a constant value.
- audit.defineTask('simple-output', function (taskDone) {
- var sampleRate = 44100;
- var scriptBufferSize = 256;
- var renderLength = 1;
- var PI = Math.fround(Math.PI);
-
- var context = new OfflineAudioContext(
- 1, renderLength * sampleRate, sampleRate);
-
- var scriptNode = context.createScriptProcessor(scriptBufferSize, 1, 1);
- scriptNode.onaudioprocess = function (event) {
- var outputChannel = event.outputBuffer.getChannelData(0);
- outputChannel.fill(PI);
- };
- scriptNode.connect(context.destination);
-
- context.startRendering().then(function (buffer) {
- var channel = buffer.getChannelData(0);
- var initialDelay = channel.subarray(0, 2 * scriptBufferSize);
- var actualContent = channel.subarray(2 * scriptBufferSize);
-
- // There is the initial delay (2 x buffer size) which is silent.
- Should('The initial delay contains zeros.', initialDelay)
- .beConstantValueOf(0);
-
- // After the initial delay, we must get |PI|.
- Should('The actual content contains ' + PI, actualContent)
- .beConstantValueOf(PI);
-
- taskDone();
- });
- });
-
-
- // Pass through an oscillator via a script processor. Sum with the
- // phase-inverted oscillator with the delayed start time. Verify the
- // rendered buffer is completely silent.
- audit.defineTask('oscillator-output', function (taskDone) {
- var sampleRate = 44100;
- var scriptBufferSize = 256;
- var renderLength = 1;
-
- var context = new OfflineAudioContext(
- 1, renderLength * sampleRate, sampleRate);
-
- var osc1 = context.createOscillator();
- var osc2 = context.createOscillator();
- var inverter = context.createGain();
- var scriptNode = context.createScriptProcessor(scriptBufferSize, 1, 1);
- scriptNode.onaudioprocess = function (event) {
- var inputChannel = event.inputBuffer.getChannelData(0);
- var outputChannel = event.outputBuffer.getChannelData(0);
- outputChannel.set(inputChannel);
- };
-
- inverter.gain.value = -1;
-
- osc1.connect(inverter).connect(context.destination);
- osc2.connect(scriptNode).connect(context.destination);
-
- // The delayed start for |osc1|.
- osc1.start((2 * scriptBufferSize) / sampleRate);
- osc2.start();
-
- context.startRendering().then(function (buffer) {
- var channel = buffer.getChannelData(0);
-
- // The rendered buffer must be silent.
- Should('The rendered buffer', channel)
- .beConstantValueOf(0);
-
- taskDone();
- });
- });
-
-
- audit.runTasks();
- </script>
-</body>
-</html>

Powered by Google App Engine
This is Rietveld 408576698