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

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

Issue 2497303002: Fix ws::Display initialization order. (Closed)
Patch Set: Fix method name. Created 4 years, 1 month 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 230 matching lines...) Expand 10 before | Expand all | Expand 10 after
241 241
242 // Factory that dispenses TestPlatformDisplays. 242 // Factory that dispenses TestPlatformDisplays.
243 class TestPlatformDisplayFactory : public PlatformDisplayFactory { 243 class TestPlatformDisplayFactory : public PlatformDisplayFactory {
244 public: 244 public:
245 static const int64_t kFirstDisplayId; 245 static const int64_t kFirstDisplayId;
246 246
247 explicit TestPlatformDisplayFactory(mojom::Cursor* cursor_storage); 247 explicit TestPlatformDisplayFactory(mojom::Cursor* cursor_storage);
248 ~TestPlatformDisplayFactory(); 248 ~TestPlatformDisplayFactory();
249 249
250 // PlatformDisplayFactory: 250 // PlatformDisplayFactory:
251 PlatformDisplay* CreatePlatformDisplay() override; 251 std::unique_ptr<PlatformDisplay> CreatePlatformDisplay() override;
252 252
253 private: 253 private:
254 mojom::Cursor* cursor_storage_; 254 mojom::Cursor* cursor_storage_;
255 int64_t next_display_id_; 255 int64_t next_display_id_;
256 256
257 DISALLOW_COPY_AND_ASSIGN(TestPlatformDisplayFactory); 257 DISALLOW_COPY_AND_ASSIGN(TestPlatformDisplayFactory);
258 }; 258 };
259 259
260 // ----------------------------------------------------------------------------- 260 // -----------------------------------------------------------------------------
261 261
(...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after
602 TestWindowTreeClient* last_window_tree_client() { 602 TestWindowTreeClient* last_window_tree_client() {
603 return ws_test_helper_.window_server_delegate()->last_client(); 603 return ws_test_helper_.window_server_delegate()->last_client();
604 } 604 }
605 TestWindowTreeClient* wm_client() { return wm_client_; } 605 TestWindowTreeClient* wm_client() { return wm_client_; }
606 WindowServer* window_server() { return ws_test_helper_.window_server(); } 606 WindowServer* window_server() { return ws_test_helper_.window_server(); }
607 607
608 private: 608 private:
609 WindowServerTestHelper ws_test_helper_; 609 WindowServerTestHelper ws_test_helper_;
610 // TestWindowTreeClient that is used for the WM client. Owned by 610 // TestWindowTreeClient that is used for the WM client. Owned by
611 // |window_server_delegate_| 611 // |window_server_delegate_|
612 TestWindowTreeClient* wm_client_; 612 TestWindowTreeClient* wm_client_ = nullptr;
613 // Owned by WindowServer 613 // Owned by WindowServer
614 TestDisplayBinding* display_binding_; 614 TestDisplayBinding* display_binding_ = nullptr;
615 // Owned by WindowServer's DisplayManager. 615 // Owned by WindowServer's DisplayManager.
616 Display* display_; 616 Display* display_ = nullptr;
617 scoped_refptr<DisplayCompositor> display_compositor_; 617 scoped_refptr<DisplayCompositor> display_compositor_;
618 618
619 DISALLOW_COPY_AND_ASSIGN(WindowEventTargetingHelper); 619 DISALLOW_COPY_AND_ASSIGN(WindowEventTargetingHelper);
620 }; 620 };
621 621
622 // ----------------------------------------------------------------------------- 622 // -----------------------------------------------------------------------------
623 623
624 // Adds a new WM to |window_server| for |user_id|. Creates 624 // Adds a new WM to |window_server| for |user_id|. Creates
625 // WindowManagerWindowTreeFactory and associated WindowTree for the WM. 625 // WindowManagerWindowTreeFactory and associated WindowTree for the WM.
626 void AddWindowManager(WindowServer* window_server, const UserId& user_id); 626 void AddWindowManager(WindowServer* window_server, const UserId& user_id);
(...skipping 15 matching lines...) Expand all
642 ServerWindow* NewWindowInTree(WindowTree* tree, ClientWindowId* client_id); 642 ServerWindow* NewWindowInTree(WindowTree* tree, ClientWindowId* client_id);
643 ServerWindow* NewWindowInTreeWithParent(WindowTree* tree, 643 ServerWindow* NewWindowInTreeWithParent(WindowTree* tree,
644 ServerWindow* parent, 644 ServerWindow* parent,
645 ClientWindowId* client_id); 645 ClientWindowId* client_id);
646 646
647 } // namespace test 647 } // namespace test
648 } // namespace ws 648 } // namespace ws
649 } // namespace ui 649 } // namespace ui
650 650
651 #endif // SERVICES_UI_WS_TEST_UTILS_H_ 651 #endif // SERVICES_UI_WS_TEST_UTILS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698