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

Side by Side Diff: services/ui/ws/test_utils.h

Issue 2829733002: mus: Changes SetDisplayRoot() to create actual display (Closed)
Patch Set: screenmanagerforwarding only ozone Created 3 years, 8 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
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 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 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 void AckLastAccelerator( 120 void AckLastAccelerator(
121 mojom::EventResult result, 121 mojom::EventResult result,
122 const std::unordered_map<std::string, std::vector<uint8_t>>& properties = 122 const std::unordered_map<std::string, std::vector<uint8_t>>& properties =
123 std::unordered_map<std::string, std::vector<uint8_t>>()) { 123 std::unordered_map<std::string, std::vector<uint8_t>>()) {
124 tree_->OnAcceleratorAck(tree_->event_ack_id_, result, properties); 124 tree_->OnAcceleratorAck(tree_->event_ack_id_, result, properties);
125 } 125 }
126 126
127 void StartPointerWatcher(bool want_moves); 127 void StartPointerWatcher(bool want_moves);
128 void StopPointerWatcher(); 128 void StopPointerWatcher();
129 129
130 bool ProcessSetDisplayRoot(int64_t display_id, 130 bool ProcessSetDisplayRoot(const display::Display& display_to_create,
131 const mojom::WmViewportMetrics& viewport_metrics,
132 bool is_primary_display,
131 const ClientWindowId& client_window_id) { 133 const ClientWindowId& client_window_id) {
132 return tree_->ProcessSetDisplayRoot(display_id, client_window_id); 134 return tree_->ProcessSetDisplayRoot(display_to_create, viewport_metrics,
135 is_primary_display, client_window_id);
133 } 136 }
134 137
135 private: 138 private:
136 WindowTree* tree_; 139 WindowTree* tree_;
137 140
138 DISALLOW_COPY_AND_ASSIGN(WindowTreeTestApi); 141 DISALLOW_COPY_AND_ASSIGN(WindowTreeTestApi);
139 }; 142 };
140 143
141 // ----------------------------------------------------------------------------- 144 // -----------------------------------------------------------------------------
142 145
(...skipping 440 matching lines...) Expand 10 before | Expand all | Expand 10 after
583 // WindowServerDelegate: 586 // WindowServerDelegate:
584 void StartDisplayInit() override; 587 void StartDisplayInit() override;
585 void OnNoMoreDisplays() override; 588 void OnNoMoreDisplays() override;
586 std::unique_ptr<WindowTreeBinding> CreateWindowTreeBinding( 589 std::unique_ptr<WindowTreeBinding> CreateWindowTreeBinding(
587 BindingType type, 590 BindingType type,
588 ws::WindowServer* window_server, 591 ws::WindowServer* window_server,
589 ws::WindowTree* tree, 592 ws::WindowTree* tree,
590 mojom::WindowTreeRequest* tree_request, 593 mojom::WindowTreeRequest* tree_request,
591 mojom::WindowTreeClientPtr* client) override; 594 mojom::WindowTreeClientPtr* client) override;
592 bool IsTestConfig() const override; 595 bool IsTestConfig() const override;
596 display::ScreenBase* GetScreen() override;
593 597
594 private: 598 private:
595 WindowServer* window_server_ = nullptr; 599 WindowServer* window_server_ = nullptr;
596 bool got_on_no_more_displays_ = false; 600 bool got_on_no_more_displays_ = false;
597 // All TestWindowTreeBinding objects created via CreateWindowTreeBinding. 601 // All TestWindowTreeBinding objects created via CreateWindowTreeBinding.
598 // These are owned by the corresponding WindowTree. 602 // These are owned by the corresponding WindowTree.
599 std::vector<TestWindowTreeBinding*> bindings_; 603 std::vector<TestWindowTreeBinding*> bindings_;
604 std::unique_ptr<display::ScreenBase> screen_;
kylechar 2017/04/19 18:06:08 TestScreenManager also creates a ScreenBase so som
sky 2017/04/19 19:30:03 Removed.
600 605
601 DISALLOW_COPY_AND_ASSIGN(TestWindowServerDelegate); 606 DISALLOW_COPY_AND_ASSIGN(TestWindowServerDelegate);
602 }; 607 };
603 608
604 // ----------------------------------------------------------------------------- 609 // -----------------------------------------------------------------------------
605 610
606 // Helper class which creates and sets up the necessary objects for tests that 611 // Helper class which creates and sets up the necessary objects for tests that
607 // use the WindowServer. 612 // use the WindowServer.
608 class WindowServerTestHelper { 613 class WindowServerTestHelper {
609 public: 614 public:
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
714 ClientWindowId* client_id = nullptr); 719 ClientWindowId* client_id = nullptr);
715 ServerWindow* NewWindowInTreeWithParent(WindowTree* tree, 720 ServerWindow* NewWindowInTreeWithParent(WindowTree* tree,
716 ServerWindow* parent, 721 ServerWindow* parent,
717 ClientWindowId* client_id = nullptr); 722 ClientWindowId* client_id = nullptr);
718 723
719 } // namespace test 724 } // namespace test
720 } // namespace ws 725 } // namespace ws
721 } // namespace ui 726 } // namespace ui
722 727
723 #endif // SERVICES_UI_WS_TEST_UTILS_H_ 728 #endif // SERVICES_UI_WS_TEST_UTILS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698