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

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

Issue 2497303002: Fix ws::Display initialization order. (Closed)
Patch Set: Fix use after move in test. 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
« no previous file with comments | « services/ui/ws/platform_display_factory.h ('k') | services/ui/ws/test_utils.cc » ('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 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 341 matching lines...) Expand 10 before | Expand all | Expand 10 after
603 TestWindowTreeClient* last_window_tree_client() { 603 TestWindowTreeClient* last_window_tree_client() {
604 return ws_test_helper_.window_server_delegate()->last_client(); 604 return ws_test_helper_.window_server_delegate()->last_client();
605 } 605 }
606 TestWindowTreeClient* wm_client() { return wm_client_; } 606 TestWindowTreeClient* wm_client() { return wm_client_; }
607 WindowServer* window_server() { return ws_test_helper_.window_server(); } 607 WindowServer* window_server() { return ws_test_helper_.window_server(); }
608 608
609 private: 609 private:
610 WindowServerTestHelper ws_test_helper_; 610 WindowServerTestHelper ws_test_helper_;
611 // TestWindowTreeClient that is used for the WM client. Owned by 611 // TestWindowTreeClient that is used for the WM client. Owned by
612 // |window_server_delegate_| 612 // |window_server_delegate_|
613 TestWindowTreeClient* wm_client_; 613 TestWindowTreeClient* wm_client_ = nullptr;
614 // Owned by WindowServer 614 // Owned by WindowServer
615 TestDisplayBinding* display_binding_; 615 TestDisplayBinding* display_binding_ = nullptr;
616 // Owned by WindowServer's DisplayManager. 616 // Owned by WindowServer's DisplayManager.
617 Display* display_; 617 Display* display_ = nullptr;
618 scoped_refptr<DisplayCompositor> display_compositor_; 618 scoped_refptr<DisplayCompositor> display_compositor_;
619 619
620 DISALLOW_COPY_AND_ASSIGN(WindowEventTargetingHelper); 620 DISALLOW_COPY_AND_ASSIGN(WindowEventTargetingHelper);
621 }; 621 };
622 622
623 // ----------------------------------------------------------------------------- 623 // -----------------------------------------------------------------------------
624 624
625 // Adds a new WM to |window_server| for |user_id|. Creates 625 // Adds a new WM to |window_server| for |user_id|. Creates
626 // WindowManagerWindowTreeFactory and associated WindowTree for the WM. 626 // WindowManagerWindowTreeFactory and associated WindowTree for the WM.
627 void AddWindowManager(WindowServer* window_server, const UserId& user_id); 627 void AddWindowManager(WindowServer* window_server, const UserId& user_id);
(...skipping 15 matching lines...) Expand all
643 ServerWindow* NewWindowInTree(WindowTree* tree, ClientWindowId* client_id); 643 ServerWindow* NewWindowInTree(WindowTree* tree, ClientWindowId* client_id);
644 ServerWindow* NewWindowInTreeWithParent(WindowTree* tree, 644 ServerWindow* NewWindowInTreeWithParent(WindowTree* tree,
645 ServerWindow* parent, 645 ServerWindow* parent,
646 ClientWindowId* client_id); 646 ClientWindowId* client_id);
647 647
648 } // namespace test 648 } // namespace test
649 } // namespace ws 649 } // namespace ws
650 } // namespace ui 650 } // namespace ui
651 651
652 #endif // SERVICES_UI_WS_TEST_UTILS_H_ 652 #endif // SERVICES_UI_WS_TEST_UTILS_H_
OLDNEW
« no previous file with comments | « services/ui/ws/platform_display_factory.h ('k') | services/ui/ws/test_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698