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

Unified Diff: third_party/WebKit/LayoutTests/webaudio/AudioBufferSource/audiobuffersource-detune-modulation.html

Issue 2728613003: Add support creating and saving a new reference file. (Closed)
Patch Set: Fix typo Created 3 years, 10 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/LayoutTests/webaudio/AudioBufferSource/audiobuffersource-playbackrate-modulation.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/webaudio/AudioBufferSource/audiobuffersource-detune-modulation.html
diff --git a/third_party/WebKit/LayoutTests/webaudio/AudioBufferSource/audiobuffersource-detune-modulation.html b/third_party/WebKit/LayoutTests/webaudio/AudioBufferSource/audiobuffersource-detune-modulation.html
index 40eaf6dac3f6368b7ee292ec60f4f3a84493acd8..afc7570ec7cae3457104d9c98b04cff31eaa88f1 100644
--- a/third_party/WebKit/LayoutTests/webaudio/AudioBufferSource/audiobuffersource-detune-modulation.html
+++ b/third_party/WebKit/LayoutTests/webaudio/AudioBufferSource/audiobuffersource-detune-modulation.html
@@ -12,12 +12,12 @@
<body>
<script>
-
var sampleRate = 44100;
var duration = 0.25;
var context = new OfflineAudioContext(1, sampleRate * duration, sampleRate);
var referenceBuffer;
+ var audioBufferResult;
var audit = Audit.createTaskRunner();
@@ -44,6 +44,7 @@
createSawtoothWithModulation(context, 'detune', 440, 1200);
context.startRendering().then(function (renderedBuffer) {
+ audioBufferResult = renderedBuffer;
var actual = renderedBuffer.getChannelData(0);
var expected = referenceBuffer.getChannelData(0);
@@ -53,51 +54,15 @@
thresholdSNR: 93.31,
thresholdDiffULP: 1.01,
thresholdDiffCount: 0,
- bitDepth: 16
- });
+ bitDepth: 16});
+ var filename = 'audiobuffersource-detune-modulation-actual.wav';
+ if (downloadAudioBuffer(renderedBuffer, filename))
+ Should("Saved reference file", true).summarize(filename, "");
}).then(done);
});
- // Task: Create a new reference audio file. See .runTasks() below to run
- // this task.
- audit.defineTask('generate-reference', function (done) {
- if (!window.testRunner) {
- done();
- return;
- }
-
- // With this setting, the detune will be changing continuously and
- // repeatedly within the range of [-1200, 1200] around 440Hz, based on the
- // input from the oscillator.
- createSawtoothWithModulation(context, 'detune', 440, 1200);
-
- // |finishAudioTest| will automatically create a reference audio file from
- // the OAC rendering if the reference file does not exist.
- context.oncomplete = finishAudioTest;
- context.startRendering();
- testRunner.waitUntilDone();
-
- done();
- });
-
- audit.defineTask('finish', function (done) {
- done();
- });
-
- window.onload = function () {
- audit.runTasks(
- 'load-reference',
- 'generate-verify',
- 'finish'
- );
- };
-
- // Use this task to generate a new reference audio file. Make sure to
- // comment out .runTasks() above before use this.
- // audit.runTasks('generate-reference');
-
- successfullyParsed = true;
+ audit.runTasks();
</script>
</body>
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/webaudio/AudioBufferSource/audiobuffersource-playbackrate-modulation.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698