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

Unified Diff: third_party/WebKit/LayoutTests/fast/mediastream/RTCPeerConnection-lifetime.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/fast/mediastream/RTCPeerConnection-lifetime.html
diff --git a/third_party/WebKit/LayoutTests/fast/mediastream/RTCPeerConnection-lifetime.html b/third_party/WebKit/LayoutTests/fast/mediastream/RTCPeerConnection-lifetime.html
index 8ca415eb4af0955a8ec72206dbdaeef84b8889f2..7991384ffa2d53790831a0661c588aee61010bae 100644
--- a/third_party/WebKit/LayoutTests/fast/mediastream/RTCPeerConnection-lifetime.html
+++ b/third_party/WebKit/LayoutTests/fast/mediastream/RTCPeerConnection-lifetime.html
@@ -35,7 +35,11 @@ var observationB = null;
// Test that the PeerConnection object is gc'd if close is called.
var pcA = new webkitRTCPeerConnection(null, null);
-var observationA = internals.observeGC(pcA);
+// 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 observationA = internals.observeGC((() => {return pcA;})());
pcA.close();
pcA = null;
asyncGC(function() {
@@ -44,7 +48,11 @@ asyncGC(function() {
// Test that the PeerConnection object is not gc'd if close is not called.
pcB = new webkitRTCPeerConnection(null, null);
- observationB = internals.observeGC(pcB);
+ // 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.
+ observationB = internals.observeGC((() => {return pcB;})());
pcB = null;
asyncGC(function() {
shouldBeFalse('observationB.wasCollected');

Powered by Google App Engine
This is Rietveld 408576698