Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 <!DOCTYPE html> | |
| 2 <html> | |
| 3 <head> | |
| 4 <script src="../resources/js-test.js"></script> | |
| 5 <script src="resources/audio-testing.js"></script> | |
| 6 </head> | |
| 7 | |
| 8 <body> | |
| 9 <div id="description"></div> | |
| 10 <div id="console"></div> | |
| 11 | |
| 12 <script> | |
| 13 description("Basic tests for AnalyserNode."); | |
| 14 | |
| 15 var context = 0; | |
| 16 | |
| 17 function runTest() { | |
| 18 if (window.testRunner) { | |
| 19 testRunner.dumpAsText(); | |
| 20 testRunner.waitUntilDone(); | |
| 21 } | |
| 22 | |
| 23 window.jsTestIsAsync = true; | |
| 24 | |
| 25 context = new webkitAudioContext(); | |
| 26 var analyser = context.createAnalyser(); | |
| 27 | |
| 28 if (analyser.numberOfInputs === 1) | |
| 29 testPassed("AnalyserNode has one input."); | |
| 30 else | |
| 31 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.
| |
| 32 | |
| 33 if (analyser.numberOfOutputs === 1) | |
| 34 testPassed("AnalyserNode has one output."); | |
| 35 else | |
| 36 testFailed("AnalyserNode should have one output."); | |
| 37 | |
| 38 if (analyser.minDecibels === -100) | |
| 39 testPassed("minDecibels default value is -100."); | |
| 40 else | |
| 41 testFailed("minDecibels default value should be -100."); | |
| 42 | |
| 43 if (analyser.maxDecibels === -30) | |
| 44 testPassed("maxDecibels default value is -30."); | |
| 45 else | |
| 46 testFailed("maxDecibels default value should be -30."); | |
| 47 | |
| 48 if (analyser.smoothingTimeConstant === 0.8) | |
| 49 testPassed("smoothingTimeConstant default value is 0.8."); | |
| 50 else | |
| 51 testFailed("smoothingTimeConstant default value should be 0.8."); | |
| 52 | |
| 53 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.
| |
| 54 if (analyser.minDecibelss === 1/3) | |
| 55 testPassed("minDecibelss value is set to 1/3."); | |
| 56 else | |
| 57 testFailed("minDecibelss value should be set to 1/3."); | |
| 58 | |
| 59 analyser.maxDecibelss = 1/3; | |
|
Raymond Toy
2014/03/27 17:33:09
Fix typo: maxDecibelss -> maxDecibels
KhNo
2014/03/28 02:25:23
Done.
| |
| 60 if (analyser.maxDecibelss === 1/3) | |
| 61 testPassed("maxDecibelss value is set to 1/3."); | |
| 62 else | |
| 63 testFailed("maxDecibelss value should be set to 1/3."); | |
| 64 | |
| 65 finishJSTest(); | |
| 66 } | |
| 67 | |
| 68 runTest(); | |
| 69 | |
| 70 </script> | |
| 71 | |
| 72 </body> | |
| 73 </html> | |
| OLD | NEW |