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

Unified Diff: third_party/WebKit/LayoutTests/webaudio/PeriodicWave/periodicwave-contexts.html

Issue 2675973003: Convert Oscillator sweep 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/PeriodicWave/periodicwave-contexts.html
diff --git a/third_party/WebKit/LayoutTests/webaudio/PeriodicWave/periodicwave-contexts.html b/third_party/WebKit/LayoutTests/webaudio/PeriodicWave/periodicwave-contexts.html
index 5ae3776048ad81a375b1cfb4ea612d3549c95373..9e16ba8e3e963aa19c6686faca2530cefa64883a 100644
--- a/third_party/WebKit/LayoutTests/webaudio/PeriodicWave/periodicwave-contexts.html
+++ b/third_party/WebKit/LayoutTests/webaudio/PeriodicWave/periodicwave-contexts.html
@@ -2,32 +2,45 @@
<html>
<head>
<title>Test Oscillator Node: sawtooth</title>
- <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/audit.js"></script>
<script src="../resources/buffer-loader.js"></script>
<script src="../resources/oscillator-testing.js"></script>
</head>
<body>
<script>
- description("Test Builtin Oscillator PeriodicWave Tables");
+ let audit = Audit.createTaskRunner();
// Create an offline context with a sample rate that is very different from the sample rate
// used in the OscillatorTestingUtils. This will create a internal PeriodicWave objects for
// the Oscillator. This should not interfere with the oscillator test using a different
// context with a different sample rate.
- var context = new OfflineAudioContext(1, 1, 3000);
- var osc = context.createOscillator();
- osc.type = "sawtooth";
- osc = null;
+ audit.define("test", (task, should) => {
+ let context0 = new OfflineAudioContext(1, 1, 3000);
+ let osc = context0.createOscillator();
+ osc.type = "sawtooth";
+ osc = null;
- // This test is identical to the test in osc-sawtooth-sweep-snr.html.
- var tester = OscillatorTestingUtils;
+ // This test is identical to the test in osc-sawtooth-sweep-snr.html.
+ let tester = OscillatorTestingUtils;
- // The thresholds are experimentally determined.
- tester.setThresholds({snr: 80.00, maxDiff: 4.06, diffCount: 15827});
- tester.runTest("sawtooth");
- successfullyParsed = true;
+ let context = new OfflineAudioContext(1, tester.sampleRate *
+ tester.lengthInSeconds, tester.sampleRate);
+ // The thresholds are experimentally determined.
+ tester.setThresholds({
+ snr: 80.00,
+ maxDiff: 4.06,
+ diffCount: 15827
+ });
+ tester.runTest(context, "sawtooth", "Sawtooth PeriodicWave Test",
+ task, should);
+ });
+
+ audit.run();
</script>
</body>
</html>

Powered by Google App Engine
This is Rietveld 408576698