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

Unified Diff: chrome/browser/sync_file_system/sync_file_system_test_util.h

Issue 80973002: SyncFS: Clean up callbacks in v1 tests (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 1 month 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/sync_file_system/drive_backend_v1/drive_file_sync_service_sync_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/sync_file_system/sync_file_system_test_util.h
diff --git a/chrome/browser/sync_file_system/sync_file_system_test_util.h b/chrome/browser/sync_file_system/sync_file_system_test_util.h
index 572cc325390fc79e317cc53525024495a0b43dee..85d8273882facc93ca99de1c13a75e2013f3038c 100644
--- a/chrome/browser/sync_file_system/sync_file_system_test_util.h
+++ b/chrome/browser/sync_file_system/sync_file_system_test_util.h
@@ -27,6 +27,18 @@ void ReceiveResult2(bool* done,
*arg2_out = base::internal::CallbackForward(arg2);
}
+template <typename Arg1, typename Arg2>
+void ReceiveResultConst2(bool* done,
tzik 2013/11/22 04:48:16 This looks not clean to me... And to make this cle
+ Arg1* arg1_out,
+ Arg2* arg2_out,
+ Arg1 arg1,
+ const Arg2& arg2) {
+ EXPECT_FALSE(*done);
+ *done = true;
+ *arg1_out = base::internal::CallbackForward(arg1);
+ *arg2_out = base::internal::CallbackForward(arg2);
+}
+
template <typename R>
void AssignAndQuit(base::RunLoop* run_loop, R* result_out, R result);
@@ -44,6 +56,14 @@ base::Callback<void(Arg1, Arg2)> CreateResultReceiver(Arg1* arg1_out,
arg1_out, arg2_out);
}
kinuko 2013/11/22 04:52:41 Is it reasonable to specify we always use const &
+template <typename Arg1, typename Arg2>
+base::Callback<void(Arg1, const Arg2&)> CreateResultReceiverConst(
+ Arg1* arg1_out, Arg2* arg2_out) {
+ return base::Bind(&ReceiveResultConst2<Arg1, Arg2>,
+ base::Owned(new bool(false)),
+ arg1_out, arg2_out);
+}
+
} // namespace sync_file_system
#endif // CHROME_BROWSER_SYNC_FILE_SYSTEM_SYNC_FILE_SYSTEM_TEST_UTIL_H_
« no previous file with comments | « chrome/browser/sync_file_system/drive_backend_v1/drive_file_sync_service_sync_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698