diff options
Diffstat (limited to 'chrome/test')
-rw-r--r-- | chrome/test/in_process_browser_test.cc | 6 | ||||
-rw-r--r-- | chrome/test/in_process_browser_test.h | 3 |
2 files changed, 9 insertions, 0 deletions
diff --git a/chrome/test/in_process_browser_test.cc b/chrome/test/in_process_browser_test.cc index 3f4ce39..5afcfc2 100644 --- a/chrome/test/in_process_browser_test.cc +++ b/chrome/test/in_process_browser_test.cc @@ -315,3 +315,9 @@ void InProcessBrowserTest::SetInitialTimeoutInMS(int timeout_value) { DCHECK_GT(timeout_value, 0); initial_timeout_ = timeout_value; } + +void InProcessBrowserTest::RunAllPendingEvents() { + MessageLoop::current()->PostTask(FROM_HERE, new MessageLoop::QuitTask()); + ui_test_utils::RunMessageLoop(); +} + diff --git a/chrome/test/in_process_browser_test.h b/chrome/test/in_process_browser_test.h index 6e922d9..dfcf6d6 100644 --- a/chrome/test/in_process_browser_test.h +++ b/chrome/test/in_process_browser_test.h @@ -114,6 +114,9 @@ class InProcessBrowserTest : public testing::Test { void EnableDOMAutomation() { dom_automation_enabled_ = true; } void EnableSingleProcess() { single_process_ = true; } + // Run all pending events in the message loop. + void RunAllPendingEvents(); + private: // Invokes CreateBrowser to create a browser, then RunTestOnMainThread, and // destroys the browser. |