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

Unified Diff: third_party/WebKit/LayoutTests/webaudio/codec-tests/webm/webm-decode.html

Issue 2727663003: Move task.describe to audit.define arg (Closed)
Patch Set: Fix up expected results Created 3 years, 9 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/codec-tests/webm/webm-decode.html
diff --git a/third_party/WebKit/LayoutTests/webaudio/codec-tests/webm/webm-decode.html b/third_party/WebKit/LayoutTests/webaudio/codec-tests/webm/webm-decode.html
index d059b435cc396e94703c7ae7e2e9adefbb14eb61..17e21677ee70b17ad7b486df17511f5e7038c2d8 100644
--- a/third_party/WebKit/LayoutTests/webaudio/codec-tests/webm/webm-decode.html
+++ b/third_party/WebKit/LayoutTests/webaudio/codec-tests/webm/webm-decode.html
@@ -16,46 +16,47 @@
let decodedAudio;
let expectedAudio;
- audit.define('test', function(task, should) {
- task.describe('Test webm decoding');
+ audit.define(
+ {label: 'test', description: 'Test webm decoding'},
+ function(task, should) {
- let context = new AudioContext();
+ let context = new AudioContext();
- let bufferLoader = new BufferLoader(
- context, ['webm-decode-expected.wav', 'test-webm.webm'],
- function(bufferList) {
- expectedAudio = bufferList[0];
- decodedAudio = bufferList[1];
+ let bufferLoader = new BufferLoader(
+ context, ['webm-decode-expected.wav', 'test-webm.webm'],
+ function(bufferList) {
+ expectedAudio = bufferList[0];
+ decodedAudio = bufferList[1];
- // Verify that we have the right number of channels and frames.
- should(decodedAudio.numberOfChannels, 'Number of channels')
- .beEqualTo(expectedAudio.numberOfChannels);
- should(decodedAudio.length, 'Decoded number of frames')
- .beEqualTo(expectedAudio.length);
+ // Verify that we have the right number of channels and
+ // frames.
+ should(decodedAudio.numberOfChannels, 'Number of channels')
+ .beEqualTo(expectedAudio.numberOfChannels);
+ should(decodedAudio.length, 'Decoded number of frames')
+ .beEqualTo(expectedAudio.length);
- // Verify that the actual data matches the expected data very
- // closely.
- for (let c = 0; c < expectedAudio.numberOfChannels; ++c) {
- let snrdB = 10 *
- Math.log10(computeSNR(
- decodedAudio.getChannelData(c),
- expectedAudio.getChannelData(c)));
- should(snrdB, 'SNR between actual expected channel ' + c)
- .beGreaterThanOrEqualTo(109.56);
- should(decodedAudio.getChannelData(c), 'Decoded channel ' + c)
- .beCloseToArray(
- expectedAudio.getChannelData(c),
- {absoluteThreshold: 4.0234e-5});
- }
+ // Verify that the actual data matches the expected data very
+ // closely.
+ for (let c = 0; c < expectedAudio.numberOfChannels; ++c) {
+ let snrdB = 10 *
+ Math.log10(computeSNR(
+ decodedAudio.getChannelData(c),
+ expectedAudio.getChannelData(c)));
+ should(snrdB, 'SNR between actual expected channel ' + c)
+ .beGreaterThanOrEqualTo(109.56);
+ should(decodedAudio.getChannelData(c), 'Decoded channel ' + c)
+ .beCloseToArray(
+ expectedAudio.getChannelData(c),
+ {absoluteThreshold: 4.0234e-5});
+ }
+ var filename = 'webm-decode-actual.wav';
+ if (downloadAudioBuffer(decodedAudio, filename))
+ should(true, 'Saved reference file').message(filename, '');
+ task.done();
+ });
- var filename = 'webm-decode-actual.wav';
- if (downloadAudioBuffer(decodedAudio, filename))
- should(true, "Saved reference file").message(filename, "");
- task.done();
- });
-
- bufferLoader.load();
- });
+ bufferLoader.load();
+ });
audit.run();
</script>

Powered by Google App Engine
This is Rietveld 408576698