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

Unified Diff: webrtc/base/thread.cc

Issue 2927413002: Update VirtualSocketServerTest to use a fake clock. (Closed)
Patch Set: Allow ProcessMessages with cmsLoop of kForever. Created 3 years, 6 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 | « webrtc/base/testclient.cc ('k') | webrtc/base/timeutils.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/base/thread.cc
diff --git a/webrtc/base/thread.cc b/webrtc/base/thread.cc
index 1be5196c7dffbf8325b679c1504f19df1eb7f2b3..9174cd1bd6de531f80d6a200bf3c4afd4498c521 100644
--- a/webrtc/base/thread.cc
+++ b/webrtc/base/thread.cc
@@ -471,6 +471,11 @@ void Thread::Clear(MessageHandler* phandler,
// Note that these methods have a separate implementation for mac and ios
// defined in webrtc/base/thread_darwin.mm.
bool Thread::ProcessMessages(int cmsLoop) {
+ // Using ProcessMessages with a custom clock for testing and a time greater
+ // than 0 doesn't work, since it's not guaranteed to advance the custom
+ // clock's time, and may get stuck in an infinite loop.
+ RTC_DCHECK(GetClockForTesting() == nullptr || cmsLoop == 0 ||
+ cmsLoop == kForever);
int64_t msEnd = (kForever == cmsLoop) ? 0 : TimeAfter(cmsLoop);
int cmsNext = cmsLoop;
« no previous file with comments | « webrtc/base/testclient.cc ('k') | webrtc/base/timeutils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698