OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
225 } | 225 } |
226 | 226 |
227 } // namespace | 227 } // namespace |
228 | 228 |
229 void RunMessageLoop() { | 229 void RunMessageLoop() { |
230 MessageLoopForUI* loop = MessageLoopForUI::current(); | 230 MessageLoopForUI* loop = MessageLoopForUI::current(); |
231 bool did_allow_task_nesting = loop->NestableTasksAllowed(); | 231 bool did_allow_task_nesting = loop->NestableTasksAllowed(); |
232 loop->SetNestableTasksAllowed(true); | 232 loop->SetNestableTasksAllowed(true); |
233 #if defined(TOOLKIT_VIEWS) | 233 #if defined(TOOLKIT_VIEWS) |
234 views::AcceleratorHandler handler; | 234 views::AcceleratorHandler handler; |
235 loop->Run(&handler); | 235 loop->RunWithDispatcher(&handler); |
236 #elif defined(OS_POSIX) && !defined(OS_MACOSX) | 236 #elif defined(OS_POSIX) && !defined(OS_MACOSX) |
237 loop->Run(NULL); | 237 loop->RunWithDispatcher(NULL); |
238 #else | 238 #else |
239 loop->Run(); | 239 loop->Run(); |
240 #endif | 240 #endif |
241 loop->SetNestableTasksAllowed(did_allow_task_nesting); | 241 loop->SetNestableTasksAllowed(did_allow_task_nesting); |
242 } | 242 } |
243 | 243 |
244 void RunAllPendingInMessageLoop() { | 244 void RunAllPendingInMessageLoop() { |
245 MessageLoop::current()->PostTask(FROM_HERE, new MessageLoop::QuitTask()); | 245 MessageLoop::current()->PostTask(FROM_HERE, new MessageLoop::QuitTask()); |
246 ui_test_utils::RunMessageLoop(); | 246 ui_test_utils::RunMessageLoop(); |
247 } | 247 } |
(...skipping 740 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
988 return taker.TakeRenderWidgetSnapshot(rwh, page_size, page_size, bitmap); | 988 return taker.TakeRenderWidgetSnapshot(rwh, page_size, page_size, bitmap); |
989 } | 989 } |
990 | 990 |
991 bool TakeEntirePageSnapshot(RenderViewHost* rvh, SkBitmap* bitmap) { | 991 bool TakeEntirePageSnapshot(RenderViewHost* rvh, SkBitmap* bitmap) { |
992 DCHECK(bitmap); | 992 DCHECK(bitmap); |
993 SnapshotTaker taker; | 993 SnapshotTaker taker; |
994 return taker.TakeEntirePageSnapshot(rvh, bitmap); | 994 return taker.TakeEntirePageSnapshot(rvh, bitmap); |
995 } | 995 } |
996 | 996 |
997 } // namespace ui_test_utils | 997 } // namespace ui_test_utils |
OLD | NEW |