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