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

Side by Side Diff: components/mus/public/cpp/tests/window_server_test_base.h

Issue 1406153004: components/mus/public/interfaces View => Window (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Yet another rebase Created 5 years, 2 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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_PUBLIC_CPP_TESTS_WINDOW_SERVER_TEST_BASE_H_ 5 #ifndef COMPONENTS_MUS_PUBLIC_CPP_TESTS_WINDOW_SERVER_TEST_BASE_H_
6 #define COMPONENTS_MUS_PUBLIC_CPP_TESTS_WINDOW_SERVER_TEST_BASE_H_ 6 #define COMPONENTS_MUS_PUBLIC_CPP_TESTS_WINDOW_SERVER_TEST_BASE_H_
7 7
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "components/mus/public/cpp/window_tree_delegate.h" 9 #include "components/mus/public/cpp/window_tree_delegate.h"
10 #include "components/mus/public/interfaces/view_tree.mojom.h" 10 #include "components/mus/public/interfaces/window_tree.mojom.h"
11 #include "components/mus/public/interfaces/view_tree_host.mojom.h" 11 #include "components/mus/public/interfaces/window_tree_host.mojom.h"
12 #include "mojo/application/public/cpp/application_delegate.h" 12 #include "mojo/application/public/cpp/application_delegate.h"
13 #include "mojo/application/public/cpp/application_test_base.h" 13 #include "mojo/application/public/cpp/application_test_base.h"
14 #include "mojo/application/public/cpp/interface_factory.h" 14 #include "mojo/application/public/cpp/interface_factory.h"
15 15
16 namespace mus { 16 namespace mus {
17 17
18 // WindowServerTestBase is a base class for use with app tests that use 18 // WindowServerTestBase is a base class for use with app tests that use
19 // WindowServer. SetUp() connects to the WindowServer and blocks until OnEmbed() 19 // WindowServer. SetUp() connects to the WindowServer and blocks until OnEmbed()
20 // has been invoked. window_manager() can be used to access the WindowServer 20 // has been invoked. window_manager() can be used to access the WindowServer
21 // established as part of SetUp(). 21 // established as part of SetUp().
22 class WindowServerTestBase 22 class WindowServerTestBase
23 : public mojo::test::ApplicationTestBase, 23 : public mojo::test::ApplicationTestBase,
24 public mojo::ApplicationDelegate, 24 public mojo::ApplicationDelegate,
25 public WindowTreeDelegate, 25 public WindowTreeDelegate,
26 public mojo::InterfaceFactory<mojo::ViewTreeClient> { 26 public mojo::InterfaceFactory<mojom::WindowTreeClient> {
27 public: 27 public:
28 WindowServerTestBase(); 28 WindowServerTestBase();
29 ~WindowServerTestBase() override; 29 ~WindowServerTestBase() override;
30 30
31 // True if WindowTreeDelegate::OnConnectionLost() was called. 31 // True if WindowTreeDelegate::OnConnectionLost() was called.
32 bool window_tree_connection_destroyed() const { 32 bool window_tree_connection_destroyed() const {
33 return window_tree_connection_destroyed_; 33 return window_tree_connection_destroyed_;
34 } 34 }
35 35
36 // Runs the MessageLoop until QuitRunLoop() is called, or a timeout occurs. 36 // Runs the MessageLoop until QuitRunLoop() is called, or a timeout occurs.
(...skipping 20 matching lines...) Expand all
57 mojo::ApplicationDelegate* GetApplicationDelegate() override; 57 mojo::ApplicationDelegate* GetApplicationDelegate() override;
58 58
59 // ApplicationDelegate: 59 // ApplicationDelegate:
60 bool ConfigureIncomingConnection( 60 bool ConfigureIncomingConnection(
61 mojo::ApplicationConnection* connection) override; 61 mojo::ApplicationConnection* connection) override;
62 62
63 // WindowTreeDelegate: 63 // WindowTreeDelegate:
64 void OnEmbed(Window* root) override; 64 void OnEmbed(Window* root) override;
65 void OnConnectionLost(WindowTreeConnection* connection) override; 65 void OnConnectionLost(WindowTreeConnection* connection) override;
66 66
67 // InterfaceFactory<ViewTreeClient>: 67 // InterfaceFactory<WindowTreeClient>:
68 void Create(mojo::ApplicationConnection* connection, 68 void Create(mojo::ApplicationConnection* connection,
69 mojo::InterfaceRequest<mojo::ViewTreeClient> request) override; 69 mojo::InterfaceRequest<mojom::WindowTreeClient> request) override;
70 70
71 // Used to receive the most recent view tree connection loaded by an embed 71 // Used to receive the most recent view tree connection loaded by an embed
72 // action. 72 // action.
73 WindowTreeConnection* most_recent_connection_; 73 WindowTreeConnection* most_recent_connection_;
74 74
75 private: 75 private:
76 mojo::ViewTreeHostPtr host_; 76 mojom::WindowTreeHostPtr host_;
77 77
78 // The View Manager connection held by the window manager (app running at the 78 // The View Manager connection held by the window manager (app running at the
79 // root view). 79 // root view).
80 WindowTreeConnection* window_manager_; 80 WindowTreeConnection* window_manager_;
81 81
82 bool window_tree_connection_destroyed_; 82 bool window_tree_connection_destroyed_;
83 83
84 MOJO_DISALLOW_COPY_AND_ASSIGN(WindowServerTestBase); 84 MOJO_DISALLOW_COPY_AND_ASSIGN(WindowServerTestBase);
85 }; 85 };
86 86
87 } // namespace mus 87 } // namespace mus
88 88
89 #endif // COMPONENTS_MUS_PUBLIC_CPP_TESTS_WINDOW_SERVER_TEST_BASE_H_ 89 #endif // COMPONENTS_MUS_PUBLIC_CPP_TESTS_WINDOW_SERVER_TEST_BASE_H_
OLDNEW
« no previous file with comments | « components/mus/public/cpp/output_surface.h ('k') | components/mus/public/cpp/tests/window_server_test_base.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698