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 /content/public | |
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 'content/public')
-rw-r--r-- | content/public/common/mojo_shell_connection.h | 3 | ||||
-rw-r--r-- | content/public/test/test_launcher.cc | 6 | ||||
-rw-r--r-- | content/public/test/test_launcher.h | 5 |
3 files changed, 13 insertions, 1 deletions
diff --git a/content/public/common/mojo_shell_connection.h b/content/public/common/mojo_shell_connection.h index 7077dce..6ae92bbe 100644 --- a/content/public/common/mojo_shell_connection.h +++ b/content/public/common/mojo_shell_connection.h @@ -59,6 +59,9 @@ class CONTENT_EXPORT MojoShellConnection { // a shell embedded in the browser process (false). virtual bool UsingExternalShell() const = 0; + // Sets a closure that is called when the connection is lost. + virtual void SetConnectionLostClosure(const base::Closure& closure) = 0; + // [De]Register an impl of Listener that will be consulted when the wrapped // ShellConnection exposes services to inbound connections. // Registered listeners are owned by this MojoShellConnection. diff --git a/content/public/test/test_launcher.cc b/content/public/test/test_launcher.cc index 183d82a..4b578d8 100644 --- a/content/public/test/test_launcher.cc +++ b/content/public/test/test_launcher.cc @@ -472,6 +472,8 @@ scoped_ptr<TestState> TestLauncherDelegate::PreRunTest( return nullptr; } +void TestLauncherDelegate::OnDoneRunningTests() {} + TestLauncherDelegate::~TestLauncherDelegate() { } @@ -541,7 +543,9 @@ int LaunchTests(TestLauncherDelegate* launcher_delegate, WrapperTestLauncherDelegate delegate(launcher_delegate); base::TestLauncher launcher(&delegate, default_jobs); - return (launcher.Run() ? 0 : 1); + const int result = launcher.Run() ? 0 : 1; + launcher_delegate->OnDoneRunningTests(); + return result; } TestLauncherDelegate* GetCurrentTestLauncherDelegate() { diff --git a/content/public/test/test_launcher.h b/content/public/test/test_launcher.h index 117c658..67b711b 100644 --- a/content/public/test/test_launcher.h +++ b/content/public/test/test_launcher.h @@ -64,6 +64,11 @@ class TestLauncherDelegate { // when --test-launcher-jobs isn't specified on the command-line. virtual void AdjustDefaultParallelJobs(int* default_jobs) {} + // Called prior to returning from LaunchTests(). Gives the delegate a chance + // to do cleanup before state created by TestLauncher has been destroyed (such + // as the AtExitManager). + virtual void OnDoneRunningTests(); + protected: virtual ~TestLauncherDelegate(); }; |