| 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 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 120 DCHECK(display_ids_.count(id) == 1); | 120 DCHECK(display_ids_.count(id) == 1); |
| 121 delegate_->OnDisplayModified(id, metrics); | 121 delegate_->OnDisplayModified(id, metrics); |
| 122 } | 122 } |
| 123 | 123 |
| 124 void TestScreenManager::RemoveDisplay(int64_t id) { | 124 void TestScreenManager::RemoveDisplay(int64_t id) { |
| 125 DCHECK(display_ids_.count(id) == 1); | 125 DCHECK(display_ids_.count(id) == 1); |
| 126 delegate_->OnDisplayRemoved(id); | 126 delegate_->OnDisplayRemoved(id); |
| 127 display_ids_.erase(id); | 127 display_ids_.erase(id); |
| 128 } | 128 } |
| 129 | 129 |
| 130 void TestScreenManager::Init(display::ScreenManagerDelegate* delegate) { | 130 void TestScreenManager::Init(display::ScreenManagerDelegate* delegate, |
| 131 WindowMode window_mode) { |
| 131 // Reset | 132 // Reset |
| 132 delegate_ = delegate; | 133 delegate_ = delegate; |
| 133 display_ids_.clear(); | 134 display_ids_.clear(); |
| 134 primary_display_id_ = display::kInvalidDisplayId; | 135 primary_display_id_ = display::kInvalidDisplayId; |
| 135 } | 136 } |
| 136 | 137 |
| 137 int64_t TestScreenManager::GetPrimaryDisplayId() const { | 138 int64_t TestScreenManager::GetPrimaryDisplayId() const { |
| 138 return primary_display_id_; | 139 return primary_display_id_; |
| 139 } | 140 } |
| 140 | 141 |
| (...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 448 DCHECK(!client_after_reset_); | 449 DCHECK(!client_after_reset_); |
| 449 client_after_reset_ = base::MakeUnique<TestWindowTreeClient>(); | 450 client_after_reset_ = base::MakeUnique<TestWindowTreeClient>(); |
| 450 return client_after_reset_.get(); | 451 return client_after_reset_.get(); |
| 451 } | 452 } |
| 452 | 453 |
| 453 // TestWindowServerDelegate ---------------------------------------------- | 454 // TestWindowServerDelegate ---------------------------------------------- |
| 454 | 455 |
| 455 TestWindowServerDelegate::TestWindowServerDelegate() {} | 456 TestWindowServerDelegate::TestWindowServerDelegate() {} |
| 456 TestWindowServerDelegate::~TestWindowServerDelegate() {} | 457 TestWindowServerDelegate::~TestWindowServerDelegate() {} |
| 457 | 458 |
| 458 void TestWindowServerDelegate::StartDisplayInit() {} | 459 void TestWindowServerDelegate::StartDisplayInit(bool window_manager_connected) { |
| 460 } |
| 459 | 461 |
| 460 void TestWindowServerDelegate::OnNoMoreDisplays() { | 462 void TestWindowServerDelegate::OnNoMoreDisplays() { |
| 461 got_on_no_more_displays_ = true; | 463 got_on_no_more_displays_ = true; |
| 462 } | 464 } |
| 463 | 465 |
| 464 std::unique_ptr<WindowTreeBinding> | 466 std::unique_ptr<WindowTreeBinding> |
| 465 TestWindowServerDelegate::CreateWindowTreeBinding( | 467 TestWindowServerDelegate::CreateWindowTreeBinding( |
| 466 BindingType type, | 468 BindingType type, |
| 467 ws::WindowServer* window_server, | 469 ws::WindowServer* window_server, |
| 468 ws::WindowTree* tree, | 470 ws::WindowTree* tree, |
| (...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 633 return nullptr; | 635 return nullptr; |
| 634 if (!tree->AddWindow(parent_client_id, client_window_id)) | 636 if (!tree->AddWindow(parent_client_id, client_window_id)) |
| 635 return nullptr; | 637 return nullptr; |
| 636 *client_id = client_window_id; | 638 *client_id = client_window_id; |
| 637 return tree->GetWindowByClientId(client_window_id); | 639 return tree->GetWindowByClientId(client_window_id); |
| 638 } | 640 } |
| 639 | 641 |
| 640 } // namespace test | 642 } // namespace test |
| 641 } // namespace ws | 643 } // namespace ws |
| 642 } // namespace ui | 644 } // namespace ui |
| OLD | NEW |