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

Unified Diff: base/test/ios/wait_util.h

Issue 2358633002: Remove call to MessageLoop::RunUntilIdle from wait_util.mm. (Closed)
Patch Set: add todos Created 4 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
« no previous file with comments | « no previous file | base/test/ios/wait_util.mm » ('j') | base/test/ios/wait_util.mm » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/test/ios/wait_util.h
diff --git a/base/test/ios/wait_util.h b/base/test/ios/wait_util.h
index e32511ac5d1e487bb13b4f3f5492d64754de72df..d938bd97dc121bd1338551ee8ae5c7a54a2d6440 100644
--- a/base/test/ios/wait_util.h
+++ b/base/test/ios/wait_util.h
@@ -15,26 +15,21 @@ class MessageLoop;
namespace test {
namespace ios {
-// Returns the time spent in running |action| plus waiting until |condition| is
-// met.
-// Performs |action| and then spins run loop and runs the |message_loop| until
-// |condition| block returns true.
-// |action| may be nil if no action needs to be performed before the wait loop.
-// |message_loop| can be null if there is no need to spin the message loop.
-// |condition| may be nil if there is no condition to wait for: the run loop
-// will spin until timeout is reached.
-// |timeout| parameter sets the maximum wait time. If |timeout| is zero,
-// a reasonable default will be used.
+// Runs |action| if non-nil. Then, until either |condition| is true or |timeout|
+// expires, repetitively runs the current NSRunLoop and the current MessageLoop
+// (if |run_message_loop| is true). |condition| may be nil if there is no
+// condition to wait for; the NSRunLoop and current MessageLoop will be run run
+// until |timeout| expires. DCHECKs if |condition| is non-nil and |timeout|
+// expires before |condition| becomes true. If |timeout| is zero, a reasonable
+// default is used. Returns the time spent in the function.
TimeDelta TimeUntilCondition(ProceduralBlock action,
ConditionBlock condition,
- MessageLoop* message_loop,
+ bool run_message_loop,
TimeDelta timeout);
-// Waits until |condition| is met. A |message_loop| to spin and a |timeout| can
-// be optionally passed; if |timeout| is zero, a reasonable default will be
-// used.
+// Same as TimeUntilCondition, but doesn't run an action.
void WaitUntilCondition(ConditionBlock condition,
- MessageLoop* message_loop,
+ bool run_message_loop,
TimeDelta timeout);
void WaitUntilCondition(ConditionBlock condition);
@@ -48,6 +43,19 @@ void SpinRunLoopWithMaxDelay(TimeDelta max_delay);
// elapsed.
void SpinRunLoopWithMinDelay(TimeDelta min_delay);
+// Deprecated.
+// TODO(fdoray): Remove this once call have been removed from ios_internal.
+TimeDelta TimeUntilCondition(ProceduralBlock action,
+ ConditionBlock condition,
+ MessageLoop* message_loop,
+ TimeDelta timeout);
+
+// Deprecated.
+// TODO(fdoray): Remove this once call have been removed from ios_internal.
+void WaitUntilCondition(ConditionBlock condition,
+ MessageLoop* message_loop,
+ TimeDelta timeout);
+
} // namespace ios
} // namespace test
} // namespace base
« no previous file with comments | « no previous file | base/test/ios/wait_util.mm » ('j') | base/test/ios/wait_util.mm » ('J')

Powered by Google App Engine
This is Rietveld 408576698