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

Unified Diff: third_party/WebKit/LayoutTests/webaudio/DynamicsCompressor/dynamicscompressor-basic.html

Issue 2673743002: Convert DynamicsCompressor tests to testharness (Closed)
Patch Set: Address review comments. Created 3 years, 10 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/DynamicsCompressor/dynamicscompressor-basic-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/DynamicsCompressor/dynamicscompressor-basic.html
diff --git a/third_party/WebKit/LayoutTests/webaudio/DynamicsCompressor/dynamicscompressor-basic.html b/third_party/WebKit/LayoutTests/webaudio/DynamicsCompressor/dynamicscompressor-basic.html
index d8298d131653b5a8ecb8fffb5be0e5ce5e4c75ad..7ec4dc51703e8c5849aa951f61571e698479511f 100644
--- a/third_party/WebKit/LayoutTests/webaudio/DynamicsCompressor/dynamicscompressor-basic.html
+++ b/third_party/WebKit/LayoutTests/webaudio/DynamicsCompressor/dynamicscompressor-basic.html
@@ -2,74 +2,43 @@
<html>
<head>
-<script src="../../resources/js-test.js"></script>
+<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>
-<div id="description"></div>
-<div id="console"></div>
-
<script>
-description("Basic tests for DynamicsCompressorNode API.");
-
+var audit = Audit.createTaskRunner();
var context;
var compressor;
-function runTest() {
- if (window.testRunner) {
- testRunner.dumpAsText();
- testRunner.waitUntilDone();
- }
-
- window.jsTestIsAsync = true;
+audit.define("test", function (task, should) {
+ task.describe("Basic tests for DynamicsCompressorNode API");
context = new AudioContext();
compressor = context.createDynamicsCompressor();
- try {
- if (compressor.threshold.value == -24)
- testPassed("threshold attribute has correct default value.");
- else
- testFailed("threshold attribute has incorrect default value.");
-
- if (compressor.knee.value == 30)
- testPassed("knee attribute has correct default value.");
- else
- testFailed("knee attribute has incorrect default value.");
-
- if (compressor.ratio.value == 12)
- testPassed("ratio attribute has correct default value.");
- else
- testFailed("ratio attribute has incorrect default value.");
-
- if (compressor.attack.value === Math.fround(0.003))
- testPassed("attack attribute has correct default value.");
- else
- testFailed("attack attribute has incorrect default value.");
-
- if (compressor.release.value === 0.25)
- testPassed("release attribute has correct default value.");
- else
- testFailed("release attribute has incorrect default value.");
-
- if (typeof compressor.reduction === "number") {
- testPassed("reduction attribute is a number.")
- if (compressor.reduction == 0)
- testPassed("reduction attribute has correct default value.")
- } else {
- testFailed("reduction attribute is an " + compressor.reduction.constructor.name + " not a number.");
- }
-
- } catch(e) {
- testFailed("Exception thrown when accessing DynamicsCompressorNode attributes.");
- }
-
- finishJSTest();
-}
-
-runTest();
+ should(compressor.threshold.value, "compressor.threshold.value")
+ .beEqualTo(-24);
+ should(compressor.knee.value, "compressor.knee.value")
+ .beEqualTo(30);
+ should(compressor.ratio.value, "compressor.ratio.value")
+ .beEqualTo(12);
+ should(compressor.attack.value, "compressor.attack.value")
+ .beEqualTo(Math.fround(0.003));
+ should(compressor.release.value, "compressor.release.value")
+ .beEqualTo(0.25);
+ should(typeof compressor.reduction, "typeof compressor.reduction")
+ .beEqualTo("number");
+ should(compressor.reduction, "compressor.reduction")
+ .beEqualTo(0);
+
+ done();
+});
+
+audit.run();
</script>
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/webaudio/DynamicsCompressor/dynamicscompressor-basic-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698