Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4462)

Unified Diff: chrome/test/base/mojo_test_connector.cc

Issue 1822213002: Changes to get mash browser_tests shutdown working correctly (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: order Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/test/base/mojo_test_connector.h ('k') | content/common/mojo/mojo_shell_connection_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/base/mojo_test_connector.cc
diff --git a/chrome/test/base/mojo_test_connector.cc b/chrome/test/base/mojo_test_connector.cc
index 404dd9799d6eb6dd0c3c5a3e337653d74ef76010..3092c9b8f009e21c200c6f436b9ee9717903b7a9 100644
--- a/chrome/test/base/mojo_test_connector.cc
+++ b/chrome/test/base/mojo_test_connector.cc
@@ -19,6 +19,7 @@
#include "mojo/public/cpp/bindings/interface_request.h"
#include "mojo/services/catalog/store.h"
#include "mojo/shell/background/tests/test_catalog_store.h"
+#include "mojo/shell/native_runner_delegate.h"
#include "mojo/shell/public/cpp/connector.h"
#include "mojo/shell/public/cpp/shell_client.h"
#include "mojo/shell/public/cpp/shell_connection.h"
@@ -216,18 +217,38 @@ class MojoTestState : public content::TestState {
} // namespace
+class MojoTestConnector::NativeRunnerDelegateImpl
+ : public mojo::shell::NativeRunnerDelegate {
+ public:
+ NativeRunnerDelegateImpl() {}
+ ~NativeRunnerDelegateImpl() override {}
+
+ private:
+ // mojo::shell::NativeRunnerDelegate:
+ void AdjustCommandLineArgumentsForTarget(
+ const mojo::Identity& target,
+ base::CommandLine* command_line) override {
+ if (target.name() == "exe:chrome")
+ command_line->AppendSwitch(switches::kWaitForMojoShell);
+ }
+
+ DISALLOW_COPY_AND_ASSIGN(NativeRunnerDelegateImpl);
+};
+
// static
const char MojoTestConnector::kTestSwitch[] = "is_test";
MojoTestConnector::MojoTestConnector() {}
mojo::shell::mojom::ShellClientRequest MojoTestConnector::Init() {
+ native_runner_delegate_.reset(new NativeRunnerDelegateImpl);
scoped_ptr<mojo::shell::BackgroundShell::InitParams> init_params(
new mojo::shell::BackgroundShell::InitParams);
init_params->catalog_store = BuildTestCatalogStore();
// When running in single_process mode chrome initializes the edk.
init_params->init_edk = !base::CommandLine::ForCurrentProcess()->HasSwitch(
content::kSingleProcessTestsFlag);
+ init_params->native_runner_delegate = native_runner_delegate_.get();
background_shell_.Init(std::move(init_params));
return background_shell_.CreateShellClientRequest(kTestRunnerName);
}
« no previous file with comments | « chrome/test/base/mojo_test_connector.h ('k') | content/common/mojo/mojo_shell_connection_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698