Index: talk/app/webrtc/objctests/RTCPeerConnectionTest.mm |
diff --git a/talk/app/webrtc/objctests/RTCPeerConnectionTest.mm b/talk/app/webrtc/objctests/RTCPeerConnectionTest.mm |
index 050c9f4c95dd61acdacd6b23718e618373a4a88d..73ff30981b74996ab39c2c36e3653123b621354a 100644 |
--- a/talk/app/webrtc/objctests/RTCPeerConnectionTest.mm |
+++ b/talk/app/webrtc/objctests/RTCPeerConnectionTest.mm |
@@ -46,6 +46,8 @@ |
#error "This file requires ARC support." |
#endif |
+const NSTimeInterval kRTCPeerConnectionTestTimeout = 20; |
+ |
@interface RTCFakeRenderer : NSObject <RTCVideoRenderer> |
@end |
@@ -235,8 +237,12 @@ |
[pcOffer addICECandidate:candidate]; |
} |
- [offeringExpectations waitForAllExpectationsToBeSatisfied]; |
- [answeringExpectations waitForAllExpectationsToBeSatisfied]; |
+ EXPECT_TRUE( |
+ [offeringExpectations waitForAllExpectationsToBeSatisfiedWithTimeout: |
+ kRTCPeerConnectionTestTimeout]); |
+ EXPECT_TRUE( |
+ [answeringExpectations waitForAllExpectationsToBeSatisfiedWithTimeout: |
+ kRTCPeerConnectionTestTimeout]); |
EXPECT_EQ(pcOffer.signalingState, RTCSignalingStable); |
EXPECT_EQ(pcAnswer.signalingState, RTCSignalingStable); |
@@ -248,7 +254,9 @@ |
[[RTCDataBuffer alloc] initWithData:textData isBinary:NO]; |
[answeringExpectations expectMessage:[textData copy] isBinary:NO]; |
EXPECT_TRUE([offeringExpectations.dataChannel sendData:buffer]); |
- [answeringExpectations waitForAllExpectationsToBeSatisfied]; |
+ EXPECT_TRUE( |
+ [answeringExpectations waitForAllExpectationsToBeSatisfiedWithTimeout: |
+ kRTCPeerConnectionTestTimeout]); |
// Test send and receive binary data |
const size_t byteLength = 5; |
@@ -257,7 +265,9 @@ |
buffer = [[RTCDataBuffer alloc] initWithData:byteData isBinary:YES]; |
[answeringExpectations expectMessage:[byteData copy] isBinary:YES]; |
EXPECT_TRUE([offeringExpectations.dataChannel sendData:buffer]); |
- [answeringExpectations waitForAllExpectationsToBeSatisfied]; |
+ EXPECT_TRUE( |
+ [answeringExpectations waitForAllExpectationsToBeSatisfiedWithTimeout: |
+ kRTCPeerConnectionTestTimeout]); |
[offeringExpectations expectStateChange:kRTCDataChannelStateClosing]; |
[answeringExpectations expectStateChange:kRTCDataChannelStateClosing]; |
@@ -267,8 +277,12 @@ |
[answeringExpectations.dataChannel close]; |
[offeringExpectations.dataChannel close]; |
- [offeringExpectations waitForAllExpectationsToBeSatisfied]; |
- [answeringExpectations waitForAllExpectationsToBeSatisfied]; |
+ EXPECT_TRUE( |
+ [offeringExpectations waitForAllExpectationsToBeSatisfiedWithTimeout: |
+ kRTCPeerConnectionTestTimeout]); |
+ EXPECT_TRUE( |
+ [answeringExpectations waitForAllExpectationsToBeSatisfiedWithTimeout: |
+ kRTCPeerConnectionTestTimeout]); |
// Don't need to listen to further state changes. |
// TODO(tkchin): figure out why Closed->Closing without this. |
offeringExpectations.dataChannel.delegate = nil; |
@@ -288,8 +302,12 @@ |
[pcOffer close]; |
[pcAnswer close]; |
- [offeringExpectations waitForAllExpectationsToBeSatisfied]; |
- [answeringExpectations waitForAllExpectationsToBeSatisfied]; |
+ EXPECT_TRUE( |
+ [offeringExpectations waitForAllExpectationsToBeSatisfiedWithTimeout: |
+ kRTCPeerConnectionTestTimeout]); |
+ EXPECT_TRUE( |
+ [answeringExpectations waitForAllExpectationsToBeSatisfiedWithTimeout: |
+ kRTCPeerConnectionTestTimeout]); |
capturer = nil; |
videoSource = nil; |