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

Side by Side 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 compatibility.js Created 6 years, 8 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 unified diff | Download patch
OLDNEW
(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 <script src="resoruces/compatibility.js"></script>
7 </head>
8
9 <body>
10 <div id="description"></div>
11 <div id="console"></div>
12
13 <script>
14 description("Basic tests for AnalyserNode.");
15
16 var context = 0;
17
18 function runTest() {
19 if (window.testRunner) {
20 testRunner.dumpAsText();
21 testRunner.waitUntilDone();
22 }
23
24 window.jsTestIsAsync = true;
25
26 context = new AudioContext();
27 var analyser = context.createAnalyser();
28
29 if (analyser.numberOfInputs === 1)
30 testPassed("AnalyserNode has one input.");
31 else
32 testFailed("AnalyserNode should have one input, not " + analyser.numberO fInputs + ".");
33
34 if (analyser.numberOfOutputs === 1)
35 testPassed("AnalyserNode has one output.");
36 else
37 testFailed("AnalyserNode should have one output.");
38
39 if (analyser.minDecibels === -100)
40 testPassed("minDecibels default value is -100.");
41 else
42 testFailed("minDecibels default value should be -100.");
43
44 if (analyser.maxDecibels === -30)
45 testPassed("maxDecibels default value is -30.");
46 else
47 testFailed("maxDecibels default value should be -30.");
48
49 if (analyser.smoothingTimeConstant === 0.8)
50 testPassed("smoothingTimeConstant default value is 0.8.");
51 else
52 testFailed("smoothingTimeConstant default value should be 0.8.");
53
54 var expectedValue = -50 - (1/3);
55 analyser.minDecibels = expectedValue;
56 if (analyser.minDecibels === expectedValue)
57 testPassed("minDecibels value is set to " + expectedValue + ".")
58 else
59 testFailed("minDecibels value should be set to " + expectedValue + ", no t " + analyser.minDecibels + ".");
60
61 expectedValue = -40 - (1/3);
62 analyser.maxDecibels = expectedValue;
63 if (analyser.maxDecibels === expectedValue)
64 testPassed("maxDecibels value is set to " + expectedValue + ".")
65 else
66 testFailed("maxDecibels value should be set to " + expectedValue + ", no t " + analyser.maxDecibels + ".");
67
68 finishJSTest();
69 }
70
71 runTest();
72
73 </script>
74
75 </body>
76 </html>
OLDNEW
« no previous file with comments | « LayoutTests/webaudio/dom-exceptions-expected.txt ('k') | LayoutTests/webaudio/realtimeanalyser-basic-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698