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

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

Issue 2018823002: Eliminate WindowTreeConnection (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@connection
Patch Set: . Created 4 years, 6 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
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef COMPONENTS_MUS_PUBLIC_CPP_TESTS_TEST_WINDOW_TREE_CLIENT_SETUP_H_
6 #define COMPONENTS_MUS_PUBLIC_CPP_TESTS_TEST_WINDOW_TREE_CLIENT_SETUP_H_
7
8 #include <memory>
9
10 #include "base/macros.h"
11 #include "components/mus/public/cpp/window_tree_client_observer.h"
12
13 namespace mus {
14
15 class TestWindowTree;
16 class WindowManagerDelegate;
17 class WindowTreeClient;
18 class WindowTreeClientDelegate;
19
20 // TestWindowTreeClientSetup is used to create a WindowTreeClient that is not
21 // connected to mus.
22 class TestWindowTreeClientSetup : public mus::WindowTreeClientObserver {
23 public:
24 TestWindowTreeClientSetup();
25 ~TestWindowTreeClientSetup() override;
26
27 // Initializes the WindowTreeClient. |window_manager_delegate| may be
28 // null.
29 void Init(WindowTreeClientDelegate* window_tree_delegate,
30 WindowManagerDelegate* window_manager_delegate);
31
32 // The WindowTree that WindowTreeClient talks to.
33 TestWindowTree* window_tree() { return window_tree_.get(); }
34
35 WindowTreeClient* window_tree_client();
36
37 private:
38 // mus::WindowTreeClientObserver:
39 void OnWillDestroyClient(mus::WindowTreeClient* client) override;
40
41 std::unique_ptr<TestWindowTree> window_tree_;
42
43 // See description of WindowTreeClientDelegate for details on ownership. The
44 // WindowTreeClient may be deleted during shutdown by the test. If not,
45 // we own it and must delete it.
46 std::unique_ptr<WindowTreeClient> window_tree_client_;
47
48 DISALLOW_COPY_AND_ASSIGN(TestWindowTreeClientSetup);
49 };
50
51 } // namespace mus
52
53 #endif // COMPONENTS_MUS_PUBLIC_CPP_TESTS_TEST_WINDOW_TREE_CLIENT_SETUP_H_
OLDNEW
« no previous file with comments | « components/mus/public/cpp/tests/BUILD.gn ('k') | components/mus/public/cpp/tests/test_window_tree_client_setup.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698