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

Unified Diff: net/cookies/cookie_store_test_callbacks.h

Issue 1634803004: Convert CookieMonster tests to use base::RunLoop (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Comments Created 4 years, 11 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 | « net/cookies/cookie_monster_unittest.cc ('k') | net/cookies/cookie_store_test_callbacks.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/cookies/cookie_store_test_callbacks.h
diff --git a/net/cookies/cookie_store_test_callbacks.h b/net/cookies/cookie_store_test_callbacks.h
index 3b86873fa437423c0067712c55ad02deeb893ac8..207eb02f28bf9ea59a45145d05f21ce8a117b3ca 100644
--- a/net/cookies/cookie_store_test_callbacks.h
+++ b/net/cookies/cookie_store_test_callbacks.h
@@ -8,6 +8,7 @@
#include <string>
#include <vector>
+#include "base/run_loop.h"
#include "net/cookies/canonical_cookie.h"
#include "net/cookies/cookie_store.h"
@@ -23,28 +24,27 @@ namespace net {
// quit to the thread in which it was constructed.
class CookieCallback {
public:
- // Indicates whether the callback has been called.
- bool did_run() { return did_run_; }
+ // Waits until the callback is invoked.
+ void WaitUntilDone();
protected:
- // Constructs a callback that expects to be called in the given thread and
- // will, upon execution, send a QUIT to the constructing thread.
+ // Constructs a callback that expects to be called in the given thread.
explicit CookieCallback(base::Thread* run_in_thread);
// Constructs a callback that expects to be called in current thread and will
// send a QUIT to the constructing thread.
CookieCallback();
+ ~CookieCallback();
+
// Tests whether the current thread was the caller's thread.
// Sends a QUIT to the constructing thread.
void CallbackEpilogue();
private:
- bool did_run_;
base::Thread* run_in_thread_;
base::MessageLoop* run_in_loop_;
- base::MessageLoop* parent_loop_;
- base::MessageLoop* loop_to_quit_;
+ base::RunLoop loop_to_quit_;
};
// Callback implementations for the asynchronous CookieStore methods.
« no previous file with comments | « net/cookies/cookie_monster_unittest.cc ('k') | net/cookies/cookie_store_test_callbacks.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698