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

Unified 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 side-by-side diff with in-line comments
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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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>
« 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