| 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(); | |
| 282 ui_loop->Run(); | 281 ui_loop->Run(); |
| 283 #elif defined(TOOLKIT_VIEWS) | 282 #elif defined(TOOLKIT_VIEWS) |
| 284 views::AcceleratorHandler handler; | 283 views::AcceleratorHandler handler; |
| 285 ui_loop->RunWithDispatcher(&handler); | 284 ui_loop->RunWithDispatcher(&handler); |
| 286 #elif defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_ANDROID) | 285 #elif defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_ANDROID) |
| 287 ui_loop->RunWithDispatcher(NULL); | 286 ui_loop->RunWithDispatcher(NULL); |
| 288 #else | 287 #else |
| 289 ui_loop->Run(); | 288 ui_loop->Run(); |
| 290 #endif | 289 #endif |
| 291 } else { | 290 } else { |
| (...skipping 839 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1131 return taker.TakeRenderWidgetSnapshot(rwh, page_size, page_size, bitmap); | 1130 return taker.TakeRenderWidgetSnapshot(rwh, page_size, page_size, bitmap); |
| 1132 } | 1131 } |
| 1133 | 1132 |
| 1134 bool TakeEntirePageSnapshot(RenderViewHost* rvh, SkBitmap* bitmap) { | 1133 bool TakeEntirePageSnapshot(RenderViewHost* rvh, SkBitmap* bitmap) { |
| 1135 DCHECK(bitmap); | 1134 DCHECK(bitmap); |
| 1136 SnapshotTaker taker; | 1135 SnapshotTaker taker; |
| 1137 return taker.TakeEntirePageSnapshot(rvh, bitmap); | 1136 return taker.TakeEntirePageSnapshot(rvh, bitmap); |
| 1138 } | 1137 } |
| 1139 | 1138 |
| 1140 } // namespace ui_test_utils | 1139 } // namespace ui_test_utils |
| OLD | NEW |