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

Unified Diff: third_party/WebKit/LayoutTests/webaudio/PeriodicWave/periodicwave-lengths.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 | « no previous file | third_party/WebKit/LayoutTests/webaudio/PeriodicWave/periodicwave-normalization.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/webaudio/PeriodicWave/periodicwave-lengths.html
diff --git a/third_party/WebKit/LayoutTests/webaudio/PeriodicWave/periodicwave-lengths.html b/third_party/WebKit/LayoutTests/webaudio/PeriodicWave/periodicwave-lengths.html
index e097a1ffea29e0c40acc8cf1b54e8e5ea8ceb3f5..057a85164846c17152cccc0ba13ff5febb326b9e 100644
--- a/third_party/WebKit/LayoutTests/webaudio/PeriodicWave/periodicwave-lengths.html
+++ b/third_party/WebKit/LayoutTests/webaudio/PeriodicWave/periodicwave-lengths.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>
@@ -142,20 +142,20 @@
// Returns a function the verifies that the result is zero. The parameters control what is
// printed in the messages.
- function resultShouldBeZero(sampleRate, bigLength, smallLength) {
+ function resultShouldBeZero(should, sampleRate, bigLength, smallLength) {
return function (buffer) {
var prefix = generatePrefix(sampleRate, bigLength, smallLength);
- Should(prefix + "are identical", isBufferZero(buffer))
+ should(isBufferZero(buffer), prefix + "are identical")
.beEqualTo(true);
}
}
// Returns a function the verifies that the result is non-zero. The parameters control what is
// printed in the messages.
- function resultShouldBeNonZero(sampleRate, bigLength, smallLength) {
+ function resultShouldBeNonZero(should, sampleRate, bigLength, smallLength) {
return function (buffer) {
var prefix = generatePrefix(sampleRate, bigLength, smallLength);
- Should(prefix + "are different", !isBufferZero(buffer))
+ should(!isBufferZero(buffer), prefix + "are different")
.beEqualTo(true);
}
}
@@ -163,14 +163,14 @@
// Creates a function that is used to run an Audit test for a given sample rate, periodic wave
// sizes, and verifier.
function createAuditTestFunction(sampleRate, bigLength, smallLength, verifier) {
- return function (done) {
+ return (task, should) => {
// Create the audio graph, render it, and then verify that the output is the expected
// result.
createAudioGraph(sampleRate, bigLength, smallLength);
- context.startRendering()
- .then(verifier(sampleRate, bigLength, smallLength))
- .then(done);
+ return context.startRendering()
+ .then(verifier(should, sampleRate, bigLength, smallLength))
+ .then(() => task.done());
}
}
@@ -234,19 +234,17 @@
}
// Define the tasks based on the entries in testSet.
- function defineAuditTests () {
+ function defineAuditTests() {
for (var k = 0; k < testSet.length; ++k) {
- var test = testSet[k];
- var actualName = actualTestName(test.name, k);
- audit.defineTask(actualName,
- createAuditTestFunction(test.sampleRate, test.bigWave, test.smallWave, test.verifier));
+ let {name, sampleRate, bigWave, smallWave, verifier} = testSet[k];
+ let actualName = actualTestName(name, k);
+ audit.define(actualName,
+ createAuditTestFunction(sampleRate, bigWave, smallWave, verifier));
}
}
defineAuditTests();
- audit.runTasks();
-
- successfullyParsed = true;
+ audit.run();
</script>
</body>
</html>
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/webaudio/PeriodicWave/periodicwave-normalization.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698