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 SERVICES_UI_WS_TEST_UTILS_H_ | 5 #ifndef SERVICES_UI_WS_TEST_UTILS_H_ |
6 #define SERVICES_UI_WS_TEST_UTILS_H_ | 6 #define SERVICES_UI_WS_TEST_UTILS_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
(...skipping 15 matching lines...) Expand all Loading... |
26 #include "services/ui/ws/platform_display_factory.h" | 26 #include "services/ui/ws/platform_display_factory.h" |
27 #include "services/ui/ws/test_change_tracker.h" | 27 #include "services/ui/ws/test_change_tracker.h" |
28 #include "services/ui/ws/user_activity_monitor.h" | 28 #include "services/ui/ws/user_activity_monitor.h" |
29 #include "services/ui/ws/user_id.h" | 29 #include "services/ui/ws/user_id.h" |
30 #include "services/ui/ws/window_manager_state.h" | 30 #include "services/ui/ws/window_manager_state.h" |
31 #include "services/ui/ws/window_manager_window_tree_factory_set.h" | 31 #include "services/ui/ws/window_manager_window_tree_factory_set.h" |
32 #include "services/ui/ws/window_server_delegate.h" | 32 #include "services/ui/ws/window_server_delegate.h" |
33 #include "services/ui/ws/window_tree.h" | 33 #include "services/ui/ws/window_tree.h" |
34 #include "services/ui/ws/window_tree_binding.h" | 34 #include "services/ui/ws/window_tree_binding.h" |
35 #include "ui/display/display.h" | 35 #include "ui/display/display.h" |
| 36 #include "ui/display/screen_base.h" |
36 #include "ui/display/types/display_constants.h" | 37 #include "ui/display/types/display_constants.h" |
37 | 38 |
38 namespace ui { | 39 namespace ui { |
39 namespace ws { | 40 namespace ws { |
40 namespace test { | 41 namespace test { |
41 | 42 |
42 // Collection of utilities useful in creating mus tests. | 43 // Collection of utilities useful in creating mus tests. |
43 | 44 |
44 // Test ScreenManager instance that allows adding/modifying/removing displays. | 45 // Test ScreenManager instance that allows adding/modifying/removing displays. |
45 // Tracks display ids to perform some basic verification that no duplicates are | 46 // Tracks display ids to perform some basic verification that no duplicates are |
(...skipping 15 matching lines...) Expand all Loading... |
61 // Calls OnDisplayModified() on delegate. | 62 // Calls OnDisplayModified() on delegate. |
62 void ModifyDisplay(int64_t id, const display::ViewportMetrics& metrics); | 63 void ModifyDisplay(int64_t id, const display::ViewportMetrics& metrics); |
63 | 64 |
64 // Calls OnDisplayRemoved() on delegate. | 65 // Calls OnDisplayRemoved() on delegate. |
65 void RemoveDisplay(int64_t id); | 66 void RemoveDisplay(int64_t id); |
66 | 67 |
67 // display::ScreenManager: | 68 // display::ScreenManager: |
68 void AddInterfaces(service_manager::InterfaceRegistry* registry) override {} | 69 void AddInterfaces(service_manager::InterfaceRegistry* registry) override {} |
69 void Init(display::ScreenManagerDelegate* delegate) override; | 70 void Init(display::ScreenManagerDelegate* delegate) override; |
70 void RequestCloseDisplay(int64_t display_id) override {} | 71 void RequestCloseDisplay(int64_t display_id) override {} |
71 int64_t GetPrimaryDisplayId() const override; | |
72 | 72 |
73 private: | 73 private: |
74 display::ScreenManagerDelegate* delegate_; | 74 display::ScreenManagerDelegate* delegate_ = nullptr; |
75 int64_t primary_display_id_ = display::kInvalidDisplayId; | 75 std::unique_ptr<display::ScreenBase> screen_; |
76 std::set<int64_t> display_ids_; | 76 std::set<int64_t> display_ids_; |
77 | 77 |
78 DISALLOW_COPY_AND_ASSIGN(TestScreenManager); | 78 DISALLOW_COPY_AND_ASSIGN(TestScreenManager); |
79 }; | 79 }; |
80 | 80 |
81 // ----------------------------------------------------------------------------- | 81 // ----------------------------------------------------------------------------- |
82 | 82 |
83 class UserActivityMonitorTestApi { | 83 class UserActivityMonitorTestApi { |
84 public: | 84 public: |
85 explicit UserActivityMonitorTestApi(UserActivityMonitor* monitor) | 85 explicit UserActivityMonitorTestApi(UserActivityMonitor* monitor) |
(...skipping 597 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
683 ServerWindow* NewWindowInTree(WindowTree* tree, ClientWindowId* client_id); | 683 ServerWindow* NewWindowInTree(WindowTree* tree, ClientWindowId* client_id); |
684 ServerWindow* NewWindowInTreeWithParent(WindowTree* tree, | 684 ServerWindow* NewWindowInTreeWithParent(WindowTree* tree, |
685 ServerWindow* parent, | 685 ServerWindow* parent, |
686 ClientWindowId* client_id = nullptr); | 686 ClientWindowId* client_id = nullptr); |
687 | 687 |
688 } // namespace test | 688 } // namespace test |
689 } // namespace ws | 689 } // namespace ws |
690 } // namespace ui | 690 } // namespace ui |
691 | 691 |
692 #endif // SERVICES_UI_WS_TEST_UTILS_H_ | 692 #endif // SERVICES_UI_WS_TEST_UTILS_H_ |
OLD | NEW |