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

Unified Diff: chrome/browser/google_apis/test_util.h

Issue 17315016: Use base::RunLoop instead of directly using MessageLoop in Drive related code. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove unneeded #include Created 7 years, 6 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/browser/google_apis/gdata_wapi_requests_unittest.cc ('k') | chrome/browser/google_apis/test_util.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/google_apis/test_util.h
diff --git a/chrome/browser/google_apis/test_util.h b/chrome/browser/google_apis/test_util.h
index 0e770bdbea2d02b23c38aacea8e95cf3f769e9e6..173674d80ea8f38ec82839f5cc3a79bd71e11cbf 100644
--- a/chrome/browser/google_apis/test_util.h
+++ b/chrome/browser/google_apis/test_util.h
@@ -16,11 +16,13 @@
#include "base/template_util.h"
#include "chrome/browser/google_apis/base_requests.h"
#include "chrome/browser/google_apis/gdata_errorcode.h"
+#include "chrome/browser/google_apis/task_util.h"
class GURL;
namespace base {
class FilePath;
+class RunLoop;
class Value;
}
@@ -33,15 +35,6 @@ struct HttpRequest;
}
namespace google_apis {
-
-class AboutResource;
-class AccountMetadata;
-class AppList;
-class AuthenticatedRequestInterface;
-class ResourceEntry;
-class ResourceList;
-struct UploadRangeResponse;
-
namespace test_util {
// Runs a task posted to the blocking pool, including subsequent tasks posted
@@ -53,8 +46,15 @@ namespace test_util {
// repeatedly.
void RunBlockingPoolTask();
-// Runs the closure, and then quits the current MessageLoop.
-void RunAndQuit(const base::Closure& closure);
+// Runs the closure, and then quits the |run_loop|.
+void RunAndQuit(base::RunLoop* run_loop, const base::Closure& closure);
+
+// Returns callback which runs the given |callback| and then quits |run_loop|.
+template<typename CallbackType>
+CallbackType CreateQuitCallback(base::RunLoop* run_loop,
+ const CallbackType& callback) {
+ return CreateComposedCallback(base::Bind(&RunAndQuit, run_loop), callback);
+}
// Removes |prefix| from |input| and stores the result in |output|. Returns
// true if the prefix is removed.
« no previous file with comments | « chrome/browser/google_apis/gdata_wapi_requests_unittest.cc ('k') | chrome/browser/google_apis/test_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698