5 <script src="../fast/js/resources/js-test-pre.js"></script>
6 <script src="resources/audio-testing.js"></script>
10 <div id="description"></div>
11 <div id="console"></div>
14 description("Test that re-sizing the FFT arrays does not fail.");
16 if (window.testRunner) {
17 testRunner.dumpAsText();
18 testRunner.waitUntilDone();
21 var doTest = function(fftSize, illegal) {
22 var c = new webkitOfflineAudioContext(1, 1000, 44100);
23 var a = c.createAnalyser();
27 testFailed("No exception thrown for illegal fftSize " + fftSize + ".");
29 testPassed("Successfully set legal fftSize " + fftSize + ".");
31 testPassed("Exception thrown for illegal fftSize " + fftSize + ".");
33 // This arbitrary size does not affect the correctness of the test.
34 var arr = new Float32Array(100);
35 a.getFloatFrequencyData(arr);
41 for (var i = 2; i <= 0x20000; i *= 2) {
42 if (i >= 32 && i <= 2048)
49 if (window.testRunner)
50 testRunner.notifyDone();
51 testPassed("webkitAudioContext survived multiple invalid FFT array resizings.");
54 <script src="../fast/js/resources/js-test-post.js"></script>