| OLD | NEW |
| (Empty) |
| 1 <!DOCTYPE html> | |
| 2 <script src="../resources/js-test.js"></script> | |
| 3 <script> | |
| 4 description('Cycles of AudioNode connections should be collected.'); | |
| 5 var context = new OfflineAudioContext(2, 44100, 44100); | |
| 6 gc(); | |
| 7 var initialCount = internals.audioHandlerCount(); | |
| 8 createCycle(); | |
| 9 debug('A cycle was created:'); | |
| 10 shouldBeTrue('internals.audioHandlerCount() > initialCount'); | |
| 11 gc(); | |
| 12 debug('GC happened:'); | |
| 13 shouldBe('internals.audioHandlerCount()', 'initialCount'); | |
| 14 | |
| 15 function createCycle() { | |
| 16 var source = context.createBufferSource(); | |
| 17 var delay1 = context.createDelay(); | |
| 18 var delay2 = context.createDelay(); | |
| 19 source.connect(delay1); | |
| 20 delay1.connect(delay2); | |
| 21 delay2.connect(delay1); | |
| 22 delay1.connect(context.destination); | |
| 23 } | |
| 24 </script> | |
| OLD | NEW |