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

Unified Diff: third_party/WebKit/LayoutTests/webaudio/AudioParam/audioparam-automation-clamping.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
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/webaudio/AudioParam/audioparam-automation-clamping-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/webaudio/AudioParam/audioparam-automation-clamping.html
diff --git a/third_party/WebKit/LayoutTests/webaudio/AudioParam/audioparam-automation-clamping.html b/third_party/WebKit/LayoutTests/webaudio/AudioParam/audioparam-automation-clamping.html
index 822cda7c48a1eca9b8d7ab22ec7df1bfe3b5b2a4..d49172e6c3fba26a9abd898b685e261f3c8a9628 100644
--- a/third_party/WebKit/LayoutTests/webaudio/AudioParam/audioparam-automation-clamping.html
+++ b/third_party/WebKit/LayoutTests/webaudio/AudioParam/audioparam-automation-clamping.html
@@ -4,7 +4,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>
<title>Test Clamping of Automations</title>
</head>
@@ -20,7 +20,7 @@
var audit = Audit.createTaskRunner();
- audit.defineTask("clamp", function (done) {
+ audit.define("clamp", (task, should) => {
// Test clamping of automations. Most AudioParam limits are essentially
// unbounded, so clamping doesn't happen. For most other AudioParams,
// the behavior is sufficiently complicated with complicated outputs
@@ -55,7 +55,6 @@
context.startRendering().then(function (buffer) {
var result = buffer.getChannelData(0);
- var success = true;
// When the cutoff frequency of a lowpass filter is 0, nothing gets
// through. Hence the output of the filter between the clamping
@@ -76,11 +75,10 @@
expectedSignal.fill(0);
// Output should be zero.
- success = Should("Clamped signal in frame range [" + clampStartFrame + ", " +
- clampEndFrame + "]",
- clampedSignal, {
- verbose: true,
- }).beCloseToArray(expectedSignal, 0);
+ should(clampedSignal,
+ "Clamped signal in frame range [" + clampStartFrame + ", " +
+ clampEndFrame + "]")
+ .beCloseToArray(expectedSignal, 0);
// Find the actual clamp range based on the output values.
var actualClampStart = result.findIndex(x => x === 0);
@@ -88,23 +86,15 @@
x => x != 0);
// Verify that the expected clamping range is a subset of the actual range.
- success = Should("Actual Clamp start",
- actualClampStart).beLessThanOrEqualTo(clampStartFrame) && success;
- success == Should("Actual Clamp end",
- actualClampEnd).beGreaterThanOrEqualTo(clampEndFrame) && success;
-
- Should("Clamping of BiquadFilter.frequency automation performed",
- success)
- .summarize("correctly", "incorrectly");
- }).then(done);
- });
+ should(actualClampStart, "Actual Clamp start")
+ .beLessThanOrEqualTo(clampStartFrame);
+ should(actualClampEnd, "Actual Clamp end")
+ .beGreaterThanOrEqualTo(clampEndFrame);
- // All done!
- audit.defineTask("finish", function (done) {
- done();
+ }).then(() => task.done());
});
- audit.runTasks();
+ audit.run();
function solveLinearRamp(v, v0, t0, v1, t1) {
// Solve the linear ramp equation for the time t at which the ramp
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/webaudio/AudioParam/audioparam-automation-clamping-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698