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

Unified Diff: third_party/WebKit/LayoutTests/webaudio/AudioBufferSource/audiobuffersource-detune-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
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/webaudio/AudioBufferSource/audiobuffersource-detune-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-modulated-impulse.html
diff --git a/third_party/WebKit/LayoutTests/webaudio/AudioBufferSource/audiobuffersource-detune-modulated-impulse.html b/third_party/WebKit/LayoutTests/webaudio/AudioBufferSource/audiobuffersource-detune-modulated-impulse.html
index c223fa1c0f56a46aea4dfd8a10b6f7f2fef4bc12..c60ef00fdf421e98914f58b54172005d55238f0d 100644
--- a/third_party/WebKit/LayoutTests/webaudio/AudioBufferSource/audiobuffersource-detune-modulated-impulse.html
+++ b/third_party/WebKit/LayoutTests/webaudio/AudioBufferSource/audiobuffersource-detune-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,27 +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, 1200] for modulating
- // detune. The first half of buffer is 0 and the rest is 1200.
- 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 detune AudioParam
- // value. For example, 1 DC offset value will result detune of 1200.
- dcOffsetArray[i] = i < half ? 0 : 1200;
- }
-
- 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, 1200] for modulating
+ // detune. The first half of buffer is 0 and the rest is 1200.
+ 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 detune AudioParam
+ // value. For example, 1 DC offset value will result detune of 1200.
+ dcOffsetArray[i] = i < half ? 0 : 1200;
+ }
+ }, "Creation of impulse 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();
@@ -83,24 +87,14 @@
i++;
}
- Should('Increasing detune', passed)
- .summarize(
+ should(passed, 'Increasing detune')
+ .message(
'to 1200 decreased the interval between impulses to half',
'produced the incorrect result' + 'at the index ' + i);
- }).then(done);
+ }).then(() => task.done());
});
- audit.defineTask('finish', function (done) {
- done();
- });
-
- audit.runTasks(
- 'build-buffers',
- 'synthesize-verify',
- 'finish'
- );
-
- successfullyParsed = true;
+ audit.run();
</script>
</body>
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/webaudio/AudioBufferSource/audiobuffersource-detune-modulation.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698