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

Unified Diff: chrome/browser/google_apis/gdata_wapi_operations_unittest.cc

Issue 12388017: Move the responsibility to convert from JSON to AccountMetadata into gdata_wapi_operations. (Closed) Base URL: http://git.chromium.org/chromium/src.git@b148632_gdata_wapi_get_about_resource_impl
Patch Set: Created 7 years, 10 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/gdata_wapi_operations_unittest.cc
diff --git a/chrome/browser/google_apis/gdata_wapi_operations_unittest.cc b/chrome/browser/google_apis/gdata_wapi_operations_unittest.cc
index 13c437a8638efba291f90d7ef2306d487c383c9e..e58f2abc687a4f40c052ad6c5ab6c13cc8222e7c 100644
--- a/chrome/browser/google_apis/gdata_wapi_operations_unittest.cc
+++ b/chrome/browser/google_apis/gdata_wapi_operations_unittest.cc
@@ -488,15 +488,14 @@ TEST_F(GDataWapiOperationsTest, GetResourceEntryOperation_InvalidResourceId) {
TEST_F(GDataWapiOperationsTest, GetAccountMetadataOperation) {
GDataErrorCode result_code = GDATA_OTHER_ERROR;
- scoped_ptr<base::Value> result_data;
+ scoped_ptr<AccountMetadataFeed> result_data;
GetAccountMetadataOperation* operation = new GetAccountMetadataOperation(
&operation_registry_,
request_context_getter_.get(),
*url_generator_,
- base::Bind(&test_util::CopyResultsFromGetDataCallbackAndQuit,
- &result_code,
- &result_data));
+ base::Bind(&test_util::CopyResultsFromGetAccountMetadataCallbackAndQuit,
+ &result_code, &result_data));
operation->Start(kTestGDataAuthToken, kTestUserAgent,
base::Bind(&test_util::DoNothingForReAuthenticateCallback));
MessageLoop::current()->Run();
@@ -505,9 +504,22 @@ TEST_F(GDataWapiOperationsTest, GetAccountMetadataOperation) {
EXPECT_EQ(test_server::METHOD_GET, http_request_.method);
EXPECT_EQ("/feeds/metadata/default?v=3&alt=json&include-installed-apps=true",
http_request_.relative_url);
- EXPECT_TRUE(test_util::VerifyJsonData(
- test_util::GetTestFilePath("gdata/account_metadata.json"),
- result_data.get()));
+
+ scoped_ptr<AccountMetadataFeed> expected(
+ AccountMetadataFeed::CreateFrom(
+ *test_util::LoadJSONFile("gdata/account_metadata.json")));
+
+ ASSERT_TRUE(result_data.get());
+ EXPECT_EQ(expected->largest_changestamp(),
+ result_data->largest_changestamp());
+ EXPECT_EQ(expected->quota_bytes_total(),
+ result_data->quota_bytes_total());
+ EXPECT_EQ(expected->quota_bytes_used(),
+ result_data->quota_bytes_used());
+
+ // Sanity check for installed apps.
+ EXPECT_EQ(expected->installed_apps().size(),
+ result_data->installed_apps().size());
}
TEST_F(GDataWapiOperationsTest, DeleteResourceOperation) {
« no previous file with comments | « chrome/browser/google_apis/gdata_wapi_operations.cc ('k') | chrome/browser/google_apis/gdata_wapi_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698