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

Side by Side Diff: chrome/test/base/view_event_test_base.cc

Issue 246633004: Remove non USE_AURA code from views files. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Just revert changes to ui/app_list/. Created 6 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 | Annotate | Revision Log
« no previous file with comments | « chrome/chrome_browser_ui.gypi ('k') | ui/base/cursor/cursor_loader_win.h » ('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 "chrome/test/base/view_event_test_base.h" 5 #include "chrome/test/base/view_event_test_base.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/message_loop/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 #include "base/strings/string_number_conversions.h" 10 #include "base/strings/string_number_conversions.h"
11 #include "chrome/test/base/chrome_unit_test_suite.h" 11 #include "chrome/test/base/chrome_unit_test_suite.h"
12 #include "chrome/test/base/interactive_test_utils.h" 12 #include "chrome/test/base/interactive_test_utils.h"
13 #include "chrome/test/base/testing_browser_process.h" 13 #include "chrome/test/base/testing_browser_process.h"
14 #include "chrome/test/base/ui_test_utils.h" 14 #include "chrome/test/base/ui_test_utils.h"
15 #include "ui/aura/client/event_client.h"
16 #include "ui/aura/env.h"
17 #include "ui/aura/test/aura_test_helper.h"
18 #include "ui/aura/window_event_dispatcher.h"
19 #include "ui/aura/window_tree_host.h"
15 #include "ui/base/ime/input_method_initializer.h" 20 #include "ui/base/ime/input_method_initializer.h"
16 #include "ui/base/test/ui_controls.h" 21 #include "ui/base/test/ui_controls.h"
17 #include "ui/compositor/test/context_factories_for_test.h" 22 #include "ui/compositor/test/context_factories_for_test.h"
23 #include "ui/compositor/test/context_factories_for_test.h"
18 #include "ui/message_center/message_center.h" 24 #include "ui/message_center/message_center.h"
19 #include "ui/views/view.h" 25 #include "ui/views/view.h"
20 #include "ui/views/widget/widget.h" 26 #include "ui/views/widget/widget.h"
27 #include "ui/wm/core/wm_state.h"
21 28
22 #if defined(USE_ASH) 29 #if defined(USE_ASH)
23 #include "ash/shell.h" 30 #include "ash/shell.h"
24 #include "ash/test/test_session_state_delegate.h" 31 #include "ash/test/test_session_state_delegate.h"
25 #include "ash/test/test_shell_delegate.h" 32 #include "ash/test/test_shell_delegate.h"
26 #endif 33 #endif
27 34
28 #if defined(USE_AURA)
29 #include "ui/aura/client/event_client.h"
30 #include "ui/aura/env.h"
31 #include "ui/aura/test/aura_test_helper.h"
32 #include "ui/aura/window_event_dispatcher.h"
33 #include "ui/aura/window_tree_host.h"
34 #include "ui/compositor/test/context_factories_for_test.h"
35 #include "ui/wm/core/wm_state.h"
36 #endif
37
38 #if defined(OS_CHROMEOS) 35 #if defined(OS_CHROMEOS)
39 #include "chromeos/audio/cras_audio_handler.h" 36 #include "chromeos/audio/cras_audio_handler.h"
40 #include "chromeos/dbus/dbus_thread_manager.h" 37 #include "chromeos/dbus/dbus_thread_manager.h"
41 #include "chromeos/network/network_handler.h" 38 #include "chromeos/network/network_handler.h"
42 #else // !defined(OS_CHROMEOS) 39 #else // !defined(OS_CHROMEOS)
43 #include "ui/views/widget/desktop_aura/desktop_screen.h" 40 #include "ui/views/widget/desktop_aura/desktop_screen.h"
44 #endif 41 #endif
45 42
46 namespace { 43 namespace {
47 44
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 ui_controls::RunClosureAfterAllPendingUIEvents( 92 ui_controls::RunClosureAfterAllPendingUIEvents(
96 base::MessageLoop::QuitClosure()); 93 base::MessageLoop::QuitClosure());
97 } 94 }
98 95
99 void ViewEventTestBase::SetUpTestCase() { 96 void ViewEventTestBase::SetUpTestCase() {
100 ChromeUnitTestSuite::InitializeProviders(); 97 ChromeUnitTestSuite::InitializeProviders();
101 ChromeUnitTestSuite::InitializeResourceBundle(); 98 ChromeUnitTestSuite::InitializeResourceBundle();
102 } 99 }
103 100
104 void ViewEventTestBase::SetUp() { 101 void ViewEventTestBase::SetUp() {
105 #if defined(USE_AURA)
106 wm_state_.reset(new wm::WMState); 102 wm_state_.reset(new wm::WMState);
107 #endif
108 103
109 views::ViewsDelegate::views_delegate = &views_delegate_; 104 views::ViewsDelegate::views_delegate = &views_delegate_;
110 ui::InitializeInputMethodForTesting(); 105 ui::InitializeInputMethodForTesting();
111 gfx::NativeView context = NULL; 106 gfx::NativeView context = NULL;
112 107
113 #if defined(USE_AURA)
114 // The ContextFactory must exist before any Compositors are created. 108 // The ContextFactory must exist before any Compositors are created.
115 bool enable_pixel_output = false; 109 bool enable_pixel_output = false;
116 ui::InitializeContextFactoryForTests(enable_pixel_output); 110 ui::InitializeContextFactoryForTests(enable_pixel_output);
117 #endif
118 111
119 #if defined(USE_ASH) 112 #if defined(USE_ASH)
120 #if defined(OS_WIN) 113 #if defined(OS_WIN)
121 // http://crbug.com/154081 use ash::Shell code path below on win_ash bots when 114 // http://crbug.com/154081 use ash::Shell code path below on win_ash bots when
122 // interactive_ui_tests is brought up on that platform. 115 // interactive_ui_tests is brought up on that platform.
123 gfx::Screen::SetScreenInstance( 116 gfx::Screen::SetScreenInstance(
124 gfx::SCREEN_TYPE_NATIVE, views::CreateDesktopScreen()); 117 gfx::SCREEN_TYPE_NATIVE, views::CreateDesktopScreen());
125 118
126 #else // !OS_WIN 119 #else // !OS_WIN
127 // Ash Shell can't just live on its own without a browser process, we need to 120 // Ash Shell can't just live on its own without a browser process, we need to
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
172 #endif 165 #endif
173 // Ash Shell can't just live on its own without a browser process, we need to 166 // Ash Shell can't just live on its own without a browser process, we need to
174 // also shut down the message center. 167 // also shut down the message center.
175 message_center::MessageCenter::Shutdown(); 168 message_center::MessageCenter::Shutdown();
176 #endif // !OS_WIN 169 #endif // !OS_WIN
177 aura::Env::DeleteInstance(); 170 aura::Env::DeleteInstance();
178 #elif defined(USE_AURA) 171 #elif defined(USE_AURA)
179 aura_test_helper_->TearDown(); 172 aura_test_helper_->TearDown();
180 #endif // !USE_ASH && USE_AURA 173 #endif // !USE_ASH && USE_AURA
181 174
182 #if defined(USE_AURA)
183 ui::TerminateContextFactoryForTests(); 175 ui::TerminateContextFactoryForTests();
184 #endif
185 176
186 ui::ShutdownInputMethodForTesting(); 177 ui::ShutdownInputMethodForTesting();
187 views::ViewsDelegate::views_delegate = NULL; 178 views::ViewsDelegate::views_delegate = NULL;
188 179
189 #if defined(USE_AURA)
190 wm_state_.reset(); 180 wm_state_.reset();
191 #endif
192 } 181 }
193 182
194 bool ViewEventTestBase::CanResize() const { 183 bool ViewEventTestBase::CanResize() const {
195 return true; 184 return true;
196 } 185 }
197 186
198 views::View* ViewEventTestBase::GetContentsView() { 187 views::View* ViewEventTestBase::GetContentsView() {
199 if (!content_view_) { 188 if (!content_view_) {
200 // Wrap the real view (as returned by CreateContentsView) in a View so 189 // Wrap the real view (as returned by CreateContentsView) in a View so
201 // that we can customize the preferred size. 190 // that we can customize the preferred size.
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
253 dnd_thread_.reset(NULL); 242 dnd_thread_.reset(NULL);
254 } 243 }
255 244
256 void ViewEventTestBase::RunTestMethod(const base::Closure& task) { 245 void ViewEventTestBase::RunTestMethod(const base::Closure& task) {
257 StopBackgroundThread(); 246 StopBackgroundThread();
258 247
259 task.Run(); 248 task.Run();
260 if (HasFatalFailure()) 249 if (HasFatalFailure())
261 Done(); 250 Done();
262 } 251 }
OLDNEW
« no previous file with comments | « chrome/chrome_browser_ui.gypi ('k') | ui/base/cursor/cursor_loader_win.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698