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

Unified Diff: third_party/WebKit/LayoutTests/webaudio/Analyser/realtimeanalyser-basic.html

Issue 2598683002: Convert realtimeanalyser-basic to testharness (Closed)
Patch Set: Rebase Created 3 years, 12 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/Analyser/realtimeanalyser-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/Analyser/realtimeanalyser-basic.html
diff --git a/third_party/WebKit/LayoutTests/webaudio/Analyser/realtimeanalyser-basic.html b/third_party/WebKit/LayoutTests/webaudio/Analyser/realtimeanalyser-basic.html
index b790bb20c6320b06617e97882a6f04e6ac899c9c..49322d23d547e223bd93c3b7187f9a67dd1861c5 100644
--- a/third_party/WebKit/LayoutTests/webaudio/Analyser/realtimeanalyser-basic.html
+++ b/third_party/WebKit/LayoutTests/webaudio/Analyser/realtimeanalyser-basic.html
@@ -1,75 +1,55 @@
<!DOCTYPE html>
<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 AnalyserNode.");
var context = 0;
-function runTest() {
- if (window.testRunner) {
- testRunner.dumpAsText();
- testRunner.waitUntilDone();
- }
-
- window.jsTestIsAsync = true;
+var audit = Audit.createTaskRunner();
+audit.define("Basic AnalyserNode test", function (task, should) {
context = new AudioContext();
var analyser = context.createAnalyser();
- if (analyser.numberOfInputs === 1)
- testPassed("AnalyserNode has one input.");
- else
- testFailed("AnalyserNode should have one input, not " + analyser.numberOfInputs + ".");
-
- if (analyser.numberOfOutputs === 1)
- testPassed("AnalyserNode has one output.");
- else
- testFailed("AnalyserNode should have one output.");
+ should(analyser.numberOfInputs, "Number of inputs for AnalyserNode")
+ .beEqualTo(1);
- if (analyser.minDecibels === -100)
- testPassed("minDecibels default value is -100.");
- else
- testFailed("minDecibels default value should be -100.");
+ should(analyser.numberOfOutputs, "Number of outputs for AnalyserNode")
+ .beEqualTo(1);
- if (analyser.maxDecibels === -30)
- testPassed("maxDecibels default value is -30.");
- else
- testFailed("maxDecibels default value should be -30.");
+ should(analyser.minDecibels, "Default minDecibels value")
+ .beEqualTo(-100);
- if (analyser.smoothingTimeConstant === 0.8)
- testPassed("smoothingTimeConstant default value is 0.8.");
- else
- testFailed("smoothingTimeConstant default value should be 0.8.");
+ should(analyser.maxDecibels, "Default maxDecibels value")
+ .beEqualTo(-30);
+ should(analyser.smoothingTimeConstant, "Default smoothingTimeConstant value")
+ .beEqualTo(0.8);
+
var expectedValue = -50 - (1/3);
analyser.minDecibels = expectedValue;
- if (analyser.minDecibels === expectedValue)
- testPassed("minDecibels value is set to " + expectedValue + ".")
- else
- testFailed("minDecibels value should be set to " + expectedValue + ", not " + analyser.minDecibels + ".");
+
+ should(analyser.minDecibels, "node.minDecibels = " + expectedValue)
+ .beEqualTo(expectedValue);
expectedValue = -40 - (1/3);
analyser.maxDecibels = expectedValue;
- if (analyser.maxDecibels === expectedValue)
- testPassed("maxDecibels value is set to " + expectedValue + ".")
- else
- testFailed("maxDecibels value should be set to " + expectedValue + ", not " + analyser.maxDecibels + ".");
- finishJSTest();
-}
+ should(analyser.maxDecibels, "node.maxDecibels = " + expectedValue)
+ .beEqualTo(expectedValue);
-runTest();
+ task.done();
+});
+audit.run();
</script>
</body>
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/webaudio/Analyser/realtimeanalyser-basic-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698