OLD | NEW |
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 "services/ui/ws/test_utils.h" | 5 #include "services/ui/ws/test_utils.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/memory/ptr_util.h" | 9 #include "base/memory/ptr_util.h" |
10 #include "cc/output/copy_output_request.h" | 10 #include "cc/output/copy_output_request.h" |
(...skipping 493 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
504 const gfx::Rect& root_window_bounds, | 504 const gfx::Rect& root_window_bounds, |
505 const gfx::Rect& window_bounds) { | 505 const gfx::Rect& window_bounds) { |
506 WindowTree* wm_tree = window_server()->GetTreeWithId(1); | 506 WindowTree* wm_tree = window_server()->GetTreeWithId(1); |
507 const ClientWindowId embed_window_id( | 507 const ClientWindowId embed_window_id( |
508 WindowIdToTransportId(WindowId(wm_tree->id(), 1))); | 508 WindowIdToTransportId(WindowId(wm_tree->id(), 1))); |
509 EXPECT_TRUE(wm_tree->NewWindow(embed_window_id, ServerWindow::Properties())); | 509 EXPECT_TRUE(wm_tree->NewWindow(embed_window_id, ServerWindow::Properties())); |
510 EXPECT_TRUE(wm_tree->SetWindowVisibility(embed_window_id, true)); | 510 EXPECT_TRUE(wm_tree->SetWindowVisibility(embed_window_id, true)); |
511 EXPECT_TRUE(wm_tree->AddWindow(FirstRootId(wm_tree), embed_window_id)); | 511 EXPECT_TRUE(wm_tree->AddWindow(FirstRootId(wm_tree), embed_window_id)); |
512 display_->root_window()->SetBounds(root_window_bounds); | 512 display_->root_window()->SetBounds(root_window_bounds); |
513 mojom::WindowTreeClientPtr client; | 513 mojom::WindowTreeClientPtr client; |
514 mojom::WindowTreeClientRequest client_request = MakeRequest(&client); | 514 mojom::WindowTreeClientRequest client_request(&client); |
515 wm_client_->Bind(std::move(client_request)); | 515 wm_client_->Bind(std::move(client_request)); |
516 const uint32_t embed_flags = 0; | 516 const uint32_t embed_flags = 0; |
517 wm_tree->Embed(embed_window_id, std::move(client), embed_flags); | 517 wm_tree->Embed(embed_window_id, std::move(client), embed_flags); |
518 ServerWindow* embed_window = wm_tree->GetWindowByClientId(embed_window_id); | 518 ServerWindow* embed_window = wm_tree->GetWindowByClientId(embed_window_id); |
519 WindowTree* tree1 = window_server()->GetTreeWithRoot(embed_window); | 519 WindowTree* tree1 = window_server()->GetTreeWithRoot(embed_window); |
520 EXPECT_NE(nullptr, tree1); | 520 EXPECT_NE(nullptr, tree1); |
521 EXPECT_NE(tree1, wm_tree); | 521 EXPECT_NE(tree1, wm_tree); |
522 WindowTreeTestApi(tree1).set_user_id(wm_tree->user_id()); | 522 WindowTreeTestApi(tree1).set_user_id(wm_tree->user_id()); |
523 | 523 |
524 embed_window->SetBounds(window_bounds); | 524 embed_window->SetBounds(window_bounds); |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
624 return nullptr; | 624 return nullptr; |
625 if (!tree->AddWindow(parent_client_id, client_window_id)) | 625 if (!tree->AddWindow(parent_client_id, client_window_id)) |
626 return nullptr; | 626 return nullptr; |
627 *client_id = client_window_id; | 627 *client_id = client_window_id; |
628 return tree->GetWindowByClientId(client_window_id); | 628 return tree->GetWindowByClientId(client_window_id); |
629 } | 629 } |
630 | 630 |
631 } // namespace test | 631 } // namespace test |
632 } // namespace ws | 632 } // namespace ws |
633 } // namespace ui | 633 } // namespace ui |
OLD | NEW |