summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjochen@chromium.org <jochen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-11-27 13:41:33 +0000
committerjochen@chromium.org <jochen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-11-27 13:41:33 +0000
commit947e96a18fdffe3dd74d9858760d8910e08a617a (patch)
tree0b469813716be45e139d8f55537b58c4d86de57a
parent6e0ab4c3e48db23edc2d00ab1925d2b175140dce (diff)
downloadchromium_src-947e96a18fdffe3dd74d9858760d8910e08a617a.zip
chromium_src-947e96a18fdffe3dd74d9858760d8910e08a617a.tar.gz
chromium_src-947e96a18fdffe3dd74d9858760d8910e08a617a.tar.bz2
[content shell] make sure we ran the main runner at least once and shut it down properly
BUG=111316,162619 TEST=content shell --check-layout-test-sys-deps doesn't hang on mac R=marja@chromium.org Review URL: https://chromiumcodereview.appspot.com/11412191 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@169651 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--content/shell/shell_browser_main.cc10
1 files changed, 10 insertions, 0 deletions
diff --git a/content/shell/shell_browser_main.cc b/content/shell/shell_browser_main.cc
index 8447c9c..5a2761f 100644
--- a/content/shell/shell_browser_main.cc
+++ b/content/shell/shell_browser_main.cc
@@ -11,6 +11,7 @@
#include "base/file_util.h"
#include "base/logging.h"
#include "base/memory/scoped_ptr.h"
+#include "base/message_loop.h"
#include "base/sys_string_conversions.h"
#include "base/threading/thread_restrictions.h"
#include "base/utf_string_conversions.h"
@@ -98,6 +99,9 @@ int ShellBrowserMain(const content::MainFunctionParams& parameters) {
if (CommandLine::ForCurrentProcess()->HasSwitch(
switches::kCheckLayoutTestSysDeps)) {
+ MessageLoop::current()->PostTask(FROM_HERE, MessageLoop::QuitClosure());
+ main_runner_->Run();
+ main_runner_->Shutdown();
return 0;
}
@@ -110,6 +114,7 @@ int ShellBrowserMain(const content::MainFunctionParams& parameters) {
CommandLine::StringVector args =
CommandLine::ForCurrentProcess()->GetArgs();
size_t command_line_position = 0;
+ bool ran_at_least_once = false;
#if defined(OS_ANDROID)
std::cout << "#READY\n";
@@ -132,11 +137,16 @@ int ShellBrowserMain(const content::MainFunctionParams& parameters) {
break;
}
+ ran_at_least_once = true;
main_runner_->Run();
if (!content::WebKitTestController::Get()->ResetAfterLayoutTest())
break;
}
+ if (!ran_at_least_once) {
+ MessageLoop::current()->PostTask(FROM_HERE, MessageLoop::QuitClosure());
+ main_runner_->Run();
+ }
exit_code = 0;
} else {
exit_code = main_runner_->Run();