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

Unified Diff: third_party/WebKit/LayoutTests/webaudio/Oscillator/osc-low-freq.html

Issue 2804633004: Convert Oscillator tests to new Audit (Closed)
Patch Set: Address review comments Created 3 years, 8 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/Oscillator/osc-negative-freq.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/webaudio/Oscillator/osc-low-freq.html
diff --git a/third_party/WebKit/LayoutTests/webaudio/Oscillator/osc-low-freq.html b/third_party/WebKit/LayoutTests/webaudio/Oscillator/osc-low-freq.html
index 5a1e0d24fcb77675f862cc1a4c90678f07958cfc..46d33147e204ed084db251da561b63c7d2f7c437 100644
--- a/third_party/WebKit/LayoutTests/webaudio/Oscillator/osc-low-freq.html
+++ b/third_party/WebKit/LayoutTests/webaudio/Oscillator/osc-low-freq.html
@@ -5,7 +5,7 @@
<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>
</head>
<body>
@@ -34,7 +34,7 @@
var audit = Audit.createTaskRunner();
// Compute the SNR between the actual result and expected cosine wave
- function checkCosineResult(result, freq, sampleRate) {
+ function checkCosineResult(should, result, freq, sampleRate) {
var signal = 0;
var noise = 0;
var omega = 2 * Math.PI * freq / sampleRate;
@@ -50,13 +50,11 @@
var snr = 10 * Math.log10(signal / noise);
- Should("SNR of " + desiredFrequencyHz + " Hz sine wave", snr, {
- brief: true
- }).beGreaterThanOrEqualTo(snrThreshold);
- testPassed("PeriodicWave coefficients that must be ignored were correctly ignored.");
+ should(snr, "SNR of " + desiredFrequencyHz + " Hz sine wave")
+ .beGreaterThanOrEqualTo(snrThreshold);
}
- function runTest() {
+ audit.define("low-freq-oscillator", (task, should) => {
context = new OfflineAudioContext(1, sampleRate, sampleRate);
osc = context.createOscillator();
@@ -76,11 +74,12 @@
osc.connect(context.destination);
osc.start();
context.startRendering().then(function (buffer) {
- checkCosineResult(buffer, desiredFrequencyHz, sampleRate);
- });
- };
+ checkCosineResult(should, buffer, desiredFrequencyHz, sampleRate);
+ })
+ .then(() => task.done());
+ });
- runTest();
+ audit.run();
</script>
</body>
</html>
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/webaudio/Oscillator/osc-negative-freq.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698