5 <script src=
"../resources/js-test.js"></script>
6 <script src=
"resources/compatibility.js"></script>
7 <script src=
"resources/audio-testing.js"></script>
11 <div id=
"description"></div>
12 <div id=
"console"></div>
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();
28 testFailed("No exception thrown for illegal fftSize " + fftSize
+ ".");
30 testPassed("Successfully set legal fftSize " + fftSize
+ ".");
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
);
42 for (var i
= 2; i
<= 0x20000; i
*= 2) {
43 if (i
>= 32 && i
<= 32768)
50 if (window
.testRunner
)
51 testRunner
.notifyDone();
52 testPassed("AudioContext survived multiple invalid FFT array resizings.");