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

Unified Diff: services/ui/ws/test_utils.cc

Issue 2804403002: Adds ability for WindowManager to create display roots (Closed)
Patch Set: cleanup Created 3 years, 8 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 | « services/ui/ws/test_utils.h ('k') | services/ui/ws/window_manager_state.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/ui/ws/test_utils.cc
diff --git a/services/ui/ws/test_utils.cc b/services/ui/ws/test_utils.cc
index ff46cb3c407874c511af1b9b6c00fe4f104b403f..50cbcd2791604c94c27aebfd915f2867dfec0dff 100644
--- a/services/ui/ws/test_utils.cc
+++ b/services/ui/ws/test_utils.cc
@@ -203,12 +203,29 @@ WindowTree* TestDisplayBinding::CreateWindowTree(ServerWindow* root) {
root, service_manager::mojom::kRootUserID,
ui::mojom::WindowTreeClientPtr(), embed_flags,
base::WrapUnique(new WindowManagerAccessPolicy));
- tree->ConfigureWindowManager();
+ tree->ConfigureWindowManager(automatically_create_display_roots_);
return tree;
}
// TestWindowManager ----------------------------------------------------------
+TestWindowManager::TestWindowManager() {}
+
+TestWindowManager::~TestWindowManager() {}
+
+void TestWindowManager::OnConnect(uint16_t client_id) {
+ connect_count_++;
+}
+
+void TestWindowManager::WmNewDisplayAdded(
+ const display::Display& display,
+ ui::mojom::WindowDataPtr root,
+ bool drawn,
+ const cc::FrameSinkId& frame_sink_id,
+ const base::Optional<cc::LocalSurfaceId>& local_surface_id) {
+ display_added_count_++;
+}
+
void TestWindowManager::WmDisplayRemoved(int64_t display_id) {
got_display_removed_ = true;
display_removed_id_ = display_id;
@@ -526,9 +543,11 @@ WindowServerTestHelper::~WindowServerTestHelper() {
// WindowEventTargetingHelper ------------------------------------------------
-WindowEventTargetingHelper::WindowEventTargetingHelper() {
+WindowEventTargetingHelper::WindowEventTargetingHelper(
+ bool automatically_create_display_roots) {
display_ = new Display(window_server());
- display_binding_ = new TestDisplayBinding(window_server());
+ display_binding_ = new TestDisplayBinding(window_server(),
+ automatically_create_display_roots);
display_->Init(display::ViewportMetrics(),
base::WrapUnique(display_binding_));
wm_client_ = ws_test_helper_.window_server_delegate()->last_client();
@@ -603,10 +622,12 @@ void WindowEventTargetingHelper::SetTaskRunner(
// ----------------------------------------------------------------------------
-void AddWindowManager(WindowServer* window_server, const UserId& user_id) {
+void AddWindowManager(WindowServer* window_server,
+ const UserId& user_id,
+ bool automatically_create_display_roots) {
window_server->window_manager_window_tree_factory_set()
->Add(user_id, nullptr)
- ->CreateWindowTree(nullptr, nullptr);
+ ->CreateWindowTree(nullptr, nullptr, automatically_create_display_roots);
}
display::Display MakeDisplay(int origin_x,
« no previous file with comments | « services/ui/ws/test_utils.h ('k') | services/ui/ws/window_manager_state.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698