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

Side by Side Diff: services/ui/ws/window_tree_client_unittest.cc

Issue 2778363002: Mus-WS / Aura-Mus: Propagate LocalSurfaceId on WindowTreeHost creation (Closed)
Patch Set: Add comments 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 unified diff | Download patch
« no previous file with comments | « services/ui/ws/window_tree.cc ('k') | ui/aura/mus/window_tree_client.h » ('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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 <stddef.h> 5 #include <stddef.h>
6 #include <stdint.h> 6 #include <stdint.h>
7 7
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "base/memory/ptr_util.h" 10 #include "base/memory/ptr_util.h"
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after
267 267
268 // TestChangeTracker::Delegate: 268 // TestChangeTracker::Delegate:
269 void OnChangeAdded() override { 269 void OnChangeAdded() override {
270 if (wait_state_.get() && 270 if (wait_state_.get() &&
271 tracker_.changes()->size() >= wait_state_->change_count) { 271 tracker_.changes()->size() >= wait_state_->change_count) {
272 wait_state_->run_loop.Quit(); 272 wait_state_->run_loop.Quit();
273 } 273 }
274 } 274 }
275 275
276 // WindowTreeClient: 276 // WindowTreeClient:
277 void OnEmbed(ClientSpecificId client_id, 277 void OnEmbed(
278 WindowDataPtr root, 278 ClientSpecificId client_id,
279 mojom::WindowTreePtr tree, 279 WindowDataPtr root,
280 int64_t display_id, 280 mojom::WindowTreePtr tree,
281 Id focused_window_id, 281 int64_t display_id,
282 bool drawn, 282 Id focused_window_id,
283 const cc::FrameSinkId& frame_sink_id) override { 283 bool drawn,
284 const cc::FrameSinkId& frame_sink_id,
285 const base::Optional<cc::LocalSurfaceId>& local_surface_id) override {
284 // TODO(sky): add coverage of |focused_window_id|. 286 // TODO(sky): add coverage of |focused_window_id|.
285 ASSERT_TRUE(root); 287 ASSERT_TRUE(root);
286 root_window_id_ = root->window_id; 288 root_window_id_ = root->window_id;
287 tree_ = std::move(tree); 289 tree_ = std::move(tree);
288 client_id_ = client_id; 290 client_id_ = client_id;
289 tracker()->OnEmbed(client_id, std::move(root), drawn, frame_sink_id); 291 tracker()->OnEmbed(client_id, std::move(root), drawn, frame_sink_id);
290 if (embed_run_loop_) 292 if (embed_run_loop_)
291 embed_run_loop_->Quit(); 293 embed_run_loop_->Quit();
292 } 294 }
293 void OnEmbeddedAppDisconnected(Id window_id) override { 295 void OnEmbeddedAppDisconnected(Id window_id) override {
294 tracker()->OnEmbeddedAppDisconnected(window_id); 296 tracker()->OnEmbeddedAppDisconnected(window_id);
295 } 297 }
296 void OnUnembed(Id window_id) override { tracker()->OnUnembed(window_id); } 298 void OnUnembed(Id window_id) override { tracker()->OnUnembed(window_id); }
297 void OnCaptureChanged(Id new_capture_window_id, 299 void OnCaptureChanged(Id new_capture_window_id,
298 Id old_capture_window_id) override { 300 Id old_capture_window_id) override {
299 tracker()->OnCaptureChanged(new_capture_window_id, old_capture_window_id); 301 tracker()->OnCaptureChanged(new_capture_window_id, old_capture_window_id);
300 } 302 }
301 void OnFrameSinkIdAllocated(Id window_id, 303 void OnFrameSinkIdAllocated(Id window_id,
302 const cc::FrameSinkId& frame_sink_id) override {} 304 const cc::FrameSinkId& frame_sink_id) override {}
303 void OnTopLevelCreated(uint32_t change_id, 305 void OnTopLevelCreated(
304 mojom::WindowDataPtr data, 306 uint32_t change_id,
305 int64_t display_id, 307 mojom::WindowDataPtr data,
306 bool drawn, 308 int64_t display_id,
307 const cc::FrameSinkId& frame_sink_id) override { 309 bool drawn,
310 const cc::FrameSinkId& frame_sink_id,
311 const base::Optional<cc::LocalSurfaceId>& local_surface_id) override {
308 tracker()->OnTopLevelCreated(change_id, std::move(data), drawn, 312 tracker()->OnTopLevelCreated(change_id, std::move(data), drawn,
309 frame_sink_id); 313 frame_sink_id);
310 } 314 }
311 void OnWindowBoundsChanged( 315 void OnWindowBoundsChanged(
312 Id window_id, 316 Id window_id,
313 const gfx::Rect& old_bounds, 317 const gfx::Rect& old_bounds,
314 const gfx::Rect& new_bounds, 318 const gfx::Rect& new_bounds,
315 const base::Optional<cc::LocalSurfaceId>& local_surface_id) override { 319 const base::Optional<cc::LocalSurfaceId>& local_surface_id) override {
316 // The bounds of the root may change during startup on Android at random 320 // The bounds of the root may change during startup on Android at random
317 // times. As this doesn't matter, and shouldn't impact test exepctations, 321 // times. As this doesn't matter, and shouldn't impact test exepctations,
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
439 void GetWindowManager(mojo::AssociatedInterfaceRequest<mojom::WindowManager> 443 void GetWindowManager(mojo::AssociatedInterfaceRequest<mojom::WindowManager>
440 internal) override { 444 internal) override {
441 window_manager_binding_ = 445 window_manager_binding_ =
442 base::MakeUnique<mojo::AssociatedBinding<mojom::WindowManager>>( 446 base::MakeUnique<mojo::AssociatedBinding<mojom::WindowManager>>(
443 this, std::move(internal)); 447 this, std::move(internal));
444 tree_->GetWindowManagerClient(MakeRequest(&window_manager_client_)); 448 tree_->GetWindowManagerClient(MakeRequest(&window_manager_client_));
445 } 449 }
446 450
447 // mojom::WindowManager: 451 // mojom::WindowManager:
448 void OnConnect(uint16_t client_id) override {} 452 void OnConnect(uint16_t client_id) override {}
449 void WmNewDisplayAdded(const display::Display& display, 453 void WmNewDisplayAdded(
450 mojom::WindowDataPtr root_data, 454 const display::Display& display,
451 bool drawn, 455 mojom::WindowDataPtr root_data,
452 const cc::FrameSinkId& frame_sink_id) override { 456 bool drawn,
457 const cc::FrameSinkId& frame_sink_id,
458 const base::Optional<cc::LocalSurfaceId>& local_surface_id) override {
453 NOTIMPLEMENTED(); 459 NOTIMPLEMENTED();
454 } 460 }
455 void WmDisplayRemoved(int64_t display_id) override { NOTIMPLEMENTED(); } 461 void WmDisplayRemoved(int64_t display_id) override { NOTIMPLEMENTED(); }
456 void WmDisplayModified(const display::Display& display) override { 462 void WmDisplayModified(const display::Display& display) override {
457 NOTIMPLEMENTED(); 463 NOTIMPLEMENTED();
458 } 464 }
459 void WmSetBounds(uint32_t change_id, 465 void WmSetBounds(uint32_t change_id,
460 uint32_t window_id, 466 uint32_t window_id,
461 const gfx::Rect& bounds) override { 467 const gfx::Rect& bounds) override {
462 window_manager_client_->WmResponse(change_id, false); 468 window_manager_client_->WmResponse(change_id, false);
(...skipping 1798 matching lines...) Expand 10 before | Expand all | Expand 10 after
2261 2267
2262 // TODO(sky): make sure coverage of what was 2268 // TODO(sky): make sure coverage of what was
2263 // WindowManagerTest.SecondEmbedRoot_InitService and 2269 // WindowManagerTest.SecondEmbedRoot_InitService and
2264 // WindowManagerTest.MultipleEmbedRootsBeforeWTHReady gets added to window 2270 // WindowManagerTest.MultipleEmbedRootsBeforeWTHReady gets added to window
2265 // manager 2271 // manager
2266 // tests. 2272 // tests.
2267 2273
2268 } // namespace test 2274 } // namespace test
2269 } // namespace ws 2275 } // namespace ws
2270 } // namespace ui 2276 } // namespace ui
OLDNEW
« no previous file with comments | « services/ui/ws/window_tree.cc ('k') | ui/aura/mus/window_tree_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698