Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(57)

Side by Side Diff: third_party/WebKit/LayoutTests/webaudio/AudioNode/cycle-connection-gc.html

Issue 2717723002: Convert Audio/cycle-connection-gc test to testharness (Closed)
Patch Set: Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/webaudio/AudioNode/cycle-connection-gc-expected.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <script src="../../resources/js-test.js"></script> 2 <script src="../../resources/testharness.js"></script>
3 <script src="../../resources/testharnessreport.js"></script>
4 <script src="../resources/audit-util.js"></script>
5 <script src="../resources/audit.js"></script>
3 <script> 6 <script>
4 description('Cycles of AudioNode connections should be collected.'); 7 let audit = Audit.createTaskRunner();
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 8
15 function createCycle() { 9 audit.define(
16 var source = context.createBufferSource(); 10 {
17 var delay1 = context.createDelay(); 11 label: 'test',
18 var delay2 = context.createDelay(); 12 description: 'Cycles of AudioNode connections should be collected'
19 source.connect(delay1); 13 },
20 delay1.connect(delay2); 14 (task, should) => {
21 delay2.connect(delay1); 15 var context = new OfflineAudioContext(2, 44100, 44100);
22 delay1.connect(context.destination); 16 should(() => gc(), 'Initial GC').notThrow();
17 var initialCount = internals.audioHandlerCount();
18 should(() => createCycle(context), 'Creating a cycle in the audio graph')
19 .notThrow();
20 should(
21 internals.audioHandlerCount(),
22 'Before GC, internals.audioHandlerCount()')
23 .beGreaterThan(initialCount);
24 should(() => gc(), 'GC happened').notThrow();
25 should(
26 internals.audioHandlerCount(),
27 'After GC, internals.audioHandlerCount()')
28 .beEqualTo(initialCount);
29 task.done();
30 });
31
32 audit.run();
33
34 function createCycle(context) {
35 var source = context.createBufferSource();
36 var delay1 = context.createDelay();
37 var delay2 = context.createDelay();
38 source.connect(delay1);
39 delay1.connect(delay2);
40 delay2.connect(delay1);
41 delay1.connect(context.destination);
23 } 42 }
24 </script> 43 </script>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/webaudio/AudioNode/cycle-connection-gc-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698