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

Unified Diff: third_party/WebKit/LayoutTests/webaudio/Panner/panner-rolloff-clamping.html

Issue 2799793003: Convert Panner tests to new Audit (Closed)
Patch Set: Add back some test features Created 3 years, 7 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/Panner/panner-rolloff-clamping.html
diff --git a/third_party/WebKit/LayoutTests/webaudio/Panner/panner-rolloff-clamping.html b/third_party/WebKit/LayoutTests/webaudio/Panner/panner-rolloff-clamping.html
index dd5a3e47824d59b08bdfa98e66a8a4d77fe1d9d5..44dd06bf61db026a76e16a41f2ca5fd0cf0d2ebb 100644
--- a/third_party/WebKit/LayoutTests/webaudio/Panner/panner-rolloff-clamping.html
+++ b/third_party/WebKit/LayoutTests/webaudio/Panner/panner-rolloff-clamping.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>
@@ -16,40 +16,40 @@
var audit = Audit.createTaskRunner();
- audit.defineTask("linear-clamp-low", function (taskDone) {
- runTest({
+ audit.define("linear-clamp-low", (task, should) => {
+ runTest(should, {
distanceModel: "linear",
// Fairly arbitrary value outside the nominal range
rolloffFactor: -1,
clampedRolloff: 0
- }).then(taskDone);
+ }).then(() => task.done());
});
- audit.defineTask("linear-clamp-high", function (taskDone) {
- runTest({
+ audit.define("linear-clamp-high", (task, should) => {
+ runTest(should, {
distanceModel: "linear",
// Fairly arbitrary value outside the nominal range
rolloffFactor: 2,
clampedRolloff: 1
- }).then(taskDone);
+ }).then(() => task.done());
});
- audit.defineTask("inverse-clamp", function (taskDone) {
- runTest({
+ audit.define("inverse-clamp", (task, should) => {
+ runTest(should, {
distanceModel: "inverse",
// Fairly arbitrary value outside the nominal range
rolloffFactor: -1,
clampedRolloff: 0
- }).then(taskDone);
+ }).then(() => task.done());
});
- audit.defineTask("exponential-clamp", function (taskDone) {
- runTest({
+ audit.define("exponential-clamp", (task, should) => {
+ runTest(should, {
distanceModel: "exponential",
// Fairly arbitrary value outside the nominal range
rolloffFactor: -2,
clampedRolloff: 0
- }).then(taskDone);
+ }).then(() => task.done());
});
// Test clamping of the rolloffFactor. The test is done by comparing the
@@ -63,7 +63,7 @@
// nominal range of the distance model.
// clampedRolloff - The rolloffFactor (above) clamped to the nominal
// range for the given distance model.
- function runTest(options) {
+ function runTest(should, options) {
// Offline context with two channels. The first channel is the panner
// node under test. The second channel is the reference panner node.
var context = new OfflineAudioContext(2, renderFrames, sampleRate);
@@ -114,17 +114,12 @@
var message = 'Panner distanceModel: "' + options.distanceModel +
'", rolloffFactor: ' + options.rolloffFactor;
- var success = Should(message, actual)
+ should(actual, message)
.beEqualToArray(expected);
-
- Should(message, success)
- .summarize(
- "correctly clamped rolloffFactor to " + options.clampedRolloff,
- "did not correctly clamp rolloffFactor to " + options.clampedRolloff);
});
}
- audit.runTasks();
+ audit.run();
</script>
</body>
</html>

Powered by Google App Engine
This is Rietveld 408576698