| 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 #ifndef COMPONENTS_MUS_WS_TEST_UTILS_H_ | 5 #ifndef COMPONENTS_MUS_WS_TEST_UTILS_H_ |
| 6 #define COMPONENTS_MUS_WS_TEST_UTILS_H_ | 6 #define COMPONENTS_MUS_WS_TEST_UTILS_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include "components/mus/public/interfaces/display.mojom.h" |
| 10 #include "components/mus/public/interfaces/window_tree.mojom.h" | 11 #include "components/mus/public/interfaces/window_tree.mojom.h" |
| 11 #include "components/mus/ws/connection_manager_delegate.h" | 12 #include "components/mus/ws/connection_manager_delegate.h" |
| 12 #include "components/mus/ws/display.h" | 13 #include "components/mus/ws/display.h" |
| 13 #include "components/mus/ws/platform_display.h" | 14 #include "components/mus/ws/platform_display.h" |
| 14 #include "components/mus/ws/platform_display_factory.h" | 15 #include "components/mus/ws/platform_display_factory.h" |
| 15 #include "components/mus/ws/test_change_tracker.h" | 16 #include "components/mus/ws/test_change_tracker.h" |
| 17 #include "components/mus/ws/user_display_manager.h" |
| 16 #include "components/mus/ws/window_manager_factory_registry.h" | 18 #include "components/mus/ws/window_manager_factory_registry.h" |
| 17 #include "components/mus/ws/window_tree.h" | 19 #include "components/mus/ws/window_tree.h" |
| 18 #include "components/mus/ws/window_tree_binding.h" | 20 #include "components/mus/ws/window_tree_binding.h" |
| 19 | 21 |
| 20 namespace mus { | 22 namespace mus { |
| 21 namespace ws { | 23 namespace ws { |
| 22 namespace test { | 24 namespace test { |
| 23 | 25 |
| 24 // Collection of utilities useful in creating mus tests. | 26 // Collection of utilities useful in creating mus tests. |
| 25 | 27 |
| 26 class WindowManagerFactoryRegistryTestApi { | 28 class WindowManagerFactoryRegistryTestApi { |
| 27 public: | 29 public: |
| 28 WindowManagerFactoryRegistryTestApi(WindowManagerFactoryRegistry* registry); | 30 WindowManagerFactoryRegistryTestApi(WindowManagerFactoryRegistry* registry); |
| 29 ~WindowManagerFactoryRegistryTestApi(); | 31 ~WindowManagerFactoryRegistryTestApi(); |
| 30 | 32 |
| 31 void AddService(const UserId& user_id, mojom::WindowManagerFactory* factory); | 33 void AddService(const UserId& user_id, mojom::WindowManagerFactory* factory); |
| 32 | 34 |
| 33 private: | 35 private: |
| 34 WindowManagerFactoryRegistry* registry_; | 36 WindowManagerFactoryRegistry* registry_; |
| 35 | 37 |
| 36 DISALLOW_COPY_AND_ASSIGN(WindowManagerFactoryRegistryTestApi); | 38 DISALLOW_COPY_AND_ASSIGN(WindowManagerFactoryRegistryTestApi); |
| 37 }; | 39 }; |
| 38 | 40 |
| 39 // ----------------------------------------------------------------------------- | 41 // ----------------------------------------------------------------------------- |
| 40 | 42 |
| 43 class UserDisplayManagerTestApi { |
| 44 public: |
| 45 explicit UserDisplayManagerTestApi(UserDisplayManager* udm) : udm_(udm) {} |
| 46 ~UserDisplayManagerTestApi() {} |
| 47 |
| 48 void SetTestObserver(mojom::DisplayManagerObserver* observer) { |
| 49 udm_->test_observer_ = observer; |
| 50 if (observer) |
| 51 udm_->OnObserverAdded(observer); |
| 52 } |
| 53 |
| 54 private: |
| 55 UserDisplayManager* udm_; |
| 56 |
| 57 DISALLOW_COPY_AND_ASSIGN(UserDisplayManagerTestApi); |
| 58 }; |
| 59 |
| 60 // ----------------------------------------------------------------------------- |
| 61 |
| 41 class WindowTreeTestApi { | 62 class WindowTreeTestApi { |
| 42 public: | 63 public: |
| 43 WindowTreeTestApi(WindowTree* tree); | 64 WindowTreeTestApi(WindowTree* tree); |
| 44 ~WindowTreeTestApi(); | 65 ~WindowTreeTestApi(); |
| 45 | 66 |
| 46 void set_window_manager_internal(mojom::WindowManager* wm_internal) { | 67 void set_window_manager_internal(mojom::WindowManager* wm_internal) { |
| 47 tree_->window_manager_internal_ = wm_internal; | 68 tree_->window_manager_internal_ = wm_internal; |
| 48 } | 69 } |
| 49 | 70 |
| 50 private: | 71 private: |
| (...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 232 bool got_on_no_more_displays_ = false; | 253 bool got_on_no_more_displays_ = false; |
| 233 | 254 |
| 234 DISALLOW_COPY_AND_ASSIGN(TestConnectionManagerDelegate); | 255 DISALLOW_COPY_AND_ASSIGN(TestConnectionManagerDelegate); |
| 235 }; | 256 }; |
| 236 | 257 |
| 237 } // namespace test | 258 } // namespace test |
| 238 } // namespace ws | 259 } // namespace ws |
| 239 } // namespace mus | 260 } // namespace mus |
| 240 | 261 |
| 241 #endif // COMPONENTS_MUS_WS_TEST_UTILS_H_ | 262 #endif // COMPONENTS_MUS_WS_TEST_UTILS_H_ |
| OLD | NEW |