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

Unified Diff: chrome/browser/sync_file_system/drive_backend/callback_helper_unittest.cc

Issue 259503004: [SyncFS] Refine callback helpers (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: use pump.py Created 6 years, 8 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
Index: chrome/browser/sync_file_system/drive_backend/callback_helper_unittest.cc
diff --git a/chrome/browser/sync_file_system/drive_backend/callback_helper_unittest.cc b/chrome/browser/sync_file_system/drive_backend/callback_helper_unittest.cc
index 238d24f2f89bbf64f72d02cabb3d093f6c54b756..00cbb8d7c807bf0ca8ea5b5d71bc4917d9b0bdd3 100644
--- a/chrome/browser/sync_file_system/drive_backend/callback_helper_unittest.cc
+++ b/chrome/browser/sync_file_system/drive_backend/callback_helper_unittest.cc
@@ -27,17 +27,29 @@ void CallbackWithPassed(bool* called, scoped_ptr<int>) {
} // namespace
-TEST(DriveBackendCallbackHelperTest, CreateRelayedCallbackTest) {
+TEST(DriveBackendCallbackHelperTest, RelayCallbackTest) {
base::MessageLoop message_loop;
bool called = false;
- CreateRelayedCallback(base::Bind(&SimpleCallback, &called)).Run(0);
+ RelayCallbackToTaskRunner(
peria 2014/04/24 08:15:35 as we chatted f2f, remove this test #34-42 and put
tzik 2014/04/24 09:31:59 Done.
+ base::MessageLoopProxy::current(),
+ FROM_HERE,
+ base::Bind(&SimpleCallback, &called, 0)).Run();
EXPECT_FALSE(called);
base::RunLoop().RunUntilIdle();
EXPECT_TRUE(called);
called = false;
- CreateRelayedCallback(
+ RelayCallbackToCurrentThread(
+ FROM_HERE,
+ base::Bind(&SimpleCallback, &called)).Run(0);
+ EXPECT_FALSE(called);
+ base::RunLoop().RunUntilIdle();
+ EXPECT_TRUE(called);
+
+ called = false;
+ RelayCallbackToCurrentThread(
+ FROM_HERE,
base::Bind(&CallbackWithPassed, &called))
.Run(scoped_ptr<int>(new int));
EXPECT_FALSE(called);

Powered by Google App Engine
This is Rietveld 408576698