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

Unified Diff: third_party/WebKit/LayoutTests/webaudio/AudioListener/audiolistener-automation-position.html

Issue 2784583002: Convert AudioListener tests to new Audit (Closed)
Patch Set: Created 3 years, 9 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 | 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/AudioListener/audiolistener-automation-position.html
diff --git a/third_party/WebKit/LayoutTests/webaudio/AudioListener/audiolistener-automation-position.html b/third_party/WebKit/LayoutTests/webaudio/AudioListener/audiolistener-automation-position.html
index 78ad0d0328d4ff329f6e119b4f3af70f81d88f7a..aafca1118892e132092fc9b35cfa13ebe18e297c 100644
--- a/third_party/WebKit/LayoutTests/webaudio/AudioListener/audiolistener-automation-position.html
+++ b/third_party/WebKit/LayoutTests/webaudio/AudioListener/audiolistener-automation-position.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 Automation of AudioListener</title>
</head>
@@ -51,44 +51,43 @@
// redo the test, but this time move the listener in the opposite direction. The output of
// this test is compared against the panner result. They should be the same.
- audit.defineTask("linear", function (done) {
+ audit.define("linear", (task, should) => {
runTest({
+ should: should,
startPosition: defaultStartPosition,
endPosition: pannerEndPosition,
distanceModel: {
model: "linear",
rolloff: 1
}
- }).then(done);
+ }).then(() => task.done());
});
- audit.defineTask("exponential", function (done) {
+ audit.define("exponential", (task, should) => {
runTest({
+ should: should,
startPosition: defaultStartPosition,
endPosition: pannerEndPosition,
distanceModel: {
model: "exponential",
rolloff: 1.5
}
- }).then(done);
+ }).then(() => task.done());
});
- audit.defineTask("inverse", function (done) {
+ audit.define("inverse", (task, should) => {
runTest({
+ should: should,
startPosition: defaultStartPosition,
endPosition: pannerEndPosition,
distanceModel: {
model: "inverse",
rolloff: 1
}
- }).then(done);
+ }).then(() => task.done());
});
- audit.defineTask("finish", function (done) {
- done();
- });
-
- audit.runTasks();
+ audit.run();
function createGraph() {
var context = new OfflineAudioContext(2, renderFrames, sampleRate);
@@ -168,8 +167,6 @@
// Compare the output with the reference output from moving the source in the opposite
// direction.
- var success = true;
-
var expectedLeft = expectedResult.getChannelData(0);
var expectedRight = expectedResult.getChannelData(1);
@@ -178,16 +175,10 @@
var prefix = 'Distance model: "' + options.distanceModel.model + '"';
prefix += ', rolloff: ' + options.distanceModel.rolloff;
- success = Should(prefix + ": left channel", actualLeft, {
- precision: 5
- })
- .beCloseToArray(expectedLeft, 0) && success;
- success = Should(prefix + ": right channel", actualRight, {
- precision: 5
- })
- .beCloseToArray(expectedRight, 0) && success;
-
- return success;
+ options.should(actualLeft, prefix + ": left channel")
+ .beCloseToArray(expectedLeft, 0);
+ options.should(actualRight, prefix + ": right channel")
+ .beCloseToArray(expectedRight, 0);
}
</script>
</body>
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698