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

Unified Diff: third_party/WebKit/LayoutTests/webaudio/AudioParam/audioparam-sampling.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-sampling.html
diff --git a/third_party/WebKit/LayoutTests/webaudio/AudioParam/audioparam-sampling.html b/third_party/WebKit/LayoutTests/webaudio/AudioParam/audioparam-sampling.html
index eab5cd2979b475027fedd8ec8a85ed8b6d5b3c9a..930e2c96de40a9d617ff5248d0aa4516b9da3592 100644
--- a/third_party/WebKit/LayoutTests/webaudio/AudioParam/audioparam-sampling.html
+++ b/third_party/WebKit/LayoutTests/webaudio/AudioParam/audioparam-sampling.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>
<script src="../resources/audioparam-testing.js"></script>
<title>Test Sampling of LinearRampToValueAtTime</title>
</head>
@@ -17,7 +17,7 @@
var audit = Audit.createTaskRunner();
- function runTest(config) {
+ function runTest(should, config) {
// Create a short context with a constant signal source connected to a gain node that will
// be automated.
context = new OfflineAudioContext(1, 256, sampleRate);
@@ -55,17 +55,10 @@
var expectedStart = config.expectedFunction(startFrame / sampleRate);
var expectedEnd = config.expectedFunction(endFrame / sampleRate);
- var success = Should(config.desc + ": Sample " + startFrame,
- resultData[startFrame], {
- precision: 7
- }).beCloseTo(expectedStart, config.startValueThreshold);
- success = Should(config.desc + ": Sample " + endFrame,
- resultData[endFrame], {
- precision: 7
- }).beCloseTo(expectedEnd, config.endValueThreshold) && success;
-
- Should(config.desc, success)
- .summarize("passed", "failed");
+ should(resultData[startFrame], config.desc + ": Sample " + startFrame)
+ .beCloseTo(expectedStart, {threshold: config.startValueThreshold});
+ should(resultData[endFrame], config.desc + ": Sample " + endFrame)
+ .beCloseTo(expectedEnd, {threshold: config.endValueThreshold});
});
}
@@ -155,8 +148,8 @@
];
function createTaskFunction(config) {
- return function (done) {
- runTest(config).then(done);
+ return (task, should) => {
+ runTest(should, config).then(() => task.done());
};
}
@@ -164,15 +157,10 @@
for (var k = 0; k < testConfigs.length; ++k) {
var config = testConfigs[k];
var taskName = config.desc + ":task" + k;
- audit.defineTask(taskName, createTaskFunction(config));
+ audit.define(taskName, createTaskFunction(config));
}
- audit.defineTask("finish", function (done) {
- done();
- });
-
- audit.runTasks();
- successfullyParsed = true;
+ audit.run();
</script>
</body>
</html>

Powered by Google App Engine
This is Rietveld 408576698