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..135cf4836214cda5b938563b12546194b02e8679 |
--- /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, not " + analyser.numberOfInputs + "."); |
+ |
+ 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.minDecibels = -50.0 - (1/3); |
+ if (analyser.minDecibels === -50.0 - (1/3)) |
Raymond Toy
2014/03/28 16:10:06
Change lines 53-57 to
var expectedValue = -50 - (
|
+ testPassed("minDecibels value is set to -50.333333333333336."); |
+ else |
+ testFailed("minDecibels value should be set to -50.333333333333336, not " + analyser.minDecibels + "."); |
+ |
+ analyser.maxDecibels = -40.0 - (1/3); |
Raymond Toy
2014/03/28 16:10:06
Same as above.
|
+ if (analyser.maxDecibels === -40.0 - (1/3)) |
+ testPassed("maxDecibels value is set to -40.333333333333336."); |
+ else |
+ testFailed("maxDecibels value should be set to -40.333333333333336, not " + analyser.maxDecibels + "."); |
+ |
+ finishJSTest(); |
+} |
+ |
+runTest(); |
+ |
+</script> |
+ |
+</body> |
+</html> |