Refactoring: Pull all fullscreen code out of Document and into its own helper class
[WebKit-https.git] / LayoutTests / webaudio / analyser-exception.html
1 <!DOCTYPE html>
2
3 <html>
4 <head>
5 <script src="../resources/js-test.js"></script>
6 <script src="resources/audio-testing.js"></script>
7 <script src="resources/audiobuffersource-testing.js"></script>
8 </head>
9
10 <body>
11
12 <div id="description"></div>
13 <div id="console"></div>
14
15 <script>
16 description("Tests that AnalyserNode validates minDecibels, maxDecibels and smoothingTimeConstant values.");
17
18 var analyser;
19
20 function runTest() {
21     window.jsTestIsAsync = true;
22
23     var sampleRate = 44100.0;
24     var numberOfFrames = 32;
25     var context = new webkitOfflineAudioContext(1, numberOfFrames, sampleRate);
26     analyser = context.createAnalyser();
27     analyser.connect(context.destination);
28
29     // 'minDecibels' shouldn't be greater than 'maxDecibels' which defaults to -30dB.
30     shouldThrowErrorName("analyser.minDecibels = -20", "IndexSizeError");
31
32     // 'maxDecibels' shouldn't be less than 'minDecibels' which defaults to -100dB.
33     shouldThrowErrorName("analyser.maxDecibels = -120", "IndexSizeError");
34
35     // 'smoothingTimeConstant' range is between 0 and 1.
36     shouldThrowErrorName("analyser.smoothingTimeConstant = 2", "IndexSizeError");
37
38     context.oncomplete = finishJSTest;
39     context.startRendering();
40 }
41
42 runTest();
43
44 </script>
45 </body>
46 </html>