| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <html> | 2 <html> |
| 3 <head> | 3 <head> |
| 4 <script src="../resources/js-test.js"></script> | 4 <script src="../resources/js-test.js"></script> |
| 5 <script src="resources/compatibility.js"></script> | 5 <script src="resources/compatibility.js"></script> |
| 6 </head> | 6 </head> |
| 7 <body> | 7 <body> |
| 8 <script> | 8 <script> |
| 9 description("Tests the OfflineAudioContext constructor"); | 9 description("Tests the OfflineAudioContext constructor"); |
| 10 | 10 |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 shouldNotThrow("context = new OfflineAudioContext(2, 512, 48000)"); | 27 shouldNotThrow("context = new OfflineAudioContext(2, 512, 48000)"); |
| 28 shouldBeEqualToNumber("context.length", 512); | 28 shouldBeEqualToNumber("context.length", 512); |
| 29 shouldNotThrow("context = new OfflineAudioContext(2, 512, 88200)"); | 29 shouldNotThrow("context = new OfflineAudioContext(2, 512, 88200)"); |
| 30 shouldBeEqualToNumber("context.length", 512); | 30 shouldBeEqualToNumber("context.length", 512); |
| 31 // Make sure length is read-only. | 31 // Make sure length is read-only. |
| 32 shouldNotThrow("context.length = 99"); | 32 shouldNotThrow("context.length = 99"); |
| 33 shouldBeEqualToNumber("context.length", 512); | 33 shouldBeEqualToNumber("context.length", 512); |
| 34 shouldNotThrow("context = new OfflineAudioContext(2, 512, 96000)"); | 34 shouldNotThrow("context = new OfflineAudioContext(2, 512, 96000)"); |
| 35 // Make sure we throw exceptions for non-finite sample rates. | 35 // Make sure we throw exceptions for non-finite sample rates. |
| 36 shouldThrow("context = new OfflineAudioContext(1, 0, NaN)"); | 36 shouldThrow("context = new OfflineAudioContext(1, 0, NaN)"); |
| 37 shouldThrow("context = new OfflineAudioContext(1, 0, Infinite)"); | 37 shouldThrow("context = new OfflineAudioContext(1, 0, Infinity)"); |
| 38 // Verify channel counts and other destination attributes are set correctly. |
| 39 shouldNotThrow("context = new OfflineAudioContext(7, 512, 48000)"); |
| 40 shouldBeEqualToNumber("context.destination.channelCount", 7); |
| 41 shouldBeEqualToNumber("context.destination.maxChannelCount", 7); |
| 42 shouldBeEqualToString("context.destination.channelCountMode", "explicit"); |
| 43 shouldBeEqualToString("context.destination.channelInterpretation", "speakers"); |
| 38 </script> | 44 </script> |
| 39 </body> | 45 </body> |
| 40 </html> | 46 </html> |
| OLD | NEW |