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

Side by Side Diff: components/mus/ws/test_utils.cc

Issue 2068093002: mus: Allow embedder to intercept events. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: tot-merge Created 4 years, 5 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 unified diff | Download patch
« no previous file with comments | « components/mus/ws/test_utils.h ('k') | components/mus/ws/window_manager_state.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "components/mus/ws/test_utils.h" 5 #include "components/mus/ws/test_utils.h"
6 6
7 #include "base/memory/ptr_util.h" 7 #include "base/memory/ptr_util.h"
8 #include "cc/output/copy_output_request.h" 8 #include "cc/output/copy_output_request.h"
9 #include "components/mus/surfaces/surfaces_state.h" 9 #include "components/mus/surfaces/surfaces_state.h"
10 #include "components/mus/ws/display_binding.h" 10 #include "components/mus/ws/display_binding.h"
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 int count = 0; 138 int count = 0;
139 for (const auto& pair : ed_->pointer_targets_) 139 for (const auto& pair : ed_->pointer_targets_)
140 if (pair.second.window == window) 140 if (pair.second.window == window)
141 count++; 141 count++;
142 return count; 142 return count;
143 } 143 }
144 144
145 // TestDisplayBinding --------------------------------------------------------- 145 // TestDisplayBinding ---------------------------------------------------------
146 146
147 WindowTree* TestDisplayBinding::CreateWindowTree(ServerWindow* root) { 147 WindowTree* TestDisplayBinding::CreateWindowTree(ServerWindow* root) {
148 const uint32_t embed_flags = 0;
148 WindowTree* tree = window_server_->EmbedAtWindow( 149 WindowTree* tree = window_server_->EmbedAtWindow(
149 root, shell::mojom::kRootUserID, mus::mojom::WindowTreeClientPtr(), 150 root, shell::mojom::kRootUserID, mus::mojom::WindowTreeClientPtr(),
150 base::WrapUnique(new WindowManagerAccessPolicy)); 151 embed_flags, base::WrapUnique(new WindowManagerAccessPolicy));
151 tree->ConfigureWindowManager(); 152 tree->ConfigureWindowManager();
152 return tree; 153 return tree;
153 } 154 }
154 155
155 // TestWindowManager ---------------------------------------------------------- 156 // TestWindowManager ----------------------------------------------------------
156 157
157 void TestWindowManager::WmCreateTopLevelWindow( 158 void TestWindowManager::WmCreateTopLevelWindow(
158 uint32_t change_id, 159 uint32_t change_id,
159 ClientSpecificId requesting_client_id, 160 ClientSpecificId requesting_client_id,
160 mojo::Map<mojo::String, mojo::Array<uint8_t>> properties) { 161 mojo::Map<mojo::String, mojo::Array<uint8_t>> properties) {
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after
389 WindowTree* wm_tree = window_server_->GetTreeWithId(1); 390 WindowTree* wm_tree = window_server_->GetTreeWithId(1);
390 const ClientWindowId embed_window_id( 391 const ClientWindowId embed_window_id(
391 WindowIdToTransportId(WindowId(wm_tree->id(), 1))); 392 WindowIdToTransportId(WindowId(wm_tree->id(), 1)));
392 EXPECT_TRUE(wm_tree->NewWindow(embed_window_id, ServerWindow::Properties())); 393 EXPECT_TRUE(wm_tree->NewWindow(embed_window_id, ServerWindow::Properties()));
393 EXPECT_TRUE(wm_tree->SetWindowVisibility(embed_window_id, true)); 394 EXPECT_TRUE(wm_tree->SetWindowVisibility(embed_window_id, true));
394 EXPECT_TRUE(wm_tree->AddWindow(FirstRootId(wm_tree), embed_window_id)); 395 EXPECT_TRUE(wm_tree->AddWindow(FirstRootId(wm_tree), embed_window_id));
395 display_->root_window()->SetBounds(root_window_bounds); 396 display_->root_window()->SetBounds(root_window_bounds);
396 mojom::WindowTreeClientPtr client; 397 mojom::WindowTreeClientPtr client;
397 mojom::WindowTreeClientRequest client_request = GetProxy(&client); 398 mojom::WindowTreeClientRequest client_request = GetProxy(&client);
398 wm_client_->Bind(std::move(client_request)); 399 wm_client_->Bind(std::move(client_request));
399 wm_tree->Embed(embed_window_id, std::move(client)); 400 const uint32_t embed_flags = 0;
401 wm_tree->Embed(embed_window_id, std::move(client), embed_flags);
400 ServerWindow* embed_window = wm_tree->GetWindowByClientId(embed_window_id); 402 ServerWindow* embed_window = wm_tree->GetWindowByClientId(embed_window_id);
401 WindowTree* tree1 = window_server_->GetTreeWithRoot(embed_window); 403 WindowTree* tree1 = window_server_->GetTreeWithRoot(embed_window);
402 EXPECT_NE(nullptr, tree1); 404 EXPECT_NE(nullptr, tree1);
403 EXPECT_NE(tree1, wm_tree); 405 EXPECT_NE(tree1, wm_tree);
404 WindowTreeTestApi(tree1).set_user_id(wm_tree->user_id()); 406 WindowTreeTestApi(tree1).set_user_id(wm_tree->user_id());
405 407
406 embed_window->SetBounds(window_bounds); 408 embed_window->SetBounds(window_bounds);
407 409
408 return embed_window; 410 return embed_window;
409 } 411 }
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
485 return nullptr; 487 return nullptr;
486 if (!tree->AddWindow(parent_client_id, client_window_id)) 488 if (!tree->AddWindow(parent_client_id, client_window_id))
487 return nullptr; 489 return nullptr;
488 *client_id = client_window_id; 490 *client_id = client_window_id;
489 return tree->GetWindowByClientId(client_window_id); 491 return tree->GetWindowByClientId(client_window_id);
490 } 492 }
491 493
492 } // namespace test 494 } // namespace test
493 } // namespace ws 495 } // namespace ws
494 } // namespace mus 496 } // namespace mus
OLDNEW
« no previous file with comments | « components/mus/ws/test_utils.h ('k') | components/mus/ws/window_manager_state.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698