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/ui_test_utils.h" | 5 #include "chrome/test/ui_test_utils.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/callback.h" | 9 #include "base/callback.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
282 | 282 |
283 } // namespace | 283 } // namespace |
284 | 284 |
285 void RunMessageLoop() { | 285 void RunMessageLoop() { |
286 MessageLoopForUI* loop = MessageLoopForUI::current(); | 286 MessageLoopForUI* loop = MessageLoopForUI::current(); |
287 bool did_allow_task_nesting = loop->NestableTasksAllowed(); | 287 bool did_allow_task_nesting = loop->NestableTasksAllowed(); |
288 loop->SetNestableTasksAllowed(true); | 288 loop->SetNestableTasksAllowed(true); |
289 #if defined(TOOLKIT_VIEWS) | 289 #if defined(TOOLKIT_VIEWS) |
290 views::AcceleratorHandler handler; | 290 views::AcceleratorHandler handler; |
291 loop->Run(&handler); | 291 loop->Run(&handler); |
292 #elif defined(OS_LINUX) | 292 #elif defined(OS_POSIX) && !defined(OS_MACOSX) |
293 loop->Run(NULL); | 293 loop->Run(NULL); |
294 #else | 294 #else |
295 loop->Run(); | 295 loop->Run(); |
296 #endif | 296 #endif |
297 loop->SetNestableTasksAllowed(did_allow_task_nesting); | 297 loop->SetNestableTasksAllowed(did_allow_task_nesting); |
298 } | 298 } |
299 | 299 |
300 void RunAllPendingInMessageLoop() { | 300 void RunAllPendingInMessageLoop() { |
301 MessageLoop::current()->PostTask(FROM_HERE, new MessageLoop::QuitTask()); | 301 MessageLoop::current()->PostTask(FROM_HERE, new MessageLoop::QuitTask()); |
302 ui_test_utils::RunMessageLoop(); | 302 ui_test_utils::RunMessageLoop(); |
(...skipping 691 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
994 return taker.TakeRenderWidgetSnapshot(rwh, page_size, page_size, bitmap); | 994 return taker.TakeRenderWidgetSnapshot(rwh, page_size, page_size, bitmap); |
995 } | 995 } |
996 | 996 |
997 bool TakeEntirePageSnapshot(RenderViewHost* rvh, SkBitmap* bitmap) { | 997 bool TakeEntirePageSnapshot(RenderViewHost* rvh, SkBitmap* bitmap) { |
998 DCHECK(bitmap); | 998 DCHECK(bitmap); |
999 SnapshotTaker taker; | 999 SnapshotTaker taker; |
1000 return taker.TakeEntirePageSnapshot(rvh, bitmap); | 1000 return taker.TakeEntirePageSnapshot(rvh, bitmap); |
1001 } | 1001 } |
1002 | 1002 |
1003 } // namespace ui_test_utils | 1003 } // namespace ui_test_utils |
OLD | NEW |