Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / webaudio / realtimeanalyser-fft-sizing.html
blob64a84dac4b39be822d603c59aaf4f6d68067df41
1 <!DOCTYPE html>
3 <html>
4 <head>
5 <script src="../resources/js-test.js"></script>
6 <script src="resources/compatibility.js"></script>
7 <script src="resources/audio-testing.js"></script>
8 </head>
10 <body>
11 <div id="description"></div>
12 <div id="console"></div>
14 <script>
15 description("Test that re-sizing the FFT arrays does not fail.");
17 if (window.testRunner) {
18 testRunner.dumpAsText();
19 testRunner.waitUntilDone();
22 var doTest = function(fftSize, illegal) {
23 var c = new OfflineAudioContext(1, 1000, 44100);
24 var a = c.createAnalyser();
25 try {
26 a.fftSize = fftSize;
27 if (illegal)
28 testFailed("No exception thrown for illegal fftSize " + fftSize + ".");
29 else
30 testPassed("Successfully set legal fftSize " + fftSize + ".");
31 } catch(e) {
32 testPassed("Exception thrown for illegal fftSize " + fftSize + ".");
34 // This arbitrary size does not affect the correctness of the test.
35 var arr = new Float32Array(100);
36 a.getFloatFrequencyData(arr);
39 doTest(-1, true);
40 doTest(0, true);
41 doTest(1, true);
42 for (var i = 2; i <= 0x20000; i *= 2) {
43 if (i >= 32 && i <= 32768)
44 doTest(i, false);
45 else
46 doTest(i, true);
47 doTest(i + 1, true);
50 if (window.testRunner)
51 testRunner.notifyDone();
52 testPassed("AudioContext survived multiple invalid FFT array resizings.");
53 </script>
55 </body>
56 </html>