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

Side by Side Diff: ui/aura/test/aura_test_helper.cc

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/test/aura_test_helper.h ('k') | ui/keyboard/keyboard_controller_unittest.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 #include "ui/aura/test/aura_test_helper.h" 5 #include "ui/aura/test/aura_test_helper.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/memory/ptr_util.h" 8 #include "base/memory/ptr_util.h"
9 #include "base/message_loop/message_loop.h"
10 #include "base/run_loop.h" 9 #include "base/run_loop.h"
11 #include "ui/aura/client/default_capture_client.h" 10 #include "ui/aura/client/default_capture_client.h"
12 #include "ui/aura/client/focus_client.h" 11 #include "ui/aura/client/focus_client.h"
13 #include "ui/aura/env.h" 12 #include "ui/aura/env.h"
14 #include "ui/aura/input_state_lookup.h" 13 #include "ui/aura/input_state_lookup.h"
15 #include "ui/aura/mus/capture_synchronizer.h" 14 #include "ui/aura/mus/capture_synchronizer.h"
16 #include "ui/aura/mus/focus_synchronizer.h" 15 #include "ui/aura/mus/focus_synchronizer.h"
17 #include "ui/aura/mus/window_port_mus.h" 16 #include "ui/aura/mus/window_port_mus.h"
18 #include "ui/aura/mus/window_tree_client.h" 17 #include "ui/aura/mus/window_tree_client.h"
19 #include "ui/aura/test/env_test_helper.h" 18 #include "ui/aura/test/env_test_helper.h"
(...skipping 21 matching lines...) Expand all
41 #endif 40 #endif
42 41
43 namespace aura { 42 namespace aura {
44 namespace test { 43 namespace test {
45 namespace { 44 namespace {
46 45
47 AuraTestHelper* g_instance = nullptr; 46 AuraTestHelper* g_instance = nullptr;
48 47
49 } // namespace 48 } // namespace
50 49
51 AuraTestHelper::AuraTestHelper(base::MessageLoopForUI* message_loop) 50 AuraTestHelper::AuraTestHelper()
52 : setup_called_(false), teardown_called_(false) { 51 : setup_called_(false), teardown_called_(false) {
53 DCHECK(message_loop);
54 // Disable animations during tests. 52 // Disable animations during tests.
55 zero_duration_mode_.reset(new ui::ScopedAnimationDurationScaleMode( 53 zero_duration_mode_.reset(new ui::ScopedAnimationDurationScaleMode(
56 ui::ScopedAnimationDurationScaleMode::ZERO_DURATION)); 54 ui::ScopedAnimationDurationScaleMode::ZERO_DURATION));
57 ui::test::EnableTestConfigForPlatformWindows(); 55 ui::test::EnableTestConfigForPlatformWindows();
58 InitializeAuraEventGeneratorDelegate(); 56 InitializeAuraEventGeneratorDelegate();
59 } 57 }
60 58
61 AuraTestHelper::~AuraTestHelper() { 59 AuraTestHelper::~AuraTestHelper() {
62 CHECK(setup_called_) 60 CHECK(setup_called_)
63 << "AuraTestHelper::SetUp() never called."; 61 << "AuraTestHelper::SetUp() never called.";
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
202 window_tree_client_setup_ = base::MakeUnique<TestWindowTreeClientSetup>(); 200 window_tree_client_setup_ = base::MakeUnique<TestWindowTreeClientSetup>();
203 window_tree_client_setup_->InitForWindowManager(window_tree_delegate_, 201 window_tree_client_setup_->InitForWindowManager(window_tree_delegate_,
204 window_manager_delegate_); 202 window_manager_delegate_);
205 window_tree_client_ = window_tree_client_setup_->window_tree_client(); 203 window_tree_client_ = window_tree_client_setup_->window_tree_client();
206 window_tree_client_->capture_synchronizer()->AttachToCaptureClient( 204 window_tree_client_->capture_synchronizer()->AttachToCaptureClient(
207 capture_client_.get()); 205 capture_client_.get());
208 } 206 }
209 207
210 } // namespace test 208 } // namespace test
211 } // namespace aura 209 } // namespace aura
OLDNEW
« no previous file with comments | « ui/aura/test/aura_test_helper.h ('k') | ui/keyboard/keyboard_controller_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698