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

Unified Diff: mash/wm/root_window_controller.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 | « components/mus/ws/window_tree.cc ('k') | ui/views/mus/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mash/wm/root_window_controller.cc
diff --git a/mash/wm/root_window_controller.cc b/mash/wm/root_window_controller.cc
index 552ed057c89ff27d73db2f709ae2ffb7875f1d16..4e9b7ab5fa9bfd7a034111802247fc499bcbd0b6 100644
--- a/mash/wm/root_window_controller.cc
+++ b/mash/wm/root_window_controller.cc
@@ -10,7 +10,9 @@
#include <sstream>
#include "base/bind.h"
+#include "base/command_line.h"
#include "components/mus/common/event_matcher_util.h"
+#include "components/mus/common/switches.h"
#include "components/mus/common/util.h"
#include "components/mus/public/cpp/property_type_converters.h"
#include "components/mus/public/cpp/window.h"
@@ -190,8 +192,12 @@ void RootWindowController::CreateContainer(
layout_managers_[window].reset(new FillLayout(window));
// User private windows are hidden by default until the window manager learns
- // the lock state, so their contents are never accidentally revealed.
- window->SetVisible(container != mojom::Container::USER_PRIVATE);
+ // the lock state, so their contents are never accidentally revealed. Tests,
+ // however, usually assume the screen is unlocked.
+ const bool is_test = base::CommandLine::ForCurrentProcess()->HasSwitch(
+ mus::switches::kUseTestConfig);
+ window->SetVisible(container != mojom::Container::USER_PRIVATE || is_test);
+
mus::Window* parent =
root_->GetChildByLocalId(ContainerToLocalId(parent_container));
parent->AddChild(window);
« no previous file with comments | « components/mus/ws/window_tree.cc ('k') | ui/views/mus/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698