2 <script src=
"../resources/js-test.js"></script>
4 description('Cycles of AudioNode connections should be collected.');
5 var context
= new OfflineAudioContext(2, 44100, 44100);
7 var initialCount
= internals
.audioHandlerCount();
9 debug('A cycle was created:');
10 shouldBeTrue('internals.audioHandlerCount() > initialCount');
12 debug('GC happened:');
13 shouldBe('internals.audioHandlerCount()', 'initialCount');
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
);