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

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

Issue 2714853005: Convert remaining AudioBufferSource tests to testharness (Closed)
Patch Set: Created 3 years, 10 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-multi-channels.html
diff --git a/third_party/WebKit/LayoutTests/webaudio/AudioBufferSource/audiobuffersource-multi-channels.html b/third_party/WebKit/LayoutTests/webaudio/AudioBufferSource/audiobuffersource-multi-channels.html
index 8fed30e3afd2243580e8d9a2ed3612a7e70b6b61..cb65942ae4f725f47c38a12b6a56447a3b4c3e20 100644
--- a/third_party/WebKit/LayoutTests/webaudio/AudioBufferSource/audiobuffersource-multi-channels.html
+++ b/third_party/WebKit/LayoutTests/webaudio/AudioBufferSource/audiobuffersource-multi-channels.html
@@ -6,38 +6,42 @@ Test AudioBufferSourceNode supports 5.1 channel.
<html>
<head>
+<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 type="text/javascript" src="../resources/mix-testing.js"></script>
+<script src="../resources/audit.js"></script>
+<script src="../resources/mix-testing.js"></script>
</head>
<body>
<script>
+let audit = Audit.createTaskRunner();
-function runTest() {
- if (!window.testRunner)
- return;
+audit.define('test', (task, should) => {
+ should(window.testRunner, 'window.testRunner').notBeEqualTo(undefined);
- testRunner.waitUntilDone();
+ testRunner.waitUntilDone();
- window.jsTestAsync = true;
+ // Create offline audio context
+ let sampleRate = 44100.0;
+ let context =
+ new OfflineAudioContext(6, sampleRate * toneLengthSeconds, sampleRate);
+ let toneBuffer = createToneBuffer(context, 440, toneLengthSeconds, 6);
- // Create offline audio context
- var sampleRate = 44100.0;
- var context = new OfflineAudioContext(6, sampleRate * toneLengthSeconds, sampleRate);
- var toneBuffer = createToneBuffer(context, 440, toneLengthSeconds, 6);
+ let source = context.createBufferSource();
+ source.buffer = toneBuffer;
- var source = context.createBufferSource();
- source.buffer = toneBuffer;
+ source.connect(context.destination);
+ source.start(0);
- source.connect(context.destination);
- source.start(0);
+ context.oncomplete = (event) => {
hongchan 2017/02/27 18:05:35 promise?
+ finishAudioTest(event);
+ task.done();
+ };
+ context.startRendering();
+});
- context.oncomplete = finishAudioTest;
- context.startRendering();
-}
-
-runTest();
+audit.run();
</script>
</body>

Powered by Google App Engine
This is Rietveld 408576698