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

Unified Diff: third_party/WebKit/LayoutTests/webaudio/Panner/panner-loop.html

Issue 2713943002: Convert more PannerNode tests to testharness (Closed)
Patch Set: Address review comments 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/Panner/panner-loop.html
diff --git a/third_party/WebKit/LayoutTests/webaudio/Panner/panner-loop.html b/third_party/WebKit/LayoutTests/webaudio/Panner/panner-loop.html
index 83fe6e5625e1cb6d039b3c397e273e242365fa97..8ac17ec03b43fdb8a68d6c73fcbc50925fc0e66f 100644
--- a/third_party/WebKit/LayoutTests/webaudio/Panner/panner-loop.html
+++ b/third_party/WebKit/LayoutTests/webaudio/Panner/panner-loop.html
@@ -1,83 +1,78 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<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/panner-model-testing.js"></script>
</head>
<body>
- <div id="description"></div>
- <div id="console"></div>
<script>
- description("Test PannerNode handling of feedback loops");
+ let audit = Audit.createTaskRunner();
// See crbug.com/331446.
// Create a simple feedback loop and make sure the panner node processes it correctly.
- function runTest() {
- if (window.testRunner) {
- testRunner.dumpAsText();
- testRunner.waitUntilDone();
- }
+ audit.define(
+ {label: 'test', description: 'PannerNode handling of feedback loops'},
+ (task, should) => {
- window.jsTestIsAsync = true;
+ var sampleRate = 44100;
+ var renderLengthSeconds = 1;
- var sampleRate = 44100;
- var renderLengthSeconds = 1;
-
- // Create offline audio context.
- var context = new OfflineAudioContext(2, sampleRate * renderLengthSeconds, sampleRate);
+ // Create offline audio context.
+ var context = new OfflineAudioContext(
+ 2, sampleRate * renderLengthSeconds, sampleRate);
- // Create nodes in graph. This is based on the test given in crbug.com/331446.
- var source = context.createBufferSource();
- source.buffer = createImpulseBuffer(context, sampleRate * renderLengthSeconds);
- var activateNode = context.createGain();
- var dry = context.createGain();
- var wet = context.createGain();
- var filter = context.createBiquadFilter();
- var delay = context.createDelay();
- var feedbackNode = context.createGain();
- var output = context.createGain();
+ // Create nodes in graph. This is based on the test given in
+ // crbug.com/331446.
+ var source = context.createBufferSource();
+ source.buffer =
+ createImpulseBuffer(context, sampleRate * renderLengthSeconds);
+ var activateNode = context.createGain();
+ var dry = context.createGain();
+ var wet = context.createGain();
+ var filter = context.createBiquadFilter();
+ var delay = context.createDelay();
+ var feedbackNode = context.createGain();
+ var output = context.createGain();
- delay.delayTime.value = 0.1;
- wet.gain.value = 0.5;
- dry.gain.value = 1;
- feedbackNode.gain.value = 0.45;
- filter.frequency.value = 20000;
+ delay.delayTime.value = 0.1;
+ wet.gain.value = 0.5;
+ dry.gain.value = 1;
+ feedbackNode.gain.value = 0.45;
+ filter.frequency.value = 20000;
- source.connect(activateNode);
- activateNode.connect(delay);
- activateNode.connect(dry);
- delay.connect(filter);
- filter.connect(feedbackNode);
- feedbackNode.connect(delay);
- feedbackNode.connect(wet);
- wet.connect(output);
- dry.connect(output);
+ source.connect(activateNode);
+ activateNode.connect(delay);
+ activateNode.connect(dry);
+ delay.connect(filter);
+ filter.connect(feedbackNode);
+ feedbackNode.connect(delay);
+ feedbackNode.connect(wet);
+ wet.connect(output);
+ dry.connect(output);
- var panner = context.createPanner();
- panner.coneOuterGain = 0.1;
- panner.coneOuterAngle = 180;
- panner.coneInnerAngle = 0;
+ var panner = context.createPanner();
+ panner.coneOuterGain = 0.1;
+ panner.coneOuterAngle = 180;
+ panner.coneInnerAngle = 0;
- panner.connect(context.destination);
+ panner.connect(context.destination);
- output.connect(panner);
+ output.connect(panner);
- // Render. We don't care what the output is, though.
+ // Render. We don't care what the output is, though.
- context.oncomplete = function (event) {
- testPassed("Rendering successfully completed.");
- finishJSTest();
- };
- context.startRendering();
- }
-
- runTest();
- successfullyParsed = true;
+ should(context.startRendering(), 'Rendering of offline context')
+ .beResolved()
+ .then(() => task.done());
+ });
+
+ audit.run();
</script>
</body>

Powered by Google App Engine
This is Rietveld 408576698