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

Unified Diff: content/public/test/test_utils.h

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 | « content/browser/renderer_host/render_view_host_manager_browsertest.cc ('k') | content/test/test_utils.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/public/test/test_utils.h
===================================================================
--- content/public/test/test_utils.h (revision 149002)
+++ content/public/test/test_utils.h (working copy)
@@ -8,6 +8,7 @@
#include "base/callback_forward.h"
#include "base/memory/ref_counted.h"
#include "base/run_loop.h"
+#include "content/public/browser/browser_thread.h"
#include "content/public/browser/notification_details.h"
#include "content/public/browser/notification_observer.h"
#include "content/public/browser/notification_registrar.h"
@@ -26,6 +27,16 @@
// Variant of RunMessageLoop that takes RunLoop.
void RunThisRunLoop(base::RunLoop* run_loop);
+// Turns on nestable tasks, runs all pending tasks in the message loop,
+// then resets nestable tasks to what they were originally. Prefer this
+// over MessageLoop::RunAllPending for in process browser tests to run
+// all pending tasks.
+void RunAllPendingInMessageLoop();
+
+// Blocks the current thread until all the pending messages in the loop of the
+// thread |thread_id| have been processed.
+void RunAllPendingInMessageLoop(BrowserThread::ID thread_id);
+
// Get task to quit the given RunLoop. It allows a few generations of pending
// tasks to run as opposed to run_loop->QuitClosure().
base::Closure GetQuitTaskForRunLoop(base::RunLoop* run_loop);
« no previous file with comments | « content/browser/renderer_host/render_view_host_manager_browsertest.cc ('k') | content/test/test_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698