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 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 BROWSER_TEST_NONE = 0, // Don't wait for anything. | 74 BROWSER_TEST_NONE = 0, // Don't wait for anything. |
75 BROWSER_TEST_WAIT_FOR_BROWSER = 1 << 0, // Wait for a new browser. | 75 BROWSER_TEST_WAIT_FOR_BROWSER = 1 << 0, // Wait for a new browser. |
76 BROWSER_TEST_WAIT_FOR_TAB = 1 << 1, // Wait for a new tab. | 76 BROWSER_TEST_WAIT_FOR_TAB = 1 << 1, // Wait for a new tab. |
77 BROWSER_TEST_WAIT_FOR_NAVIGATION = 1 << 2, // Wait for navigation to finish. | 77 BROWSER_TEST_WAIT_FOR_NAVIGATION = 1 << 2, // Wait for navigation to finish. |
78 | 78 |
79 BROWSER_TEST_MASK = BROWSER_TEST_WAIT_FOR_BROWSER | | 79 BROWSER_TEST_MASK = BROWSER_TEST_WAIT_FOR_BROWSER | |
80 BROWSER_TEST_WAIT_FOR_TAB | | 80 BROWSER_TEST_WAIT_FOR_TAB | |
81 BROWSER_TEST_WAIT_FOR_NAVIGATION | 81 BROWSER_TEST_WAIT_FOR_NAVIGATION |
82 }; | 82 }; |
83 | 83 |
84 // Turns on nestable tasks, runs the message loop, then resets nestable tasks | |
85 // to what they were originally. Prefer this over MessageLoop::Run for in | |
86 // process browser tests that need to block until a condition is met. | |
87 void RunMessageLoop(); | |
88 | |
89 // Turns on nestable tasks, runs all pending tasks in the message loop, | 84 // Turns on nestable tasks, runs all pending tasks in the message loop, |
90 // then resets nestable tasks to what they were originally. Prefer this | 85 // then resets nestable tasks to what they were originally. Prefer this |
91 // over MessageLoop::RunAllPending for in process browser tests to run | 86 // over MessageLoop::RunAllPending for in process browser tests to run |
92 // all pending tasks. | 87 // all pending tasks. |
93 void RunAllPendingInMessageLoop(); | 88 void RunAllPendingInMessageLoop(); |
94 | 89 |
95 // Blocks the current thread until all the pending messages in the loop of the | 90 // Blocks the current thread until all the pending messages in the loop of the |
96 // thread |thread_id| have been processed. | 91 // thread |thread_id| have been processed. |
97 void RunAllPendingInMessageLoop(content::BrowserThread::ID thread_id); | 92 void RunAllPendingInMessageLoop(content::BrowserThread::ID thread_id); |
98 | 93 |
(...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
447 // ui_controls_linux.cc and ui_controls_mac.cc | 442 // ui_controls_linux.cc and ui_controls_mac.cc |
448 void ClickTask(ui_controls::MouseButton button, | 443 void ClickTask(ui_controls::MouseButton button, |
449 int state, | 444 int state, |
450 const base::Closure& followup); | 445 const base::Closure& followup); |
451 | 446 |
452 } // namespace internal | 447 } // namespace internal |
453 | 448 |
454 } // namespace ui_test_utils | 449 } // namespace ui_test_utils |
455 | 450 |
456 #endif // CHROME_TEST_BASE_UI_TEST_UTILS_H_ | 451 #endif // CHROME_TEST_BASE_UI_TEST_UTILS_H_ |
OLD | NEW |