Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5998)

Unified Diff: chrome/test/base/ui_test_utils.cc

Issue 10825085: Move RunAllPendingInMessageLoop from ui_test_utils.h to test_utils.h, so that it can be reused by c… (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/test/base/ui_test_utils.h ('k') | chrome/test/base/view_event_test_base.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/base/ui_test_utils.cc
===================================================================
--- chrome/test/base/ui_test_utils.cc (revision 149002)
+++ chrome/test/base/ui_test_utils.cc (working copy)
@@ -144,40 +144,8 @@
DISALLOW_COPY_AND_ASSIGN(FindInPageNotificationObserver);
};
-void RunAllPendingMessageAndSendQuit(content::BrowserThread::ID thread_id,
- const base::Closure& quit_task) {
- MessageLoop::current()->PostTask(FROM_HERE,
- MessageLoop::QuitWhenIdleClosure());
- content::RunMessageLoop();
- content::BrowserThread::PostTask(thread_id, FROM_HERE, quit_task);
-}
-
} // namespace
-void RunAllPendingInMessageLoop() {
- MessageLoop::current()->PostTask(FROM_HERE,
- MessageLoop::QuitWhenIdleClosure());
- content::RunMessageLoop();
-}
-
-void RunAllPendingInMessageLoop(content::BrowserThread::ID thread_id) {
- if (content::BrowserThread::CurrentlyOn(thread_id)) {
- RunAllPendingInMessageLoop();
- return;
- }
- content::BrowserThread::ID current_thread_id;
- if (!content::BrowserThread::GetCurrentThreadIdentifier(&current_thread_id)) {
- NOTREACHED();
- return;
- }
-
- base::RunLoop run_loop;
- content::BrowserThread::PostTask(thread_id, FROM_HERE,
- base::Bind(&RunAllPendingMessageAndSendQuit, current_thread_id,
- run_loop.QuitClosure()));
- content::RunThisRunLoop(&run_loop);
-}
-
bool GetCurrentTabTitle(const Browser* browser, string16* title) {
WebContents* web_contents = chrome::GetActiveWebContents(browser);
if (!web_contents)
« no previous file with comments | « chrome/test/base/ui_test_utils.h ('k') | chrome/test/base/view_event_test_base.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698