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

Unified Diff: third_party/WebKit/LayoutTests/webaudio/audiocontext-leak.html

Issue 2283053002: Fix BaseAudioContext::hasPendingActivity() to make it GCed correctly (Closed)
Patch Set: Created 4 years, 4 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
Index: third_party/WebKit/LayoutTests/webaudio/audiocontext-leak.html
diff --git a/third_party/WebKit/LayoutTests/webaudio/audiocontext-leak.html b/third_party/WebKit/LayoutTests/webaudio/audiocontext-leak.html
new file mode 100644
index 0000000000000000000000000000000000000000..4d76874a75b240ff97b0bb1281e5f9fafb2c650c
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/webaudio/audiocontext-leak.html
@@ -0,0 +1,37 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <title></title>
+ <script src="../resources/testharness.js"></script>
+ <script src="../resources/testharnessreport.js"></script>
+ <script src="resources/audio-testing.js"></script>
+</head>
+<body>
+ <script>
+ var audioContextObservation;
+
+ var audit = Audit.createTaskRunner();
+
+
+ // Create an instance of AudioContext without JS reference, and observe
+ // if it goes away after the forcible GC.
+ audit.defineTask('observe-leak', function (taskDone) {
+
+ // This layout test requires internal helpers from run-webkit-tests.
+ Should('window.internals', window.internals).exist();
+ Should('window.GCController', window.GCController).exist();
+
+ audioContextObservation = internals.observeGC(new AudioContext());
+ GCController.collectAll();
+
+ Should('audioContextObservation.wasCollected',
+ audioContextObservation.wasCollected).beEqualTo(true);
+
+ taskDone();
+ });
+
+
+ audit.runTasks();
+ </script>
+</body>
+</html>

Powered by Google App Engine
This is Rietveld 408576698