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

Unified Diff: talk/app/webrtc/java/testcommon/src/org/webrtc/PeerConnectionTest.java

Issue 1308733004: Android: Fix memory leak for remote MediaStream (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 5 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: talk/app/webrtc/java/testcommon/src/org/webrtc/PeerConnectionTest.java
diff --git a/talk/app/webrtc/java/testcommon/src/org/webrtc/PeerConnectionTest.java b/talk/app/webrtc/java/testcommon/src/org/webrtc/PeerConnectionTest.java
index 5133723ea6ee1a028b450cce09ce8144053fdcc7..627fd520889dbca213022946328506d9c5eaf656 100644
--- a/talk/app/webrtc/java/testcommon/src/org/webrtc/PeerConnectionTest.java
+++ b/talk/app/webrtc/java/testcommon/src/org/webrtc/PeerConnectionTest.java
@@ -700,9 +700,9 @@ public class PeerConnectionTest {
// Free the Java-land objects, collect them, and sleep a bit to make sure we
// don't get late-arrival crashes after the Java-land objects have been
// freed.
- shutdownPC(offeringPC, offeringExpectations);
+ shutdownPC(offeringPC, offeringExpectations, "answeredMediaStream");
offeringPC = null;
- shutdownPC(answeringPC, answeringExpectations);
+ shutdownPC(answeringPC, answeringExpectations, "offeredMediaStream");
answeringPC = null;
videoSource.dispose();
factory.dispose();
@@ -710,7 +710,7 @@ public class PeerConnectionTest {
}
private static void shutdownPC(
- PeerConnection pc, ObserverExpectations expectations) {
+ PeerConnection pc, ObserverExpectations expectations, String removeStreamLabel) {
expectations.dataChannel.unregisterObserver();
expectations.dataChannel.dispose();
expectations.expectStatsCallback();
@@ -735,7 +735,9 @@ public class PeerConnectionTest {
assertEquals(1, reportIndex);
System.out.println("End stats.");
+ expectations.expectRemoveStream(removeStreamLabel);
pc.dispose();
+ expectations.waitForAllExpectationsToBeSatisfied();
}
// Returns a set of thread IDs belonging to this process, as Strings.

Powered by Google App Engine
This is Rietveld 408576698