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

Side by Side Diff: ui/aura/test/aura_test_base.h

Issue 2849423002: Use ScopedTaskEnvironment instead of MessageLoopForUI in ui/aura/test/. (Closed)
Patch Set: add-deps Created 3 years, 7 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
« no previous file with comments | « ui/aura/BUILD.gn ('k') | ui/aura/test/aura_test_base.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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 UI_AURA_TEST_AURA_TEST_BASE_H_ 5 #ifndef UI_AURA_TEST_AURA_TEST_BASE_H_
6 #define UI_AURA_TEST_AURA_TEST_BASE_H_ 6 #define UI_AURA_TEST_AURA_TEST_BASE_H_
7 7
8 #include <memory> 8 #include <memory>
9 #include <vector> 9 #include <vector>
10 10
11 #include "base/compiler_specific.h" 11 #include "base/compiler_specific.h"
12 #include "base/macros.h" 12 #include "base/macros.h"
13 #include "base/message_loop/message_loop.h" 13 #include "base/test/scoped_task_environment.h"
14 #include "testing/gtest/include/gtest/gtest.h" 14 #include "testing/gtest/include/gtest/gtest.h"
15 #include "ui/aura/mus/property_converter.h" 15 #include "ui/aura/mus/property_converter.h"
16 #include "ui/aura/mus/window_manager_delegate.h" 16 #include "ui/aura/mus/window_manager_delegate.h"
17 #include "ui/aura/mus/window_tree_client_delegate.h" 17 #include "ui/aura/mus/window_tree_client_delegate.h"
18 #include "ui/aura/test/aura_test_helper.h" 18 #include "ui/aura/test/aura_test_helper.h"
19 19
20 namespace ui { 20 namespace ui {
21 namespace mojom { 21 namespace mojom {
22 class WindowTreeClient; 22 class WindowTreeClient;
23 } 23 }
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 void OnWmCancelMoveLoop(Window* window) override; 133 void OnWmCancelMoveLoop(Window* window) override;
134 void OnWmSetClientArea( 134 void OnWmSetClientArea(
135 Window* window, 135 Window* window,
136 const gfx::Insets& insets, 136 const gfx::Insets& insets,
137 const std::vector<gfx::Rect>& additional_client_areas) override; 137 const std::vector<gfx::Rect>& additional_client_areas) override;
138 bool IsWindowActive(aura::Window* window) override; 138 bool IsWindowActive(aura::Window* window) override;
139 void OnWmDeactivateWindow(Window* window) override; 139 void OnWmDeactivateWindow(Window* window) override;
140 PropertyConverter* GetPropertyConverter() override; 140 PropertyConverter* GetPropertyConverter() override;
141 141
142 private: 142 private:
143 base::test::ScopedTaskEnvironment scoped_task_environment_;
144
143 // Only used for mus. Both are are initialized to this, but may be reset. 145 // Only used for mus. Both are are initialized to this, but may be reset.
144 WindowManagerDelegate* window_manager_delegate_; 146 WindowManagerDelegate* window_manager_delegate_;
145 WindowTreeClientDelegate* window_tree_client_delegate_; 147 WindowTreeClientDelegate* window_tree_client_delegate_;
146 148
147 bool use_mus_ = false; 149 bool use_mus_ = false;
148 bool setup_called_ = false; 150 bool setup_called_ = false;
149 bool teardown_called_ = false; 151 bool teardown_called_ = false;
150 base::MessageLoopForUI message_loop_;
151 PropertyConverter property_converter_; 152 PropertyConverter property_converter_;
152 std::unique_ptr<AuraTestHelper> helper_; 153 std::unique_ptr<AuraTestHelper> helper_;
153 std::vector<std::unique_ptr<WindowTreeHostMus>> window_tree_hosts_; 154 std::vector<std::unique_ptr<WindowTreeHostMus>> window_tree_hosts_;
154 155
155 DISALLOW_COPY_AND_ASSIGN(AuraTestBase); 156 DISALLOW_COPY_AND_ASSIGN(AuraTestBase);
156 }; 157 };
157 158
158 // Use as a base class for tests that want to target both backends. 159 // Use as a base class for tests that want to target both backends.
159 class AuraTestBaseWithType : public AuraTestBase, 160 class AuraTestBaseWithType : public AuraTestBase,
160 public ::testing::WithParamInterface<BackendType> { 161 public ::testing::WithParamInterface<BackendType> {
(...skipping 19 matching lines...) Expand all
180 void SetUp() override; 181 void SetUp() override;
181 182
182 private: 183 private:
183 DISALLOW_COPY_AND_ASSIGN(AuraTestBaseMus); 184 DISALLOW_COPY_AND_ASSIGN(AuraTestBaseMus);
184 }; 185 };
185 186
186 } // namespace test 187 } // namespace test
187 } // namespace aura 188 } // namespace aura
188 189
189 #endif // UI_AURA_TEST_AURA_TEST_BASE_H_ 190 #endif // UI_AURA_TEST_AURA_TEST_BASE_H_
OLDNEW
« no previous file with comments | « ui/aura/BUILD.gn ('k') | ui/aura/test/aura_test_base.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698