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 389 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
400 WindowTree* tree, | 400 WindowTree* tree, |
401 std::unique_ptr<TestWindowTreeClient> client) | 401 std::unique_ptr<TestWindowTreeClient> client) |
402 : WindowTreeBinding(client.get()), | 402 : WindowTreeBinding(client.get()), |
403 tree_(tree), | 403 tree_(tree), |
404 client_(std::move(client)) {} | 404 client_(std::move(client)) {} |
405 | 405 |
406 TestWindowTreeBinding::~TestWindowTreeBinding() {} | 406 TestWindowTreeBinding::~TestWindowTreeBinding() {} |
407 | 407 |
408 mojom::WindowManager* TestWindowTreeBinding::GetWindowManager() { | 408 mojom::WindowManager* TestWindowTreeBinding::GetWindowManager() { |
409 if (!window_manager_.get()) | 409 if (!window_manager_.get()) |
410 window_manager_.reset(new TestWindowManager); | 410 window_manager_ = base::MakeUnique<TestWindowManager>(); |
411 return window_manager_.get(); | 411 return window_manager_.get(); |
412 } | 412 } |
413 void TestWindowTreeBinding::SetIncomingMethodCallProcessingPaused(bool paused) { | 413 void TestWindowTreeBinding::SetIncomingMethodCallProcessingPaused(bool paused) { |
414 is_paused_ = paused; | 414 is_paused_ = paused; |
415 } | 415 } |
416 | 416 |
417 mojom::WindowTreeClient* TestWindowTreeBinding::CreateClientForShutdown() { | 417 mojom::WindowTreeClient* TestWindowTreeBinding::CreateClientForShutdown() { |
418 DCHECK(!client_after_reset_); | 418 DCHECK(!client_after_reset_); |
419 client_after_reset_ = base::MakeUnique<TestWindowTreeClient>(); | 419 client_after_reset_ = base::MakeUnique<TestWindowTreeClient>(); |
420 return client_after_reset_.get(); | 420 return client_after_reset_.get(); |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
459 | 459 |
460 bool TestWindowServerDelegate::IsTestConfig() const { | 460 bool TestWindowServerDelegate::IsTestConfig() const { |
461 return true; | 461 return true; |
462 } | 462 } |
463 | 463 |
464 // WindowServerTestHelper --------------------------------------------------- | 464 // WindowServerTestHelper --------------------------------------------------- |
465 | 465 |
466 WindowServerTestHelper::WindowServerTestHelper() | 466 WindowServerTestHelper::WindowServerTestHelper() |
467 : cursor_id_(0), platform_display_factory_(&cursor_id_) { | 467 : cursor_id_(0), platform_display_factory_(&cursor_id_) { |
468 PlatformDisplay::set_factory_for_testing(&platform_display_factory_); | 468 PlatformDisplay::set_factory_for_testing(&platform_display_factory_); |
469 window_server_.reset(new WindowServer(&window_server_delegate_)); | 469 window_server_ = base::MakeUnique<WindowServer>(&window_server_delegate_); |
470 window_server_delegate_.set_window_server(window_server_.get()); | 470 window_server_delegate_.set_window_server(window_server_.get()); |
471 } | 471 } |
472 | 472 |
473 WindowServerTestHelper::~WindowServerTestHelper() { | 473 WindowServerTestHelper::~WindowServerTestHelper() { |
474 // Destroy |window_server_| while the message-loop is still alive. | 474 // Destroy |window_server_| while the message-loop is still alive. |
475 window_server_.reset(); | 475 window_server_.reset(); |
476 } | 476 } |
477 | 477 |
478 // WindowEventTargetingHelper ------------------------------------------------ | 478 // WindowEventTargetingHelper ------------------------------------------------ |
479 | 479 |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
596 return nullptr; | 596 return nullptr; |
597 if (!tree->AddWindow(parent_client_id, client_window_id)) | 597 if (!tree->AddWindow(parent_client_id, client_window_id)) |
598 return nullptr; | 598 return nullptr; |
599 *client_id = client_window_id; | 599 *client_id = client_window_id; |
600 return tree->GetWindowByClientId(client_window_id); | 600 return tree->GetWindowByClientId(client_window_id); |
601 } | 601 } |
602 | 602 |
603 } // namespace test | 603 } // namespace test |
604 } // namespace ws | 604 } // namespace ws |
605 } // namespace ui | 605 } // namespace ui |
OLD | NEW |