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. |