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

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

Issue 2789093004: Convert PeriodicWave tests to use new Audit (Closed)
Patch Set: 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 | « third_party/WebKit/LayoutTests/webaudio/PeriodicWave/periodicwave-lengths.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/webaudio/PeriodicWave/periodicwave-normalization.html
diff --git a/third_party/WebKit/LayoutTests/webaudio/PeriodicWave/periodicwave-normalization.html b/third_party/WebKit/LayoutTests/webaudio/PeriodicWave/periodicwave-normalization.html
index 3673d54cda35d7cefd087b505008d554c97578e4..3b5ec0bd562c42e9a571ee1a2e4a284ae794df95 100644
--- a/third_party/WebKit/LayoutTests/webaudio/PeriodicWave/periodicwave-normalization.html
+++ b/third_party/WebKit/LayoutTests/webaudio/PeriodicWave/periodicwave-normalization.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>
@@ -176,24 +176,24 @@
// Define a test function from the given test parameter. This is used as the Audit.defineTask
// task function.
- function defineTest(test) {
- return function (done) {
- var imagCoef = new Float32Array(test.realCoef.length);
- createAndRunAudioGraph(test.option, test.realCoef, imagCoef, function (result) {
+ function defineTest(testInfo) {
+ return (task, should) => {
+ var imagCoef = new Float32Array(testInfo.realCoef.length);
+ createAndRunAudioGraph(testInfo.option, testInfo.realCoef, imagCoef, function (result) {
var prefix;
// Try to print out the test.option in a reasonably nice but explicit way.
- if (test.option === "NONE") {
+ if (testInfo.option === "NONE") {
prefix = "";
- } else if (Array.isArray(test.option)) {
- prefix = "[" + test.option + "]: ";
+ } else if (Array.isArray(testInfo.option)) {
+ prefix = "[" + testInfo.option + "]: ";
} else {
- prefix = JSON.stringify(test.option) + ": ";
+ prefix = JSON.stringify(testInfo.option) + ": ";
}
- Should(prefix + "amplitude", arrayMax(result.getChannelData(0)))
- .beCloseTo(test.expectedMax, test.threshold);
- }).then(done);
+ should(arrayMax(result.getChannelData(0)), prefix + "amplitude")
+ .beCloseTo(testInfo.expectedMax, {threshold: testInfo.threshold});
+ }).then(() => task.done());
};
}
@@ -205,13 +205,13 @@
function defineTasks() {
for (var k = 0; k < testSet.length; ++k) {
- var test = testSet[k];
- audit.defineTask(actualTestName(test.name, k), defineTest(test));
+ var testInfo = testSet[k];
+ audit.define(actualTestName(test.name, k), defineTest(testInfo));
}
}
defineTasks();
- audit.runTasks();
+ audit.run();
successfullyParsed = true;
</script>
« no previous file with comments | « third_party/WebKit/LayoutTests/webaudio/PeriodicWave/periodicwave-lengths.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698