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

Unified Diff: services/ui/ws/test_utils.h

Issue 2904993003: chromeos: changes how DisplayManagerObservers are notified (Closed)
Patch Set: cleanup Created 3 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « services/ui/ws/display_manager.cc ('k') | services/ui/ws/test_utils.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/ui/ws/test_utils.h
diff --git a/services/ui/ws/test_utils.h b/services/ui/ws/test_utils.h
index b5a9886d49b5afeea96ffad4d576f2c728e8f16c..da87cc8d749f5b318c8998ca915dd5f2c225be10 100644
--- a/services/ui/ws/test_utils.h
+++ b/services/ui/ws/test_utils.h
@@ -597,6 +597,8 @@ class TestWindowServerDelegate : public WindowServerDelegate {
mojom::WindowTreeRequest* tree_request,
mojom::WindowTreeClientPtr* client) override;
bool IsTestConfig() const override;
+ void OnWillCreateTreeForWindowManager(
+ bool automatically_create_display_roots) override;
private:
WindowServer* window_server_ = nullptr;
@@ -690,6 +692,32 @@ class WindowEventTargetingHelper {
// -----------------------------------------------------------------------------
+class TestDisplayManagerObserver : public mojom::DisplayManagerObserver {
+ public:
+ TestDisplayManagerObserver();
+ ~TestDisplayManagerObserver() override;
+
+ mojom::DisplayManagerObserverPtr GetPtr();
+
+ std::string GetAndClearObserverCalls();
+
+ private:
+ std::string DisplayIdsToString(
+ const std::vector<mojom::WsDisplayPtr>& wm_displays);
+
+ // mojom::DisplayManagerObserver:
+ void OnDisplaysChanged(std::vector<mojom::WsDisplayPtr> displays,
+ int64_t primary_display_id,
+ int64_t internal_display_id) override;
+
+ mojo::Binding<mojom::DisplayManagerObserver> binding_;
+ std::string observer_calls_;
+
+ DISALLOW_COPY_AND_ASSIGN(TestDisplayManagerObserver);
+};
+
+// -----------------------------------------------------------------------------
+
// Adds a new WM to |window_server| for |user_id|. Creates
// WindowManagerWindowTreeFactory and associated WindowTree for the WM.
void AddWindowManager(WindowServer* window_server,
« no previous file with comments | « services/ui/ws/display_manager.cc ('k') | services/ui/ws/test_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698