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

Unified Diff: net/cookies/cookie_store_test_callbacks.cc

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_store_test_callbacks.h ('k') | net/cookies/cookie_store_unittest.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/cookies/cookie_store_test_callbacks.cc
diff --git a/net/cookies/cookie_store_test_callbacks.cc b/net/cookies/cookie_store_test_callbacks.cc
index 2a8a659e79f3f601f5ac2c610467628051b5dc46..9e36e70620185ae8e84ef8695c8abc870f2a21dd 100644
--- a/net/cookies/cookie_store_test_callbacks.cc
+++ b/net/cookies/cookie_store_test_callbacks.cc
@@ -13,18 +13,12 @@
namespace net {
CookieCallback::CookieCallback(base::Thread* run_in_thread)
- : did_run_(false),
- run_in_thread_(run_in_thread),
- run_in_loop_(NULL),
- parent_loop_(base::MessageLoop::current()),
- loop_to_quit_(base::MessageLoop::current()) {}
+ : run_in_thread_(run_in_thread), run_in_loop_(NULL) {}
CookieCallback::CookieCallback()
- : did_run_(false),
- run_in_thread_(NULL),
- run_in_loop_(base::MessageLoop::current()),
- parent_loop_(NULL),
- loop_to_quit_(base::MessageLoop::current()) {}
+ : run_in_thread_(NULL), run_in_loop_(base::MessageLoop::current()) {}
+
+CookieCallback::~CookieCallback() {}
void CookieCallback::CallbackEpilogue() {
base::MessageLoop* expected_loop = NULL;
@@ -36,10 +30,12 @@ void CookieCallback::CallbackEpilogue() {
}
ASSERT_TRUE(expected_loop != NULL);
- did_run_ = true;
EXPECT_EQ(expected_loop, base::MessageLoop::current());
- loop_to_quit_->task_runner()->PostTask(
- FROM_HERE, base::MessageLoop::QuitWhenIdleClosure());
+ loop_to_quit_.Quit();
+}
+
+void CookieCallback::WaitUntilDone() {
+ loop_to_quit_.Run();
}
StringResultCookieCallback::StringResultCookieCallback() {}
« no previous file with comments | « net/cookies/cookie_store_test_callbacks.h ('k') | net/cookies/cookie_store_unittest.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698