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

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: 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
Index: mash/wm/root_window_controller.cc
diff --git a/mash/wm/root_window_controller.cc b/mash/wm/root_window_controller.cc
index 8fe32a88fb839dba2d751bddfe503dac080ae2c5..33c276a49bedaf05b55243f9da26d92b8a60ab66 100644
--- a/mash/wm/root_window_controller.cc
+++ b/mash/wm/root_window_controller.cc
@@ -7,7 +7,9 @@
#include <stdint.h>
#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/window.h"
#include "components/mus/public/cpp/window_tree_connection.h"
@@ -176,8 +178,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);

Powered by Google App Engine
This is Rietveld 408576698