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

Unified Diff: third_party/WebKit/LayoutTests/netinfo/gc-frame-listeners.html

Issue 1950613005: Fixes tests that use internals.observeGC to work with Ignition. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removed special wrapper for internals.observeGC. Adds an inner function to pass the object. Created 4 years, 7 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/netinfo/gc-frame-listeners.html
diff --git a/third_party/WebKit/LayoutTests/netinfo/gc-frame-listeners.html b/third_party/WebKit/LayoutTests/netinfo/gc-frame-listeners.html
index 10ec4fb82fc8bd698b73ada8174b9d071dd83fdf..1112ed393c207bd74941034a63baff0fe5440d1c 100644
--- a/third_party/WebKit/LayoutTests/netinfo/gc-frame-listeners.html
+++ b/third_party/WebKit/LayoutTests/netinfo/gc-frame-listeners.html
@@ -12,17 +12,29 @@ shouldBe('typeof window.internals.observeGC', '"function"',
'this test requires window.internals');
var childFrame = document.createElement('iframe');
-var childFrameObserver = internals.observeGC(childFrame);
+// Do not pass the object directly to observeGC function. This may
+// remain live on this function's stack preventing GC from collecting
+// it. Accessing the object inside an inner function will prevent any
+// unneeded references on this function's stack.
+var childFrameObserver = internals.observeGC((() => {return childFrame;})());
document.body.appendChild(childFrame);
var childConnection = childFrame.contentWindow.navigator.connection;
-var childConnectionObserver = internals.observeGC(childConnection);
+// Do not pass the object directly to observeGC function. This may
+// remain live on this function's stack preventing GC from collecting
+// it. Accessing the object inside an inner function will prevent any
+// unneeded references on this function's stack.
+var childConnectionObserver = internals.observeGC((() => {return childConnection;})());
var callback = function(e) {
testFailed("Should not get here.");
};
-var callbackObserver = internals.observeGC(callback);
+// Do not pass the object directly to observeGC function. This may
+// remain live on this function's stack preventing GC from collecting
+// it. Accessing the object inside an inner function will prevent any
+// unneeded references on this function's stack.
+var callbackObserver = internals.observeGC((() => {return callback;})());
// Add the event listener and make sure it doesn't get collected.
childConnection.addEventListener('typechange', callback);

Powered by Google App Engine
This is Rietveld 408576698