| Index: content/public/test/test_utils.h
|
| diff --git a/content/public/test/test_utils.h b/content/public/test/test_utils.h
|
| index d479eb5afe1a0636b1a8be1db6e412c6c37989e7..e6bbc56298be5394090bb8fe8d50b2780b29b9e4 100644
|
| --- a/content/public/test/test_utils.h
|
| +++ b/content/public/test/test_utils.h
|
| @@ -89,9 +89,19 @@ bool RegisterJniForTesting(JNIEnv* env);
|
| // Helper class to Run and Quit the message loop. Run and Quit can only happen
|
| // once per instance. Make a new instance for each use. Calling Quit after Run
|
| // has returned is safe and has no effect.
|
| +// Note that by default Quit does not quit immediately. If that is not what you
|
| +// really need, pass QuitMode::IMMEDIATE in the constructor.
|
| class MessageLoopRunner : public base::RefCounted<MessageLoopRunner> {
|
| public:
|
| - MessageLoopRunner();
|
| + enum class QuitMode {
|
| + // Message loop stops after finishing the current task.
|
| + IMMEDIATE,
|
| +
|
| + // Several generations of posted tasks are executed before stopping.
|
| + DEFERRED,
|
| + };
|
| +
|
| + MessageLoopRunner(QuitMode mode = QuitMode::DEFERRED);
|
|
|
| // Run the current MessageLoop unless the quit closure
|
| // has already been called.
|
| @@ -113,6 +123,8 @@ class MessageLoopRunner : public base::RefCounted<MessageLoopRunner> {
|
| friend class base::RefCounted<MessageLoopRunner>;
|
| ~MessageLoopRunner();
|
|
|
| + QuitMode quit_mode_;
|
| +
|
| // True when the message loop is running.
|
| bool loop_running_;
|
|
|
|
|