| Index: content/public/test/test_utils.cc
|
| diff --git a/content/public/test/test_utils.cc b/content/public/test/test_utils.cc
|
| index cc8757da101ae39a2ac59bc4a86bcdcdf27eabc7..a19a31d5aa36c9d1214c5c91a34c06ce96863b0b 100644
|
| --- a/content/public/test/test_utils.cc
|
| +++ b/content/public/test/test_utils.cc
|
| @@ -208,9 +208,8 @@ bool RegisterJniForTesting(JNIEnv* env) {
|
| }
|
| #endif
|
|
|
| -MessageLoopRunner::MessageLoopRunner()
|
| - : loop_running_(false),
|
| - quit_closure_called_(false) {
|
| +MessageLoopRunner::MessageLoopRunner(QuitMode quit_mode)
|
| + : quit_mode_(quit_mode), loop_running_(false), quit_closure_called_(false) {
|
| }
|
|
|
| MessageLoopRunner::~MessageLoopRunner() = default;
|
| @@ -239,7 +238,14 @@ void MessageLoopRunner::Quit() {
|
|
|
| // Only run the quit task if we are running the message loop.
|
| if (loop_running_) {
|
| - GetQuitTaskForRunLoop(&run_loop_).Run();
|
| + switch (quit_mode_) {
|
| + case QuitMode::DEFERRED:
|
| + GetQuitTaskForRunLoop(&run_loop_).Run();
|
| + break;
|
| + case QuitMode::IMMEDIATE:
|
| + run_loop_.Quit();
|
| + break;
|
| + }
|
| loop_running_ = false;
|
| }
|
| }
|
|
|