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

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

Issue 329093002: Allow PeerConnection to be garbage collected after close(). (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Code review. 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-stats.html
diff --git a/LayoutTests/fast/mediastream/RTCPeerConnection-stats.html b/LayoutTests/fast/mediastream/RTCPeerConnection-stats.html
index e7953fe61a35f4c9e999e64261bf06f5e9407cf8..1cc9089b24ea2f5d202094a8567b119f038ff879 100644
--- a/LayoutTests/fast/mediastream/RTCPeerConnection-stats.html
+++ b/LayoutTests/fast/mediastream/RTCPeerConnection-stats.html
@@ -27,26 +27,8 @@ function error() {
finishJSTest();
}
-function statsHandler1(status)
-{
- testPassed("statsHandler1 was called");
- shouldBeNonNull('status');
- result = status.result();
- shouldBe('result.length', '0');
- shouldNotThrow('getUserMedia({audio:true, video:true}, gotStream)');
-}
-
-function gotStream(s) {
- testPassed('Got a stream.');
- stream = s;
-
- pc.addStream(stream);
- shouldNotThrow('pc.getStats(statsHandler2)');
-}
-
-function statsHandler2(status)
+function verifyStats(status)
{
- testPassed("statsHandler2 was called");
// Status must be a global variable to be used in test statements.
status_g = status;
result = status.result();
@@ -76,6 +58,37 @@ function statsHandler2(status)
// Named getter: Can access results by their ID values.
shouldBeNonNull('status_g.namedItem(res.id)');
shouldBeNonNull('status_g[res.id]');
+}
+
+function statsHandler1(status)
+{
+ testPassed("statsHandler1 was called");
+ shouldBeNonNull('status');
+ result = status.result();
+ shouldBe('result.length', '0');
+ shouldNotThrow('getUserMedia({audio:true, video:true}, gotStream)');
+}
+
+function gotStream(s) {
+ testPassed('Got a stream.');
+ stream = s;
+
+ pc.addStream(stream);
+ shouldNotThrow('pc.getStats(statsHandler2)');
+}
+
+function statsHandler2(status)
+{
+ testPassed("statsHandler2 was called");
+ verifyStats(status);
+ shouldNotThrow('pc.close()');
+ shouldNotThrow('pc.getStats(statsHandler3)');
+}
+
+function statsHandler3(status)
+{
+ testPassed("statsHandler3 was called");
+ verifyStats(status);
finishJSTest();
}

Powered by Google App Engine
This is Rietveld 408576698