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

Unified Diff: third_party/WebKit/LayoutTests/webaudio/AudioBufferSource/audiobuffersource-playbackrate-modulated-impulse.html

Issue 2783553002: Convert AudioBufferSource tests to new Audit (Closed)
Patch Set: Indent neatly. Created 3 years, 8 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/AudioBufferSource/audiobuffersource-playbackrate-modulated-impulse.html
diff --git a/third_party/WebKit/LayoutTests/webaudio/AudioBufferSource/audiobuffersource-playbackrate-modulated-impulse.html b/third_party/WebKit/LayoutTests/webaudio/AudioBufferSource/audiobuffersource-playbackrate-modulated-impulse.html
index 2b1dfb212ea15504febbc32fd3787bf72d591dd7..632addb74d1635f0b080dd2fa7b7b90c2f9580df 100644
--- a/third_party/WebKit/LayoutTests/webaudio/AudioBufferSource/audiobuffersource-playbackrate-modulated-impulse.html
+++ b/third_party/WebKit/LayoutTests/webaudio/AudioBufferSource/audiobuffersource-playbackrate-modulated-impulse.html
@@ -5,7 +5,7 @@
<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>
+ <script src="../resources/audit.js"></script>
</head>
<body>
@@ -30,28 +30,31 @@
// Task: build an impulse and DC-offset buffers for testing.
- audit.defineTask('build-buffers', function (done) {
- // 4-sample impulse sample.
- impulseBuffer = createImpulseBuffer(context, impulseLength);
-
- // Create a DC offset buffer with 2 values [0, 1] for modulating
- // playbackRate. The first half of buffer is 0 and the rest is 1.
- dcOffsetBuffer = context.createBuffer(1, renderLength, sampleRate);
- var dcOffsetArray = dcOffsetBuffer.getChannelData(0);
- for (i = 0; i < dcOffsetArray.length; i++) {
-
- // Note that these values will be added to the playbackRate AudioParam
- // value. For example, 0 DC offset value will result playbackRate of 1
- // because the default playbackRate value is 1.
- dcOffsetArray[i] = i < half ? 0 : 1;
- }
-
- done();
+ audit.define('build-buffers', (task, should) => {
+ should(() => {
+ // 4-sample impulse sample.
+ impulseBuffer = createImpulseBuffer(context, impulseLength);
+
+ // Create a DC offset buffer with 2 values [0, 1] for modulating
+ // playbackRate. The first half of buffer is 0 and the rest is 1.
+ dcOffsetBuffer = context.createBuffer(1, renderLength, sampleRate);
+ var dcOffsetArray = dcOffsetBuffer.getChannelData(0);
+ for (i = 0; i < dcOffsetArray.length; i++) {
+
+ // Note that these values will be added to the playbackRate AudioParam
+ // value. For example, 0 DC offset value will result playbackRate of 1
+ // because the default playbackRate value is 1.
+ dcOffsetArray[i] = i < half ? 0 : 1;
+ }
+ }, "Build buffers")
+ .notThrow();
+
+ task.done();
});
// Task: Render the actual buffer and compare with the reference.
- audit.defineTask('synthesize-verify', function (done) {
+ audit.define('synthesize-verify', (task, should) => {
var impulse = context.createBufferSource();
var dcOffset = context.createBufferSource();
@@ -84,22 +87,14 @@
i++;
}
- Should('Doubling playbackRate', passed)
- .summarize(
+ should(passed, 'Doubling playbackRate')
+ .message(
'decreased the interval between impulses to half',
'produced the incorrect result' + 'at the index ' + i)
- }).then(done);
- });
-
- audit.defineTask('finish', function (done) {
- done();
+ }).then(() => task.done());
});
- audit.runTasks(
- 'build-buffers',
- 'synthesize-verify',
- 'finish'
- );
+ audit.run();
successfullyParsed = true;
</script>

Powered by Google App Engine
This is Rietveld 408576698