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

Unified Diff: LayoutTests/fast/mediastream/RTCPeerConnection-lifetime.html

Issue 329093002: Allow PeerConnection to be garbage collected after close(). (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase Created 6 years, 6 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: LayoutTests/fast/mediastream/RTCPeerConnection-lifetime.html
diff --git a/LayoutTests/fast/mediastream/RTCPeerConnection-lifetime.html b/LayoutTests/fast/mediastream/RTCPeerConnection-lifetime.html
index 076e0d3e553f4cacd149eb520ef97d93f59698a3..9e9ac3f37465ab69f8ecb7a963010268c07a8fea 100644
--- a/LayoutTests/fast/mediastream/RTCPeerConnection-lifetime.html
+++ b/LayoutTests/fast/mediastream/RTCPeerConnection-lifetime.html
@@ -24,7 +24,7 @@ function dataChannelOpen()
shouldNotThrow("dc.send('xyzzy');");
}
-function createPeerConnection()
+function createPeerConnectionAndDataChannel()
{
// The Peer Connection object is leaked
var pc = new webkitRTCPeerConnection({iceServers:[]}, null);
@@ -32,7 +32,24 @@ function createPeerConnection()
dc.onopen = dataChannelOpen;
}
-createPeerConnection();
+// Test that the PeerConnection object is gc'd if close is called.
+var pcA = new webkitRTCPeerConnection(null, null);
+observationA = internals.observeGC(pcA);
+pcA.close();
+pcA = null;
+gc();
+shouldBeTrue('observationA.wasCollected');
+observationA = null;
+
+// Test that the PeerConnection object is not gc'd if close is not called.
haraken 2014/06/15 13:43:57 I'm fine with this behavior, but I'm a bit concern
Henrik Grunell 2014/06/16 07:48:59 Agree. The proposed spec change only says that it
+var pcB = new webkitRTCPeerConnection(null, null);
+observationB = internals.observeGC(pcB);
+pcB = null;
+gc();
+shouldBeFalse('observationB.wasCollected');
+observationB = null;
+
+createPeerConnectionAndDataChannel();
gc();
window.jsTestIsAsync = true;

Powered by Google App Engine
This is Rietveld 408576698