| 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 <script src="resources/compatibility.js"></script> |
| 8 <script type="text/javascript" src="resources/audio-testing.js"></script> | 9 <script type="text/javascript" src="resources/audio-testing.js"></script> |
| 9 <script type="text/javascript" src="../resources/js-test.js"></script> | 10 <script type="text/javascript" src="../resources/js-test.js"></script> |
| 10 </head> | 11 </head> |
| 11 | 12 |
| 12 <body> | 13 <body> |
| 13 <div id="description"></div> | 14 <div id="description"></div> |
| 14 <div id="console"></div> | 15 <div id="console"></div> |
| 15 | 16 |
| 16 <script> | 17 <script> |
| 17 description("Basic test of setting Oscillator node types."); | 18 description("Basic test of setting Oscillator node types."); |
| (...skipping 10 matching lines...) Expand all Loading... |
| 28 function runTest() | 29 function runTest() |
| 29 { | 30 { |
| 30 if (window.testRunner) { | 31 if (window.testRunner) { |
| 31 testRunner.dumpAsText(); | 32 testRunner.dumpAsText(); |
| 32 testRunner.waitUntilDone(); | 33 testRunner.waitUntilDone(); |
| 33 } | 34 } |
| 34 | 35 |
| 35 window.jsTestIsAsync = true; | 36 window.jsTestIsAsync = true; |
| 36 | 37 |
| 37 // Create offline audio context. | 38 // Create offline audio context. |
| 38 var context = new webkitOfflineAudioContext(2, sampleRate * renderLengthSeco
nds, sampleRate); | 39 var context = new OfflineAudioContext(2, sampleRate * renderLengthSeconds, s
ampleRate); |
| 39 var osc = context.createOscillator(); | 40 var osc = context.createOscillator(); |
| 40 | 41 |
| 41 // Set each possible oscillator type (except CUSTOM) and verify that the typ
e is correct. | 42 // Set each possible oscillator type (except CUSTOM) and verify that the typ
e is correct. |
| 42 // Here we're setting the type using WebIDL enum values which are strings. | 43 // Here we're setting the type using WebIDL enum values which are strings. |
| 43 for (var k = 0; k < oscTypes.length - 1; ++k) { | 44 for (var k = 0; k < oscTypes.length - 1; ++k) { |
| 44 osc.type = oscTypes[k].type; | 45 osc.type = oscTypes[k].type; |
| 45 if (osc.type == oscTypes[k].type) | 46 if (osc.type == oscTypes[k].type) |
| 46 testPassed("Oscillator correctly set to " + oscTypes[k].name + " typ
e."); | 47 testPassed("Oscillator correctly set to " + oscTypes[k].name + " typ
e."); |
| 47 else | 48 else |
| 48 testFailed("Oscillator set to " + oscTypes[k].name + " type, but ret
urns " + oscTypes[osc.type].name + " type."); | 49 testFailed("Oscillator set to " + oscTypes[k].name + " type, but ret
urns " + oscTypes[osc.type].name + " type."); |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 } | 93 } |
| 93 | 94 |
| 94 runTest(); | 95 runTest(); |
| 95 successfullyParsed = true; | 96 successfullyParsed = true; |
| 96 | 97 |
| 97 </script> | 98 </script> |
| 98 | 99 |
| 99 | 100 |
| 100 </body> | 101 </body> |
| 101 </html> | 102 </html> |
| OLD | NEW |