Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(262)

Side by Side Diff: components/mus/ws/test_utils.h

Issue 2094933003: mus: Add UserActivityMonitor. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « components/mus/ws/display.cc ('k') | components/mus/ws/user_activity_monitor.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 <vector> 10 #include <vector>
11 11
12 #include "components/mus/public/interfaces/display.mojom.h" 12 #include "components/mus/public/interfaces/display.mojom.h"
13 #include "components/mus/public/interfaces/window_tree.mojom.h" 13 #include "components/mus/public/interfaces/window_tree.mojom.h"
14 #include "components/mus/ws/display.h" 14 #include "components/mus/ws/display.h"
15 #include "components/mus/ws/display_binding.h" 15 #include "components/mus/ws/display_binding.h"
16 #include "components/mus/ws/event_dispatcher.h" 16 #include "components/mus/ws/event_dispatcher.h"
17 #include "components/mus/ws/platform_display.h" 17 #include "components/mus/ws/platform_display.h"
18 #include "components/mus/ws/platform_display_factory.h" 18 #include "components/mus/ws/platform_display_factory.h"
19 #include "components/mus/ws/test_change_tracker.h" 19 #include "components/mus/ws/test_change_tracker.h"
20 #include "components/mus/ws/user_activity_monitor.h"
20 #include "components/mus/ws/user_display_manager.h" 21 #include "components/mus/ws/user_display_manager.h"
21 #include "components/mus/ws/user_id.h" 22 #include "components/mus/ws/user_id.h"
22 #include "components/mus/ws/window_manager_state.h" 23 #include "components/mus/ws/window_manager_state.h"
23 #include "components/mus/ws/window_manager_window_tree_factory_set.h" 24 #include "components/mus/ws/window_manager_window_tree_factory_set.h"
24 #include "components/mus/ws/window_server_delegate.h" 25 #include "components/mus/ws/window_server_delegate.h"
25 #include "components/mus/ws/window_tree.h" 26 #include "components/mus/ws/window_tree.h"
26 #include "components/mus/ws/window_tree_binding.h" 27 #include "components/mus/ws/window_tree_binding.h"
27 28
28 namespace mus { 29 namespace mus {
29 namespace ws { 30 namespace ws {
(...skipping 30 matching lines...) Expand all
60 } 61 }
61 62
62 private: 63 private:
63 UserDisplayManager* udm_; 64 UserDisplayManager* udm_;
64 65
65 DISALLOW_COPY_AND_ASSIGN(UserDisplayManagerTestApi); 66 DISALLOW_COPY_AND_ASSIGN(UserDisplayManagerTestApi);
66 }; 67 };
67 68
68 // ----------------------------------------------------------------------------- 69 // -----------------------------------------------------------------------------
69 70
71 class UserActivityMonitorTestApi {
72 public:
73 explicit UserActivityMonitorTestApi(UserActivityMonitor* monitor)
74 : monitor_(monitor) {}
75
76 void SetTimerTaskRunner(
77 scoped_refptr<base::SingleThreadTaskRunner> task_runner) {
78 monitor_->idle_timer_.SetTaskRunner(task_runner);
79 }
80
81 private:
82 UserActivityMonitor* monitor_;
83 DISALLOW_COPY_AND_ASSIGN(UserActivityMonitorTestApi);
84 };
85
86 // -----------------------------------------------------------------------------
87
70 class WindowTreeTestApi { 88 class WindowTreeTestApi {
71 public: 89 public:
72 explicit WindowTreeTestApi(WindowTree* tree); 90 explicit WindowTreeTestApi(WindowTree* tree);
73 ~WindowTreeTestApi(); 91 ~WindowTreeTestApi();
74 92
75 void set_user_id(const UserId& user_id) { tree_->user_id_ = user_id; } 93 void set_user_id(const UserId& user_id) { tree_->user_id_ = user_id; }
76 void set_window_manager_internal(mojom::WindowManager* wm_internal) { 94 void set_window_manager_internal(mojom::WindowManager* wm_internal) {
77 tree_->window_manager_internal_ = wm_internal; 95 tree_->window_manager_internal_ = wm_internal;
78 } 96 }
79 void AckOldestEvent() { 97 void AckOldestEvent() {
(...skipping 430 matching lines...) Expand 10 before | Expand all | Expand 10 after
510 ServerWindow* NewWindowInTree(WindowTree* tree, ClientWindowId* client_id); 528 ServerWindow* NewWindowInTree(WindowTree* tree, ClientWindowId* client_id);
511 ServerWindow* NewWindowInTreeWithParent(WindowTree* tree, 529 ServerWindow* NewWindowInTreeWithParent(WindowTree* tree,
512 ServerWindow* parent, 530 ServerWindow* parent,
513 ClientWindowId* client_id); 531 ClientWindowId* client_id);
514 532
515 } // namespace test 533 } // namespace test
516 } // namespace ws 534 } // namespace ws
517 } // namespace mus 535 } // namespace mus
518 536
519 #endif // COMPONENTS_MUS_WS_TEST_UTILS_H_ 537 #endif // COMPONENTS_MUS_WS_TEST_UTILS_H_
OLDNEW
« no previous file with comments | « components/mus/ws/display.cc ('k') | components/mus/ws/user_activity_monitor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698