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

Unified Diff: LayoutTests/webaudio/realtimeanalyser-basic.html

Issue 212793002: Fix attributes types on AnalyserNode as specification of web audio. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Add basic layoutTest and domexception test for equal values between min and max value. Created 6 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
Index: LayoutTests/webaudio/realtimeanalyser-basic.html
diff --git a/LayoutTests/webaudio/realtimeanalyser-basic.html b/LayoutTests/webaudio/realtimeanalyser-basic.html
new file mode 100644
index 0000000000000000000000000000000000000000..eea7033b2a562bf607c63acecb6f578ce18c3266
--- /dev/null
+++ b/LayoutTests/webaudio/realtimeanalyser-basic.html
@@ -0,0 +1,73 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script src="../resources/js-test.js"></script>
+<script src="resources/audio-testing.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;
+
+ context = new webkitAudioContext();
+ var analyser = context.createAnalyser();
+
+ if (analyser.numberOfInputs === 1)
+ testPassed("AnalyserNode has one input.");
+ else
+ testFailed("AnalyserNode should have one input.");
Raymond Toy 2014/03/27 17:33:09 Make this and the following failed tests a little
KhNo 2014/03/28 02:25:23 Oh, that is much better. Thanks.
+
+ if (analyser.numberOfOutputs === 1)
+ testPassed("AnalyserNode has one output.");
+ else
+ testFailed("AnalyserNode should have one output.");
+
+ if (analyser.minDecibels === -100)
+ testPassed("minDecibels default value is -100.");
+ else
+ testFailed("minDecibels default value should be -100.");
+
+ if (analyser.maxDecibels === -30)
+ testPassed("maxDecibels default value is -30.");
+ else
+ testFailed("maxDecibels default value should be -30.");
+
+ if (analyser.smoothingTimeConstant === 0.8)
+ testPassed("smoothingTimeConstant default value is 0.8.");
+ else
+ testFailed("smoothingTimeConstant default value should be 0.8.");
+
+ analyser.minDecibelss = 1/3;
Raymond Toy 2014/03/27 17:33:09 Fix typo: minDecibelss -> minDecibels. This test d
KhNo 2014/03/28 02:25:23 Done. and I will correctly change it I missed.
+ if (analyser.minDecibelss === 1/3)
+ testPassed("minDecibelss value is set to 1/3.");
+ else
+ testFailed("minDecibelss value should be set to 1/3.");
+
+ analyser.maxDecibelss = 1/3;
Raymond Toy 2014/03/27 17:33:09 Fix typo: maxDecibelss -> maxDecibels
KhNo 2014/03/28 02:25:23 Done.
+ if (analyser.maxDecibelss === 1/3)
+ testPassed("maxDecibelss value is set to 1/3.");
+ else
+ testFailed("maxDecibelss value should be set to 1/3.");
+
+ finishJSTest();
+}
+
+runTest();
+
+</script>
+
+</body>
+</html>

Powered by Google App Engine
This is Rietveld 408576698