Index: content/browser/browser_main_runner.cc |
diff --git a/content/browser/browser_main_runner.cc b/content/browser/browser_main_runner.cc |
index 67263fe61128b75033f48c62c99e085e530c2145..ab548c6c06495bda8c2cd016b173a9f1d9b6ce40 100644 |
--- a/content/browser/browser_main_runner.cc |
+++ b/content/browser/browser_main_runner.cc |
@@ -293,7 +293,8 @@ class BrowserMainRunnerImpl : public BrowserMainRunner { |
// Forcefully terminates the RunLoop inside MessagePumpForUI, ensuring |
// proper shutdown for content_browsertests. Shutdown() is not used by |
// the actual browser. |
- base::MessageLoop::current()->QuitNow(); |
+ if (base::MessageLoop::current()->is_running()) |
+ base::MessageLoop::current()->QuitNow(); |
#endif |
main_loop_.reset(NULL); |