| 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 #ifndef CHROME_TEST_BASE_UI_TEST_UTILS_H_ | 5 #ifndef CHROME_TEST_BASE_UI_TEST_UTILS_H_ |
| 6 #define CHROME_TEST_BASE_UI_TEST_UTILS_H_ | 6 #define CHROME_TEST_BASE_UI_TEST_UTILS_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <queue> | 9 #include <queue> |
| 10 #include <set> | 10 #include <set> |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 BROWSER_TEST_MASK = BROWSER_TEST_WAIT_FOR_BROWSER | | 88 BROWSER_TEST_MASK = BROWSER_TEST_WAIT_FOR_BROWSER | |
| 89 BROWSER_TEST_WAIT_FOR_TAB | | 89 BROWSER_TEST_WAIT_FOR_TAB | |
| 90 BROWSER_TEST_WAIT_FOR_NAVIGATION | 90 BROWSER_TEST_WAIT_FOR_NAVIGATION |
| 91 }; | 91 }; |
| 92 | 92 |
| 93 // Turns on nestable tasks, runs the message loop, then resets nestable tasks | 93 // Turns on nestable tasks, runs the message loop, then resets nestable tasks |
| 94 // to what they were originally. Prefer this over MessageLoop::Run for in | 94 // to what they were originally. Prefer this over MessageLoop::Run for in |
| 95 // process browser tests that need to block until a condition is met. | 95 // process browser tests that need to block until a condition is met. |
| 96 void RunMessageLoop(); | 96 void RunMessageLoop(); |
| 97 | 97 |
| 98 // Variant of RunMessageLoop that takes RunLoop. | |
| 99 void RunThisRunLoop(base::RunLoop* run_loop); | |
| 100 | |
| 101 // Get task to quit the given RunLoop. It allows a few generations of pending | |
| 102 // tasks to run as opposed to run_loop->QuitClosure(). | |
| 103 base::Closure GetQuitTaskForRunLoop(base::RunLoop* run_loop); | |
| 104 | |
| 105 // Turns on nestable tasks, runs all pending tasks in the message loop, | 98 // Turns on nestable tasks, runs all pending tasks in the message loop, |
| 106 // then resets nestable tasks to what they were originally. Prefer this | 99 // then resets nestable tasks to what they were originally. Prefer this |
| 107 // over MessageLoop::RunAllPending for in process browser tests to run | 100 // over MessageLoop::RunAllPending for in process browser tests to run |
| 108 // all pending tasks. | 101 // all pending tasks. |
| 109 void RunAllPendingInMessageLoop(); | 102 void RunAllPendingInMessageLoop(); |
| 110 | 103 |
| 111 // Blocks the current thread until all the pending messages in the loop of the | 104 // Blocks the current thread until all the pending messages in the loop of the |
| 112 // thread |thread_id| have been processed. | 105 // thread |thread_id| have been processed. |
| 113 void RunAllPendingInMessageLoop(content::BrowserThread::ID thread_id); | 106 void RunAllPendingInMessageLoop(content::BrowserThread::ID thread_id); |
| 114 | 107 |
| (...skipping 580 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 695 // ui_controls_linux.cc and ui_controls_mac.cc | 688 // ui_controls_linux.cc and ui_controls_mac.cc |
| 696 void ClickTask(ui_controls::MouseButton button, | 689 void ClickTask(ui_controls::MouseButton button, |
| 697 int state, | 690 int state, |
| 698 const base::Closure& followup); | 691 const base::Closure& followup); |
| 699 | 692 |
| 700 } // namespace internal | 693 } // namespace internal |
| 701 | 694 |
| 702 } // namespace ui_test_utils | 695 } // namespace ui_test_utils |
| 703 | 696 |
| 704 #endif // CHROME_TEST_BASE_UI_TEST_UTILS_H_ | 697 #endif // CHROME_TEST_BASE_UI_TEST_UTILS_H_ |
| OLD | NEW |