OLD | NEW |
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> | 1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> |
2 | 2 |
3 <!-- | 3 <!-- |
4 Create an oscillator of each type and verify that the type is set correctly. | 4 Create an oscillator of each type and verify that the type is set correctly. |
5 --> | 5 --> |
6 <html> | 6 <html> |
7 <head> | 7 <head> |
8 <link rel="stylesheet" href="../fast/js/resources/js-test-style.css"/> | 8 <link rel="stylesheet" href="../fast/js/resources/js-test-style.css"/> |
9 <script type="text/javascript" src="resources/audio-testing.js"></script> | 9 <script type="text/javascript" src="resources/audio-testing.js"></script> |
10 <script type="text/javascript" src="../fast/js/resources/js-test-pre.js"></scrip
t> | 10 <script type="text/javascript" src="../fast/js/resources/js-test-pre.js"></scrip
t> |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 osc.type = oscTypes[k].integerType; | 55 osc.type = oscTypes[k].integerType; |
56 if (osc.type == oscTypes[k].type) | 56 if (osc.type == oscTypes[k].type) |
57 testPassed("Oscillator correctly set to " + oscTypes[k].name + " typ
e using legacy integer value."); | 57 testPassed("Oscillator correctly set to " + oscTypes[k].name + " typ
e using legacy integer value."); |
58 else | 58 else |
59 testFailed("Oscillator set to " + oscTypes[k].name + " type, but ret
urns " + oscTypes[osc.type].name + " type using legacy integer value."); | 59 testFailed("Oscillator set to " + oscTypes[k].name + " type, but ret
urns " + oscTypes[osc.type].name + " type using legacy integer value."); |
60 } | 60 } |
61 | 61 |
62 // Now set a custom oscillator | 62 // Now set a custom oscillator |
63 var coeffA = new Float32Array([0, 1, 0.5]); | 63 var coeffA = new Float32Array([0, 1, 0.5]); |
64 var coeffB = new Float32Array([0, 0, 0]); | 64 var coeffB = new Float32Array([0, 0, 0]); |
65 var wavetable = context.createWaveTable(coeffA, coeffB); | 65 var wave = context.createPeriodicWave(coeffA, coeffB); |
66 osc.setWaveTable(wavetable); | 66 osc.setPeriodicWave(wave); |
67 if (osc.type == "custom") | 67 if (osc.type == "custom") |
68 testPassed("Oscillator correctly set to CUSTOM type using setWaveTable."
); | 68 testPassed("Oscillator correctly set to CUSTOM type using setPeriodicWav
e."); |
69 else | 69 else |
70 testFailed("Oscillator set to CUSTOM type, but returns " + oscTypes[osc.
type].name + " type."); | 70 testFailed("Oscillator set to CUSTOM type, but returns " + oscTypes[osc.
type].name + " type."); |
71 | 71 |
72 // Try setting some invalid types | 72 // Try setting some invalid types |
73 try { | 73 try { |
74 osc.type = "custom"; | 74 osc.type = "custom"; |
75 testFailed("Directly setting oscillator type to CUSTOM did not throw exc
eption."); | 75 testFailed("Directly setting oscillator type to CUSTOM did not throw exc
eption."); |
76 } catch (e) { | 76 } catch (e) { |
77 testPassed("Directly setting oscillator type to CUSTOM correctly throws
exception."); | 77 testPassed("Directly setting oscillator type to CUSTOM correctly throws
exception."); |
78 } | 78 } |
(...skipping 15 matching lines...) Expand all Loading... |
94 | 94 |
95 runTest(); | 95 runTest(); |
96 successfullyParsed = true; | 96 successfullyParsed = true; |
97 | 97 |
98 </script> | 98 </script> |
99 | 99 |
100 <script src="../fast/js/resources/js-test-post.js"></script> | 100 <script src="../fast/js/resources/js-test-post.js"></script> |
101 | 101 |
102 </body> | 102 </body> |
103 </html> | 103 </html> |
OLD | NEW |