| 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 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 DCHECK(display_ids_.count(id) == 1); | 119 DCHECK(display_ids_.count(id) == 1); |
| 120 delegate_->OnDisplayModified(id, metrics); | 120 delegate_->OnDisplayModified(id, metrics); |
| 121 } | 121 } |
| 122 | 122 |
| 123 void TestPlatformScreen::RemoveDisplay(int64_t id) { | 123 void TestPlatformScreen::RemoveDisplay(int64_t id) { |
| 124 DCHECK(display_ids_.count(id) == 1); | 124 DCHECK(display_ids_.count(id) == 1); |
| 125 delegate_->OnDisplayRemoved(id); | 125 delegate_->OnDisplayRemoved(id); |
| 126 display_ids_.erase(id); | 126 display_ids_.erase(id); |
| 127 } | 127 } |
| 128 | 128 |
| 129 void TestPlatformScreen::Init(display::PlatformScreenDelegate* delegate) { | 129 void TestPlatformScreen::Init(display::PlatformScreenDelegate* delegate, |
| 130 WindowMode window_mode) { |
| 130 // Reset | 131 // Reset |
| 131 delegate_ = delegate; | 132 delegate_ = delegate; |
| 132 display_ids_.clear(); | 133 display_ids_.clear(); |
| 133 primary_display_id_ = display::kInvalidDisplayId; | 134 primary_display_id_ = display::kInvalidDisplayId; |
| 134 } | 135 } |
| 135 | 136 |
| 136 int64_t TestPlatformScreen::GetPrimaryDisplayId() const { | 137 int64_t TestPlatformScreen::GetPrimaryDisplayId() const { |
| 137 return primary_display_id_; | 138 return primary_display_id_; |
| 138 } | 139 } |
| 139 | 140 |
| (...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 441 DCHECK(!client_after_reset_); | 442 DCHECK(!client_after_reset_); |
| 442 client_after_reset_ = base::MakeUnique<TestWindowTreeClient>(); | 443 client_after_reset_ = base::MakeUnique<TestWindowTreeClient>(); |
| 443 return client_after_reset_.get(); | 444 return client_after_reset_.get(); |
| 444 } | 445 } |
| 445 | 446 |
| 446 // TestWindowServerDelegate ---------------------------------------------- | 447 // TestWindowServerDelegate ---------------------------------------------- |
| 447 | 448 |
| 448 TestWindowServerDelegate::TestWindowServerDelegate() {} | 449 TestWindowServerDelegate::TestWindowServerDelegate() {} |
| 449 TestWindowServerDelegate::~TestWindowServerDelegate() {} | 450 TestWindowServerDelegate::~TestWindowServerDelegate() {} |
| 450 | 451 |
| 451 void TestWindowServerDelegate::StartDisplayInit() {} | 452 void TestWindowServerDelegate::StartDisplayInit(bool window_manager_connected) { |
| 453 } |
| 452 | 454 |
| 453 void TestWindowServerDelegate::OnNoMoreDisplays() { | 455 void TestWindowServerDelegate::OnNoMoreDisplays() { |
| 454 got_on_no_more_displays_ = true; | 456 got_on_no_more_displays_ = true; |
| 455 } | 457 } |
| 456 | 458 |
| 457 std::unique_ptr<WindowTreeBinding> | 459 std::unique_ptr<WindowTreeBinding> |
| 458 TestWindowServerDelegate::CreateWindowTreeBinding( | 460 TestWindowServerDelegate::CreateWindowTreeBinding( |
| 459 BindingType type, | 461 BindingType type, |
| 460 ws::WindowServer* window_server, | 462 ws::WindowServer* window_server, |
| 461 ws::WindowTree* tree, | 463 ws::WindowTree* tree, |
| (...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 626 return nullptr; | 628 return nullptr; |
| 627 if (!tree->AddWindow(parent_client_id, client_window_id)) | 629 if (!tree->AddWindow(parent_client_id, client_window_id)) |
| 628 return nullptr; | 630 return nullptr; |
| 629 *client_id = client_window_id; | 631 *client_id = client_window_id; |
| 630 return tree->GetWindowByClientId(client_window_id); | 632 return tree->GetWindowByClientId(client_window_id); |
| 631 } | 633 } |
| 632 | 634 |
| 633 } // namespace test | 635 } // namespace test |
| 634 } // namespace ws | 636 } // namespace ws |
| 635 } // namespace ui | 637 } // namespace ui |
| OLD | NEW |