[WK2] selection does not disappear after coping the text
[framework/web/webkit-efl.git] / LayoutTests / webaudio / realtimeanalyser-fft-sizing.html
1 <!DOCTYPE html>
2
3 <html>
4 <head>
5 <script src="../fast/js/resources/js-test-pre.js"></script>
6 </head>
7
8 <body>
9 <div id="description"></div>
10 <div id="console"></div>
11
12 <script>
13 description("Test that re-sizing the FFT arrays does not fail.");
14
15 if (window.layoutTestController) {
16     layoutTestController.overridePreference("WebKitWebAudioEnabled", "1");
17     layoutTestController.dumpAsText();
18     layoutTestController.waitUntilDone();
19 }
20
21 var doTest = function(fftSize, illegal) {
22     var c = new webkitAudioContext(1, 1000, 44100);
23     var a = c.createAnalyser();
24     try {
25         a.fftSize = fftSize;
26         if (illegal)
27            testFailed("No exception thrown for illegal fftSize " + fftSize + ".");
28         else
29            testPassed("Successfully set legal fftSize " +  fftSize + ".");
30     } catch(e) {
31         testPassed("Exception thrown for illegal fftSize " + fftSize + ".");
32     }
33     // This arbitrary size does not affect the correctness of the test.
34     var arr = new Float32Array(100);
35     a.getFloatFrequencyData(arr);
36 }
37
38 doTest(-1, true);
39 doTest(0, true);
40 doTest(1, true);
41 for (var i = 2; i <= 0x20000; i *= 2) {
42         if (i >= 32 && i <= 2048)
43         doTest(i, false);
44     else
45         doTest(i, true);
46     doTest(i + 1, true);
47 }
48
49 if (window.layoutTestController)
50     layoutTestController.notifyDone();
51 testPassed("webkitAudioContext survived multiple invalid FFT array resizings.");
52 </script>
53
54 <script src="../fast/js/resources/js-test-post.js"></script>
55 </body>
56 </html>