OLD | NEW |
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/ui_test_utils.h" | 5 #include "chrome/test/base/ui_test_utils.h" |
6 | 6 |
7 #if defined(OS_WIN) | 7 #if defined(OS_WIN) |
8 #include <windows.h> | 8 #include <windows.h> |
9 #endif | 9 #endif |
10 | 10 |
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
271 } // namespace | 271 } // namespace |
272 | 272 |
273 void RunMessageLoop() { | 273 void RunMessageLoop() { |
274 MessageLoop* loop = MessageLoop::current(); | 274 MessageLoop* loop = MessageLoop::current(); |
275 MessageLoopForUI* ui_loop = | 275 MessageLoopForUI* ui_loop = |
276 content::BrowserThread::CurrentlyOn(content::BrowserThread::UI) ? | 276 content::BrowserThread::CurrentlyOn(content::BrowserThread::UI) ? |
277 MessageLoopForUI::current() : NULL; | 277 MessageLoopForUI::current() : NULL; |
278 MessageLoop::ScopedNestableTaskAllower allow(loop); | 278 MessageLoop::ScopedNestableTaskAllower allow(loop); |
279 if (ui_loop) { | 279 if (ui_loop) { |
280 #if defined(USE_AURA) | 280 #if defined(USE_AURA) |
| 281 ash::Shell::GetRootWindow()->ShowRootWindow(); |
281 ui_loop->Run(); | 282 ui_loop->Run(); |
282 #elif defined(TOOLKIT_VIEWS) | 283 #elif defined(TOOLKIT_VIEWS) |
283 views::AcceleratorHandler handler; | 284 views::AcceleratorHandler handler; |
284 ui_loop->RunWithDispatcher(&handler); | 285 ui_loop->RunWithDispatcher(&handler); |
285 #elif defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_ANDROID) | 286 #elif defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_ANDROID) |
286 ui_loop->RunWithDispatcher(NULL); | 287 ui_loop->RunWithDispatcher(NULL); |
287 #else | 288 #else |
288 ui_loop->Run(); | 289 ui_loop->Run(); |
289 #endif | 290 #endif |
290 } else { | 291 } else { |
(...skipping 839 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1130 return taker.TakeRenderWidgetSnapshot(rwh, page_size, page_size, bitmap); | 1131 return taker.TakeRenderWidgetSnapshot(rwh, page_size, page_size, bitmap); |
1131 } | 1132 } |
1132 | 1133 |
1133 bool TakeEntirePageSnapshot(RenderViewHost* rvh, SkBitmap* bitmap) { | 1134 bool TakeEntirePageSnapshot(RenderViewHost* rvh, SkBitmap* bitmap) { |
1134 DCHECK(bitmap); | 1135 DCHECK(bitmap); |
1135 SnapshotTaker taker; | 1136 SnapshotTaker taker; |
1136 return taker.TakeEntirePageSnapshot(rvh, bitmap); | 1137 return taker.TakeEntirePageSnapshot(rvh, bitmap); |
1137 } | 1138 } |
1138 | 1139 |
1139 } // namespace ui_test_utils | 1140 } // namespace ui_test_utils |
OLD | NEW |