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

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

Issue 11824023: Add unittest for google_apis::GetAboutOperation. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Get rid of EXPECT_X creation. Move the verification method to test_util to share it with gdata_wapi… Created 7 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
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 9d2ed93272ec2fe5c858c067c646ede9f05defb1..1ffbcdb928f97eb1c2ad9c2f55a768e532f61dff 100644
--- a/chrome/browser/google_apis/test_util.h
+++ b/chrome/browser/google_apis/test_util.h
@@ -20,6 +20,7 @@ class Value;
namespace google_apis {
class AccountMetadataFeed;
+class AuthenticatedOperationInterface;
class ResourceEntry;
class ResourceList;
@@ -60,6 +61,12 @@ void CopyResultsFromGetDataCallback(GDataErrorCode* error_out,
GDataErrorCode error_in,
scoped_ptr<base::Value> value_in);
+// Copies the results from GetDataCallback and quit the message loop.
+void CopyResultsFromGetDataCallbackAndQuit(GDataErrorCode* error_out,
+ scoped_ptr<base::Value>* value_out,
+ GDataErrorCode error_in,
+ scoped_ptr<base::Value> value_in);
+
// Copies the results from GetResourceEntryCallback.
void CopyResultsFromGetResourceEntryCallback(
GDataErrorCode* error_out,
@@ -85,6 +92,18 @@ void CopyResultsFromGetAccountMetadataCallback(
scoped_ptr<test_server::HttpResponse> CreateHttpResponseFromFile(
const FilePath& file_path);
+// Does nothing for ReAuthenticateCallback(). This function should be used
+// if it is not expected to reach this method as there won't be any
+// authentication failures in the test.
+void DoNothingForReAuthenticateCallback(
+ AuthenticatedOperationInterface* operation);
+
+// Returns true if |json_data| is not NULL and equals to the content in
+// |expected_json_file_path|. The failure reason will be logged into LOG(ERROR)
+// if necessary.
+bool VerifyJsonData(const FilePath& expected_json_file_path,
+ const base::Value* json_data);
+
} // namespace test_util
} // namespace google_apis
« no previous file with comments | « chrome/browser/google_apis/gdata_wapi_operations_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