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

Unified Diff: third_party/WebKit/LayoutTests/webaudio/AudioParam/audioparam-setValueCurve-end.html

Issue 2780433005: Convert AudioParam 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
Index: third_party/WebKit/LayoutTests/webaudio/AudioParam/audioparam-setValueCurve-end.html
diff --git a/third_party/WebKit/LayoutTests/webaudio/AudioParam/audioparam-setValueCurve-end.html b/third_party/WebKit/LayoutTests/webaudio/AudioParam/audioparam-setValueCurve-end.html
index e1a96847f5389a68acb5c07d7590a0231ef07189..d36e8975be9bca90969578c5dfb3724c03fc8001 100644
--- a/third_party/WebKit/LayoutTests/webaudio/AudioParam/audioparam-setValueCurve-end.html
+++ b/third_party/WebKit/LayoutTests/webaudio/AudioParam/audioparam-setValueCurve-end.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>
<script src="../resources/audio-param.js"></script>
</head>
@@ -63,20 +63,16 @@
// Define tests from the configs
for (k in testConfigs) {
- audit.defineTask(k + ": " + testConfigs[k].automation, (function (config) {
- return function (done) {
- runTest(config).then(done);
+ audit.define(k + ": " + testConfigs[k].automation, (function (config) {
+ return (task, should) => {
+ runTest(should, config).then(() => task.done());
};
})(testConfigs[k]));
}
- audit.defineTask("finish", function (done) {
- done();
- });
+ audit.run();
- audit.runTasks();
-
- function runTest(options) {
+ function runTest(should, options) {
// For the test, use a gain node with a constant input to test the
// automations.
var context = new OfflineAudioContext(1, testDurationFrames, sampleRate);
@@ -136,8 +132,11 @@
message += ", 0.01";
message += ")";
- Should(message + ": value at time " + curveEndFrame / sampleRate, result[curveEndFrame])
- .beCloseTo(expectedResult, options.threshold || 0);
+ should(result[curveEndFrame],
+ message + ": value at time " + curveEndFrame / sampleRate)
+ .beCloseTo(expectedResult, {
+ threshold: options.threshold || 0
+ });
});
}

Powered by Google App Engine
This is Rietveld 408576698