| 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" |
| 11 #include "gpu/ipc/client/gpu_channel_host.h" | 11 #include "gpu/ipc/client/gpu_channel_host.h" |
| 12 #include "services/service_manager/public/interfaces/connector.mojom.h" | 12 #include "services/service_manager/public/interfaces/connector.mojom.h" |
| 13 #include "services/ui/public/interfaces/cursor.mojom.h" | 13 #include "services/ui/public/interfaces/cursor.mojom.h" |
| 14 #include "services/ui/surfaces/display_compositor.h" | |
| 15 #include "services/ui/ws/display_binding.h" | 14 #include "services/ui/ws/display_binding.h" |
| 16 #include "services/ui/ws/display_manager.h" | 15 #include "services/ui/ws/display_manager.h" |
| 17 #include "services/ui/ws/platform_display_init_params.h" | 16 #include "services/ui/ws/platform_display_init_params.h" |
| 18 #include "services/ui/ws/server_window_compositor_frame_sink_manager_test_api.h" | 17 #include "services/ui/ws/server_window_compositor_frame_sink_manager_test_api.h" |
| 19 #include "services/ui/ws/window_manager_access_policy.h" | 18 #include "services/ui/ws/window_manager_access_policy.h" |
| 20 #include "services/ui/ws/window_manager_window_tree_factory.h" | 19 #include "services/ui/ws/window_manager_window_tree_factory.h" |
| 21 #include "testing/gtest/include/gtest/gtest.h" | 20 #include "testing/gtest/include/gtest/gtest.h" |
| 22 | 21 |
| 23 namespace ui { | 22 namespace ui { |
| 24 namespace ws { | 23 namespace ws { |
| (...skipping 458 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 483 } | 482 } |
| 484 | 483 |
| 485 WindowServerTestHelper::~WindowServerTestHelper() { | 484 WindowServerTestHelper::~WindowServerTestHelper() { |
| 486 // Destroy |window_server_| while the message-loop is still alive. | 485 // Destroy |window_server_| while the message-loop is still alive. |
| 487 window_server_.reset(); | 486 window_server_.reset(); |
| 488 } | 487 } |
| 489 | 488 |
| 490 // WindowEventTargetingHelper ------------------------------------------------ | 489 // WindowEventTargetingHelper ------------------------------------------------ |
| 491 | 490 |
| 492 WindowEventTargetingHelper::WindowEventTargetingHelper() | 491 WindowEventTargetingHelper::WindowEventTargetingHelper() |
| 493 : wm_client_(nullptr), | 492 : wm_client_(nullptr), display_binding_(nullptr), display_(nullptr) { |
| 494 display_binding_(nullptr), | |
| 495 display_(nullptr), | |
| 496 display_compositor_(new DisplayCompositor(nullptr)) { | |
| 497 PlatformDisplayInitParams display_init_params; | 493 PlatformDisplayInitParams display_init_params; |
| 498 display_init_params.display_compositor = display_compositor_; | |
| 499 display_ = new Display(window_server(), display_init_params); | 494 display_ = new Display(window_server(), display_init_params); |
| 500 display_binding_ = new TestDisplayBinding(window_server()); | 495 display_binding_ = new TestDisplayBinding(window_server()); |
| 501 display_->Init(base::WrapUnique(display_binding_)); | 496 display_->Init(base::WrapUnique(display_binding_)); |
| 502 wm_client_ = ws_test_helper_.window_server_delegate()->last_client(); | 497 wm_client_ = ws_test_helper_.window_server_delegate()->last_client(); |
| 503 wm_client_->tracker()->changes()->clear(); | 498 wm_client_->tracker()->changes()->clear(); |
| 504 } | 499 } |
| 505 | 500 |
| 506 WindowEventTargetingHelper::~WindowEventTargetingHelper() {} | 501 WindowEventTargetingHelper::~WindowEventTargetingHelper() {} |
| 507 | 502 |
| 508 ServerWindow* WindowEventTargetingHelper::CreatePrimaryTree( | 503 ServerWindow* WindowEventTargetingHelper::CreatePrimaryTree( |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 608 return nullptr; | 603 return nullptr; |
| 609 if (!tree->AddWindow(parent_client_id, client_window_id)) | 604 if (!tree->AddWindow(parent_client_id, client_window_id)) |
| 610 return nullptr; | 605 return nullptr; |
| 611 *client_id = client_window_id; | 606 *client_id = client_window_id; |
| 612 return tree->GetWindowByClientId(client_window_id); | 607 return tree->GetWindowByClientId(client_window_id); |
| 613 } | 608 } |
| 614 | 609 |
| 615 } // namespace test | 610 } // namespace test |
| 616 } // namespace ws | 611 } // namespace ws |
| 617 } // namespace ui | 612 } // namespace ui |
| OLD | NEW |