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

Unified Diff: third_party/WebKit/LayoutTests/webaudio/audiochannelmerger-cycle.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/audiochannelmerger-cycle.html
diff --git a/third_party/WebKit/LayoutTests/webaudio/audiochannelmerger-cycle.html b/third_party/WebKit/LayoutTests/webaudio/audiochannelmerger-cycle.html
deleted file mode 100644
index 144c871bc2070cca233e70748cf36b81dbdd1549..0000000000000000000000000000000000000000
--- a/third_party/WebKit/LayoutTests/webaudio/audiochannelmerger-cycle.html
+++ /dev/null
@@ -1,114 +0,0 @@
-<!DOCTYPE html>
-<html>
-
-<head>
- <script src="../resources/js-test.js"></script>
- <script src="resources/compatibility.js"></script>
- <script src="resources/audit-util.js"></script>
- <script src="resources/audio-testing.js"></script>
-</head>
-
-<body>
- <script>
- description("Test if ChannelMergerNode runs correctly in a cycle.");
- window.jsTestIsAsync = true;
-
- // This specific sample rate is chosen to avoid the round/truncation error
- // in delay time. See: crbug.com/448801
- var sampleRate = 32768;
-
- // Web Audio API's rendering quantum.
- var renderingQuantum = 128;
-
- // 4x of rendering quantum. This is to make the rendered result long enough
- // so that we can observe the delayed output.
- var renderLength = renderingQuantum * 4;
-
- // 1x rendering quantum of delay.
- var delayTime = renderingQuantum / sampleRate;
-
- // Use 2 channels as a test case.
- var numberOfChannels = 2;
-
- var audit = Audit.createTaskRunner();
-
- audit.defineTask('merger-cyclic-graph', function (done) {
-
- var context = new OfflineAudioContext(
- numberOfChannels, renderLength, sampleRate
- );
- var merger = context.createChannelMerger(2);
- var delay = context.createDelay();
- var source = context.createBufferSource();
-
- // Create a mono source buffer filled with '1'.
- source.buffer = createConstantBuffer(context, renderLength, [1]);
-
- delay.delayTime.value = delayTime;
-
- // Connect the source to input 0 of the merger. Connect the output of
- // the merger to a delay node whose output is then connected to input 1
- // of the merger. See: crbug.com/442925
- source.connect(merger, 0, 0);
- delay.connect(merger, 0, 1);
- merger.connect(delay);
- merger.connect(context.destination);
- source.start();
-
- context.startRendering().then(function (buffer) {
- // Expected output values: the output of delay node will be a stereo
- // signal of [1, 0]. When it feeds back to the 2nd input of merger node,
- // the stereo channel will be summed to mono resulting in 0.5.
- var expected_left = [];
- var expected_right = [];
-
- for (var i = 0; i < renderLength; i++) {
- // Note that the delayed channel will be zero for the first 128 samples
- // due to the cyclic audio graph, the second 128 sample will be also
- // zero because of 128 samples delay.
- expected_left[i] = 1.0;
- expected_right[i] = (i < renderingQuantum * 2) ? 0.0 : 0.5;
- }
-
- for (i = 0; i < buffer.numberOfChannels; i++) {
- var actual_left = buffer.getChannelData(0);
- var actual_right = buffer.getChannelData(1);
- for (var j = 0; j < renderLength; j++) {
- if (expected_left[j] !== actual_left[j]) {
- testFailed('The value ' + actual_left[j] +
- 'in the left channel did not match the expected value ' +
- expected_left[j] + ' at the index ' + j + '.');
- done();
- return;
- }
- if (expected_right[j] !== actual_right[j]) {
- testFailed('The value ' + actual_left[j] +
- 'in the right channel did not match the expected value ' +
- expected_left[j] + ' at the index ' + j + '.');
- done();
- return;
- }
- }
- }
-
- testPassed("ChannerMergerNode passed cyclic audio graph test.");
- done();
- });
-
- });
-
- audit.defineTask('finish', function (done) {
- finishJSTest();
- done();
- });
-
- audit.runTasks(
- 'merger-cyclic-graph',
- 'finish'
- );
-
- successfullyParsed = true;
- </script>
-</body>
-
-</html>

Powered by Google App Engine
This is Rietveld 408576698