| Index: ui/views/mus/platform_test_helper_mus.cc
|
| diff --git a/ui/views/mus/platform_test_helper_mus.cc b/ui/views/mus/platform_test_helper_mus.cc
|
| index df87e10ef87e61cee54912c423e6fe33905e064f..01ddeca45efaa844ccf3e5e1fc530f39092caa4e 100644
|
| --- a/ui/views/mus/platform_test_helper_mus.cc
|
| +++ b/ui/views/mus/platform_test_helper_mus.cc
|
| @@ -6,6 +6,7 @@
|
| #include "base/files/file_path.h"
|
| #include "base/memory/ptr_util.h"
|
| #include "base/run_loop.h"
|
| +#include "components/mus/common/switches.h"
|
| #include "services/shell/background/background_shell.h"
|
| #include "services/shell/background/tests/test_catalog_store.h"
|
| #include "services/shell/public/cpp/connector.h"
|
| @@ -21,6 +22,12 @@ using shell::BackgroundShell;
|
| namespace views {
|
| namespace {
|
|
|
| +void EnsureCommandLineSwitch(const std::string& name) {
|
| + base::CommandLine* cmd_line = base::CommandLine::ForCurrentProcess();
|
| + if (!cmd_line->HasSwitch(name))
|
| + cmd_line->AppendSwitch(name);
|
| +}
|
| +
|
| class DefaultShellClient : public shell::ShellClient {
|
| public:
|
| DefaultShellClient() {}
|
| @@ -33,6 +40,11 @@ class DefaultShellClient : public shell::ShellClient {
|
| class PlatformTestHelperMus : public PlatformTestHelper {
|
| public:
|
| PlatformTestHelperMus() {
|
| + // Let other mojo apps know that we're running in tests. Do this with a
|
| + // command line flag to avoid making blocking calls to other processes for
|
| + // setup for tests (e.g. to unlock the screen in the window manager).
|
| + EnsureCommandLineSwitch(mus::switches::kUseTestConfig);
|
| +
|
| background_shell_.reset(new BackgroundShell);
|
| background_shell_->Init(nullptr);
|
| shell_client_.reset(new DefaultShellClient);
|
|
|