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

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

Issue 14362022: Extract testing utility TestGetContentCallback. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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
« no previous file with comments | « chrome/browser/google_apis/fake_drive_service_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 e230894c90d3336f80cc2846a1e7e492e0990621..733b5676916640b0f54f8f559926e146c6d7ac06 100644
--- a/chrome/browser/google_apis/test_util.h
+++ b/chrome/browser/google_apis/test_util.h
@@ -12,7 +12,9 @@
#include "base/bind.h"
#include "base/callback.h"
#include "base/memory/scoped_ptr.h"
+#include "base/memory/scoped_vector.h"
#include "base/template_util.h"
+#include "chrome/browser/google_apis/base_operations.h"
#include "chrome/browser/google_apis/gdata_errorcode.h"
class GURL;
@@ -274,6 +276,27 @@ void AppendProgressCallbackResult(std::vector<ProgressInfo>* progress_values,
int64 progress,
int64 total);
+// Helpeer utility for recording the content via GetContentCallback.
+class TestGetContentCallback {
+ public:
+ TestGetContentCallback();
+ ~TestGetContentCallback();
+
+ const GetContentCallback& callback() const { return callback_; }
+ const ScopedVector<std::string>& data() const { return data_; }
+ ScopedVector<std::string>* mutable_data() { return &data_; }
+ std::string GetConcatenatedData() const;
+
+ private:
+ void OnGetContent(google_apis::GDataErrorCode error,
+ scoped_ptr<std::string> data);
+
+ const GetContentCallback callback_;
+ ScopedVector<std::string> data_;
+
+ DISALLOW_COPY_AND_ASSIGN(TestGetContentCallback);
+};
+
} // namespace test_util
} // namespace google_apis
« no previous file with comments | « chrome/browser/google_apis/fake_drive_service_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