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

Unified Diff: webrtc/base/gunit.h

Issue 2212683002: Do not switch a connection if the new connection is not ready to send packets. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: Merge Created 4 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
« no previous file with comments | « no previous file | webrtc/p2p/base/p2ptransportchannel.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/base/gunit.h
diff --git a/webrtc/base/gunit.h b/webrtc/base/gunit.h
index b087badd94ab5cbd64803db680b4026fcdbec444..c3e853458c87558549869f44c21deba51501d57d 100644
--- a/webrtc/base/gunit.h
+++ b/webrtc/base/gunit.h
@@ -92,23 +92,23 @@
// Wait until "ex" is true, or "timeout" expires, using fake clock where
// messages are processed every millisecond.
-#define SIMULATED_WAIT(ex, timeout, clock) \
- for (int64_t start = rtc::TimeMillis(); \
- !(ex) && rtc::TimeMillis() < start + (timeout);) { \
- clock.AdvanceTime(rtc::TimeDelta::FromMilliseconds(1)); \
+#define SIMULATED_WAIT(ex, timeout, clock) \
+ for (int64_t start = rtc::TimeMillis(); \
+ !(ex) && rtc::TimeMillis() < start + (timeout);) { \
+ (clock).AdvanceTime(rtc::TimeDelta::FromMilliseconds(1)); \
}
// This returns the result of the test in res, so that we don't re-evaluate
// the expression in the XXXX_WAIT macros below, since that causes problems
// when the expression is only true the first time you check it.
-#define SIMULATED_WAIT_(ex, timeout, res, clock) \
- do { \
- int64_t start = rtc::TimeMillis(); \
- res = (ex); \
- while (!res && rtc::TimeMillis() < start + (timeout)) { \
- clock.AdvanceTime(rtc::TimeDelta::FromMilliseconds(1)); \
- res = (ex); \
- } \
+#define SIMULATED_WAIT_(ex, timeout, res, clock) \
+ do { \
+ int64_t start = rtc::TimeMillis(); \
+ res = (ex); \
+ while (!res && rtc::TimeMillis() < start + (timeout)) { \
+ (clock).AdvanceTime(rtc::TimeDelta::FromMilliseconds(1)); \
+ res = (ex); \
+ } \
} while (0)
// The typical EXPECT_XXXX, but done until true or a timeout with a fake clock.
« no previous file with comments | « no previous file | webrtc/p2p/base/p2ptransportchannel.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698