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

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

Issue 2591043005: Convert audiobuffersource-ended to testharness (Closed)
Patch Set: Rebase and remove unneeded expected result file Created 3 years, 11 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-ended-expected.txt » ('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-ended.html
diff --git a/third_party/WebKit/LayoutTests/webaudio/AudioBufferSource/audiobuffersource-ended.html b/third_party/WebKit/LayoutTests/webaudio/AudioBufferSource/audiobuffersource-ended.html
index 3e72fa37ecee158c8b8a11922403eaf1a7f651a0..78519e6a7937909e1dc999444642776f97b50785 100644
--- a/third_party/WebKit/LayoutTests/webaudio/AudioBufferSource/audiobuffersource-ended.html
+++ b/third_party/WebKit/LayoutTests/webaudio/AudioBufferSource/audiobuffersource-ended.html
@@ -1,39 +1,34 @@
<!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/audiobuffersource-testing.js"></script>
+</head>
+<body>
<script>
- var context;
- var source;
+ let audit = Audit.createTaskRunner();
- function runTest()
- {
- if (window.testRunner) {
- testRunner.dumpAsText();
- testRunner.waitUntilDone();
- }
+ let context;
+ let source;
- var sampleRate = 44100.0;
- var numberOfFrames = 32;
- context = new OfflineAudioContext(1, numberOfFrames, sampleRate);
- source = context.createBufferSource();
- source.buffer = createTestBuffer(context, numberOfFrames);
- source.connect(context.destination);
- source.onended = function()
- {
- testPassed("source.onended called.");
- if (window.testRunner)
- testRunner.notifyDone();
- }
- source.start(0);
- context.startRendering();
- }
- </script>
+ audit.define("AudioBufferSourceNode calls its onended EventListener",
+ function (task, should) {
+ let sampleRate = 44100.0;
+ let numberOfFrames = 32;
+ context = new OfflineAudioContext(1, numberOfFrames, sampleRate);
+ source = context.createBufferSource();
+ source.buffer = createTestBuffer(context, numberOfFrames);
+ source.connect(context.destination);
+ source.onended = function () {
+ should(true, "source.onended called").beTrue();
+ task.done();
+ }
+ source.start(0);
+ context.startRendering();
hongchan 2017/01/04 21:42:41 Q: should we change this to the promise pattern?
Raymond Toy 2017/01/04 21:46:16 Sorry, I don't follow. The test is that the onend
hongchan 2017/01/10 19:22:58 Ha, I missed that. Sorry.
+ });
-</head>
-<body onload="runTest()">
- <div>Tests that AudioBufferSourceNode calls its onended EventListener.</div>
- <div id="console"></div>
+ audit.run();
+ </script>
</body>
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/webaudio/AudioBufferSource/audiobuffersource-ended-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698