| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 #ifndef SERVICES_UI_PUBLIC_CPP_TESTS_WINDOW_SERVER_TEST_BASE_H_ | 5 #ifndef SERVICES_UI_PUBLIC_CPP_TESTS_WINDOW_SERVER_TEST_BASE_H_ |
| 6 #define SERVICES_UI_PUBLIC_CPP_TESTS_WINDOW_SERVER_TEST_BASE_H_ | 6 #define SERVICES_UI_PUBLIC_CPP_TESTS_WINDOW_SERVER_TEST_BASE_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <set> | 9 #include <set> |
| 10 | 10 |
| 11 #include "base/macros.h" | 11 #include "base/macros.h" |
| 12 #include "services/service_manager/public/cpp/interface_factory.h" | 12 #include "services/service_manager/public/cpp/interface_factory.h" |
| 13 #include "services/ui/public/cpp/tests/window_server_shelltest_base.h" | 13 #include "services/ui/public/cpp/tests/window_server_shelltest_base.h" |
| 14 #include "services/ui/public/cpp/window_manager_delegate.h" | 14 #include "services/ui/public/cpp/window_manager_delegate.h" |
| 15 #include "services/ui/public/cpp/window_tree_client_delegate.h" | 15 #include "services/ui/public/cpp/window_tree_client_delegate.h" |
| 16 #include "services/ui/public/interfaces/window_tree.mojom.h" | 16 #include "services/ui/public/interfaces/window_tree.mojom.h" |
| 17 #include "ui/display/test/test_screen.h" |
| 17 | 18 |
| 18 namespace ui { | 19 namespace ui { |
| 19 | 20 |
| 20 // WindowServerTestBase is a base class for use with shell tests that use | 21 // WindowServerTestBase is a base class for use with shell tests that use |
| 21 // WindowServer. SetUp() connects to the WindowServer and blocks until OnEmbed() | 22 // WindowServer. SetUp() connects to the WindowServer and blocks until OnEmbed() |
| 22 // has been invoked. window_manager() can be used to access the WindowServer | 23 // has been invoked. window_manager() can be used to access the WindowServer |
| 23 // established as part of SetUp(). | 24 // established as part of SetUp(). |
| 24 class WindowServerTestBase | 25 class WindowServerTestBase |
| 25 : public WindowServerServiceTestBase, | 26 : public WindowServerServiceTestBase, |
| 26 public WindowTreeClientDelegate, | 27 public WindowTreeClientDelegate, |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 // The window server connection held by the window manager (app running at | 104 // The window server connection held by the window manager (app running at |
| 104 // the root window). | 105 // the root window). |
| 105 WindowTreeClient* window_manager_; | 106 WindowTreeClient* window_manager_; |
| 106 | 107 |
| 107 // A test can override the WM-related behaviour by installing its own | 108 // A test can override the WM-related behaviour by installing its own |
| 108 // WindowManagerDelegate during the test. | 109 // WindowManagerDelegate during the test. |
| 109 WindowManagerDelegate* window_manager_delegate_; | 110 WindowManagerDelegate* window_manager_delegate_; |
| 110 | 111 |
| 111 WindowManagerClient* window_manager_client_; | 112 WindowManagerClient* window_manager_client_; |
| 112 | 113 |
| 114 // Dummy screen required to be the screen instance. |
| 115 display::test::TestScreen test_screen_; |
| 116 |
| 113 bool window_tree_client_lost_connection_ = false; | 117 bool window_tree_client_lost_connection_ = false; |
| 114 | 118 |
| 115 DISALLOW_COPY_AND_ASSIGN(WindowServerTestBase); | 119 DISALLOW_COPY_AND_ASSIGN(WindowServerTestBase); |
| 116 }; | 120 }; |
| 117 | 121 |
| 118 } // namespace ui | 122 } // namespace ui |
| 119 | 123 |
| 120 #endif // SERVICES_UI_PUBLIC_CPP_TESTS_WINDOW_SERVER_TEST_BASE_H_ | 124 #endif // SERVICES_UI_PUBLIC_CPP_TESTS_WINDOW_SERVER_TEST_BASE_H_ |
| OLD | NEW |