diff options
author | sky <sky@chromium.org> | 2016-03-23 09:38:54 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-03-23 16:40:09 +0000 |
commit | 220db613792b3fa65361e478ddd00da753e7aa7c (patch) | |
tree | c71297165d36c6d98b70137052adf81e22b8627d /mojo/shell/standalone | |
parent | 1acaec61288e7110f0be642eab959414a8078b7e (diff) | |
download | chromium_src-220db613792b3fa65361e478ddd00da753e7aa7c.zip chromium_src-220db613792b3fa65361e478ddd00da753e7aa7c.tar.gz chromium_src-220db613792b3fa65361e478ddd00da753e7aa7c.tar.bz2 |
Changes to get mash browser_tests shutdown working correctly
. Adds ability to set callback on MojoShellConnection when shell is
lost, and wires through in chrome side to trigger exiting.
. Adds ability for TestLauncherDelegate to be notified after tests
have run. Needed so I can shutdown state while AtExitManager is
valid.
. Made context not attempt to shutdown edk if context did not start
edk.
. Made MashBrowserTestsMain shutdown MojoTestConnector at a time when
it can be shutdown.
BUG=581733
TEST=covered by tests
R=jam@chromium.org
Review URL: https://codereview.chromium.org/1822213002
Cr-Commit-Position: refs/heads/master@{#382864}
Diffstat (limited to 'mojo/shell/standalone')
-rw-r--r-- | mojo/shell/standalone/context.cc | 10 | ||||
-rw-r--r-- | mojo/shell/standalone/context.h | 1 |
2 files changed, 9 insertions, 2 deletions
diff --git a/mojo/shell/standalone/context.cc b/mojo/shell/standalone/context.cc index e64ed82..c036694 100644 --- a/mojo/shell/standalone/context.cc +++ b/mojo/shell/standalone/context.cc @@ -140,7 +140,8 @@ void Context::Init(scoped_ptr<InitParams> init_params) { blocking_pool_ = new base::SequencedWorkerPool(kMaxBlockingPoolThreads, "blocking_pool"); - if (!init_params || init_params->init_edk) { + init_edk_ = !init_params || init_params->init_edk; + if (init_edk_) { edk::InitIPCSupport(this, io_thread_->task_runner().get()); #if defined(OS_MACOSX) edk::SetMachPortProvider(MachBroker::GetInstance()->port_provider()); @@ -210,8 +211,13 @@ void Context::Shutdown() { // loop shutdown. shell_.reset(); - TRACE_EVENT0("mojo_shell", "Context::Shutdown"); DCHECK_EQ(base::MessageLoop::current()->task_runner(), shell_runner_); + + // If we didn't initialize the edk we should not shut it down. + if (!init_edk_) + return; + + TRACE_EVENT0("mojo_shell", "Context::Shutdown"); // Post a task in case OnShutdownComplete is called synchronously. base::MessageLoop::current()->PostTask(FROM_HERE, base::Bind(edk::ShutdownIPCSupport)); diff --git a/mojo/shell/standalone/context.h b/mojo/shell/standalone/context.h index 3c25027..fee1e5a 100644 --- a/mojo/shell/standalone/context.h +++ b/mojo/shell/standalone/context.h @@ -75,6 +75,7 @@ class Context : public edk::ProcessDelegate { scoped_ptr<catalog::Factory> catalog_; scoped_ptr<Shell> shell_; base::Time main_entry_time_; + bool init_edk_ = false; DISALLOW_COPY_AND_ASSIGN(Context); }; |