Index: third_party/WebKit/LayoutTests/webaudio/AudioBufferSource/note-grain-on-timing.html |
diff --git a/third_party/WebKit/LayoutTests/webaudio/AudioBufferSource/note-grain-on-timing.html b/third_party/WebKit/LayoutTests/webaudio/AudioBufferSource/note-grain-on-timing.html |
index cc49d1a84729525c2321a0746c3a123061cd6b9f..7c87d5daf5649bf9c78823deb1f388f064a652dc 100644 |
--- a/third_party/WebKit/LayoutTests/webaudio/AudioBufferSource/note-grain-on-timing.html |
+++ b/third_party/WebKit/LayoutTests/webaudio/AudioBufferSource/note-grain-on-timing.html |
@@ -1,63 +1,46 @@ |
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> |
+<!doctype> |
<html> |
<head> |
- <script src="../../resources/js-test.js"></script> |
+ <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> |
<script src="../resources/note-grain-on-testing.js"></script> |
</head> |
<body> |
- <div id="description"></div> |
- <div id="console"></div> |
- |
<script> |
- description("Test timing of noteGrainOn."); |
+ let audit = Audit.createTaskRunner(); |
- var squarePulseBuffer; |
+ let squarePulseBuffer; |
- function checkResult(event) { |
- var buffer = event.renderedBuffer; |
+ function checkResult(buffer, should) { |
renderedData = buffer.getChannelData(0); |
- var nSamples = renderedData.length; |
- |
- var success = true; |
- |
- var startEndFrames = findStartAndEndSamples(renderedData); |
- |
- success = success && verifyStartAndEndFrames(startEndFrames); |
- |
- if (success) { |
- testPassed("noteGrainOn timing tests passed."); |
- } else { |
- testFailed("noteGrainOn timing tests failed."); |
- } |
+ let nSamples = renderedData.length; |
+ let startEndFrames = findStartAndEndSamples(renderedData); |
- finishJSTest(); |
+ verifyStartAndEndFrames(startEndFrames, should); |
} |
- function runTest() { |
- if (window.testRunner) { |
- testRunner.dumpAsText(); |
- testRunner.waitUntilDone(); |
- } |
- |
- window.jsTestIsAsync = true; |
- |
+ audit.define("Test timing of noteGrainOn", function (task, should) { |
// Create offline audio context. |
- context = new OfflineAudioContext(2, sampleRate * renderTime, sampleRate); |
+ context = new OfflineAudioContext(2, sampleRate * renderTime, |
+ sampleRate); |
- squarePulseBuffer = createSignalBuffer(context, function (k) { return 1 }); |
+ squarePulseBuffer = createSignalBuffer(context, function (k) { |
+ return 1 |
+ }); |
playAllGrains(context, squarePulseBuffer, numberOfTests); |
- context.oncomplete = checkResult; |
- context.startRendering(); |
- } |
+ context.startRendering() |
+ .then(function (audioBuffer) { |
+ checkResult(audioBuffer, should); |
+ task.done(); |
+ }); |
+ }); |
- runTest(); |
- successfullyParsed = true; |
- |
+ audit.run(); |
</script> |
</body> |