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

Unified Diff: ui/views/mus/views_mus_test_suite.cc

Issue 1979323002: mus: Show USER_PRIVATE window container during views tests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@widgetinteractive
Patch Set: rebase, fix linux Created 4 years, 7 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 | « ui/views/mus/BUILD.gn ('k') | ui/views/widget/widget_interactive_uitest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/mus/views_mus_test_suite.cc
diff --git a/ui/views/mus/views_mus_test_suite.cc b/ui/views/mus/views_mus_test_suite.cc
index 4d5a810b5a41b323e42659510f032eb2e1d803e0..6373735f074f0bf5bce9294404435846fdd0c76e 100644
--- a/ui/views/mus/views_mus_test_suite.cc
+++ b/ui/views/mus/views_mus_test_suite.cc
@@ -12,6 +12,7 @@
#include "base/synchronization/waitable_event.h"
#include "base/threading/simple_thread.h"
#include "base/threading/thread.h"
+#include "components/mus/common/switches.h"
#include "services/shell/background/background_shell.h"
#include "services/shell/public/cpp/connector.h"
#include "services/shell/public/cpp/shell_client.h"
@@ -24,6 +25,12 @@
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() {}
@@ -130,6 +137,11 @@ ViewsMusTestSuite::~ViewsMusTestSuite() {}
void ViewsMusTestSuite::Initialize() {
PlatformTestHelper::SetIsMus();
+ // 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);
+
ViewsTestSuite::Initialize();
shell_connections_.reset(new ShellConnection);
}
« no previous file with comments | « ui/views/mus/BUILD.gn ('k') | ui/views/widget/widget_interactive_uitest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698