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

Unified Diff: talk/app/webrtc/objctests/RTCPeerConnectionTest.mm

Issue 1361213002: Adding 20-second timeout to Java and Objective-C tests. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 5 years, 3 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/objctests/RTCPeerConnectionTest.mm
diff --git a/talk/app/webrtc/objctests/RTCPeerConnectionTest.mm b/talk/app/webrtc/objctests/RTCPeerConnectionTest.mm
index 050c9f4c95dd61acdacd6b23718e618373a4a88d..1b4412ee3146b6766b7ed040a52c04f057dd04aa 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
+#define TIMEOUT_SECONDS 20
tkchin_webrtc 2015/09/25 15:40:32 Avoid defines, prefer constants. const NSTimeInter
Taylor Brandstetter 2015/09/25 18:01:57 Ah. I wasn't sure how to avoid the constant having
tkchin_webrtc 2015/09/25 19:51:03 Yeh, this is a standard thing in ObjC - just add t
+
@interface RTCFakeRenderer : NSObject <RTCVideoRenderer>
@end
@@ -235,8 +237,10 @@
[pcOffer addICECandidate:candidate];
}
- [offeringExpectations waitForAllExpectationsToBeSatisfied];
- [answeringExpectations waitForAllExpectationsToBeSatisfied];
+ EXPECT_TRUE([offeringExpectations
tkchin_webrtc 2015/09/25 15:40:32 Wouldn't this be a critical failure? Do we want AS
Taylor Brandstetter 2015/09/25 18:01:57 Well, not necessarily. The last time this broke fo
tkchin_webrtc 2015/09/25 19:51:03 Gotcha.
+ waitForAllExpectationsToBeSatisfiedWithTimeout:TIMEOUT_SECONDS]);
+ EXPECT_TRUE([answeringExpectations
+ waitForAllExpectationsToBeSatisfiedWithTimeout:TIMEOUT_SECONDS]);
EXPECT_EQ(pcOffer.signalingState, RTCSignalingStable);
EXPECT_EQ(pcAnswer.signalingState, RTCSignalingStable);
@@ -248,7 +252,8 @@
[[RTCDataBuffer alloc] initWithData:textData isBinary:NO];
[answeringExpectations expectMessage:[textData copy] isBinary:NO];
EXPECT_TRUE([offeringExpectations.dataChannel sendData:buffer]);
- [answeringExpectations waitForAllExpectationsToBeSatisfied];
+ EXPECT_TRUE([answeringExpectations
+ waitForAllExpectationsToBeSatisfiedWithTimeout:TIMEOUT_SECONDS]);
// Test send and receive binary data
const size_t byteLength = 5;
@@ -257,7 +262,8 @@
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:TIMEOUT_SECONDS]);
[offeringExpectations expectStateChange:kRTCDataChannelStateClosing];
[answeringExpectations expectStateChange:kRTCDataChannelStateClosing];
@@ -267,8 +273,10 @@
[answeringExpectations.dataChannel close];
[offeringExpectations.dataChannel close];
- [offeringExpectations waitForAllExpectationsToBeSatisfied];
- [answeringExpectations waitForAllExpectationsToBeSatisfied];
+ EXPECT_TRUE([offeringExpectations
+ waitForAllExpectationsToBeSatisfiedWithTimeout:TIMEOUT_SECONDS]);
+ EXPECT_TRUE([answeringExpectations
+ waitForAllExpectationsToBeSatisfiedWithTimeout:TIMEOUT_SECONDS]);
// Don't need to listen to further state changes.
// TODO(tkchin): figure out why Closed->Closing without this.
offeringExpectations.dataChannel.delegate = nil;
@@ -288,8 +296,10 @@
[pcOffer close];
[pcAnswer close];
- [offeringExpectations waitForAllExpectationsToBeSatisfied];
- [answeringExpectations waitForAllExpectationsToBeSatisfied];
+ EXPECT_TRUE([offeringExpectations
+ waitForAllExpectationsToBeSatisfiedWithTimeout:TIMEOUT_SECONDS]);
+ EXPECT_TRUE([answeringExpectations
+ waitForAllExpectationsToBeSatisfiedWithTimeout:TIMEOUT_SECONDS]);
capturer = nil;
videoSource = nil;

Powered by Google App Engine
This is Rietveld 408576698