| Index: third_party/WebKit/LayoutTests/webaudio/AudioNode/cycle-connection-gc.html
|
| diff --git a/third_party/WebKit/LayoutTests/webaudio/AudioNode/cycle-connection-gc.html b/third_party/WebKit/LayoutTests/webaudio/AudioNode/cycle-connection-gc.html
|
| index 027305026b21916003f911f5da94d124b4b1b08b..a3d77404df1b5b09a9cfccbac4d03e0477dd98ff 100644
|
| --- a/third_party/WebKit/LayoutTests/webaudio/AudioNode/cycle-connection-gc.html
|
| +++ b/third_party/WebKit/LayoutTests/webaudio/AudioNode/cycle-connection-gc.html
|
| @@ -1,24 +1,43 @@
|
| <!DOCTYPE html>
|
| -<script src="../../resources/js-test.js"></script>
|
| +<script src="../../resources/testharness.js"></script>
|
| +<script src="../../resources/testharnessreport.js"></script>
|
| +<script src="../resources/audit-util.js"></script>
|
| +<script src="../resources/audit.js"></script>
|
| <script>
|
| -description('Cycles of AudioNode connections should be collected.');
|
| -var context = new OfflineAudioContext(2, 44100, 44100);
|
| -gc();
|
| -var initialCount = internals.audioHandlerCount();
|
| -createCycle();
|
| -debug('A cycle was created:');
|
| -shouldBeTrue('internals.audioHandlerCount() > initialCount');
|
| -gc();
|
| -debug('GC happened:');
|
| -shouldBe('internals.audioHandlerCount()', 'initialCount');
|
| +let audit = Audit.createTaskRunner();
|
|
|
| -function createCycle() {
|
| - var source = context.createBufferSource();
|
| - var delay1 = context.createDelay();
|
| - var delay2 = context.createDelay();
|
| - source.connect(delay1);
|
| - delay1.connect(delay2);
|
| - delay2.connect(delay1);
|
| - delay1.connect(context.destination);
|
| +audit.define(
|
| + {
|
| + label: 'test',
|
| + description: 'Cycles of AudioNode connections should be collected'
|
| + },
|
| + (task, should) => {
|
| + var context = new OfflineAudioContext(2, 44100, 44100);
|
| + should(() => gc(), 'Initial GC').notThrow();
|
| + var initialCount = internals.audioHandlerCount();
|
| + should(() => createCycle(context), 'Creating a cycle in the audio graph')
|
| + .notThrow();
|
| + should(
|
| + internals.audioHandlerCount(),
|
| + 'Before GC, internals.audioHandlerCount()')
|
| + .beGreaterThan(initialCount);
|
| + should(() => gc(), 'GC happened').notThrow();
|
| + should(
|
| + internals.audioHandlerCount(),
|
| + 'After GC, internals.audioHandlerCount()')
|
| + .beEqualTo(initialCount);
|
| + task.done();
|
| + });
|
| +
|
| +audit.run();
|
| +
|
| +function createCycle(context) {
|
| + var source = context.createBufferSource();
|
| + var delay1 = context.createDelay();
|
| + var delay2 = context.createDelay();
|
| + source.connect(delay1);
|
| + delay1.connect(delay2);
|
| + delay2.connect(delay1);
|
| + delay1.connect(context.destination);
|
| }
|
| </script>
|
|
|