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

Unified Diff: chrome/browser/sync_file_system/drive_file_sync_service_unittest.cc

Issue 12385081: Replace GetAccountMetadata by GetAboutResource in sync_file_system. (Closed) Base URL: http://git.chromium.org/chromium/src.git@b174237_gdata_wapi_get_about_resource_impl4
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
« no previous file with comments | « chrome/browser/sync_file_system/drive_file_sync_client_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/drive_file_sync_service_unittest.cc
diff --git a/chrome/browser/sync_file_system/drive_file_sync_service_unittest.cc b/chrome/browser/sync_file_system/drive_file_sync_service_unittest.cc
index c4ba616cd502a09044a23efcfa3cb56b5074b1c7..fb118420600dbcf371484b60b4c800e2797bc7c5 100644
--- a/chrome/browser/sync_file_system/drive_file_sync_service_unittest.cc
+++ b/chrome/browser/sync_file_system/drive_file_sync_service_unittest.cc
@@ -11,6 +11,7 @@
#include "base/message_loop_proxy.h"
#include "chrome/browser/extensions/test_extension_service.h"
#include "chrome/browser/extensions/test_extension_system.h"
+#include "chrome/browser/google_apis/drive_api_parser.h"
#include "chrome/browser/google_apis/drive_uploader.h"
#include "chrome/browser/google_apis/gdata_errorcode.h"
#include "chrome/browser/google_apis/gdata_wapi_parser.h"
@@ -108,11 +109,11 @@ ACTION(InvokeCompletionCallback) {
}
// Invokes |arg0| as a GetDataCallback.
-ACTION_P2(InvokeGetAccountMetadataCallback0, error, result) {
- scoped_ptr<google_apis::AccountMetadata> account_metadata(result.Pass());
+ACTION_P2(InvokeGetAboutResourceCallback0, error, result) {
+ scoped_ptr<google_apis::AboutResource> about_resource(result.Pass());
base::MessageLoopProxy::current()->PostTask(
FROM_HERE,
- base::Bind(arg0, error, base::Passed(&account_metadata)));
+ base::Bind(arg0, error, base::Passed(&about_resource)));
}
// Invokes |arg1| as a GetResourceEntryCallback.
@@ -468,16 +469,17 @@ class DriveFileSyncServiceTest : public testing::Test {
std::string());
}
- void SetUpDriveServiceExpectCallsForGetAccountMetadata() {
+ void SetUpDriveServiceExpectCallsForGetAboutResource() {
scoped_ptr<Value> account_metadata_value(LoadJSONFile(
"gdata/account_metadata.json"));
- scoped_ptr<google_apis::AccountMetadata> account_metadata(
- google_apis::AccountMetadata::CreateFrom(*account_metadata_value));
- EXPECT_CALL(*mock_drive_service(),
- GetAccountMetadata(_))
- .WillOnce(InvokeGetAccountMetadataCallback0(
+ scoped_ptr<google_apis::AboutResource> about_resource(
+ google_apis::AboutResource::CreateFromAccountMetadata(
+ *google_apis::AccountMetadata::CreateFrom(*account_metadata_value),
+ "folder:root"));
+ EXPECT_CALL(*mock_drive_service(), GetAboutResource(_))
+ .WillOnce(InvokeGetAboutResourceCallback0(
google_apis::HTTP_SUCCESS,
- base::Passed(&account_metadata)))
+ base::Passed(&about_resource)))
.RetiresOnSaturation();
}
@@ -585,7 +587,7 @@ TEST_F(DriveFileSyncServiceTest, BatchSyncOnInitialization) {
InSequence sequence;
- SetUpDriveServiceExpectCallsForGetAccountMetadata();
+ SetUpDriveServiceExpectCallsForGetAboutResource();
SetUpDriveServiceExpectCallsForGetResourceList(
"sync_file_system/listing_files_in_directory.json",
std::string(),
@@ -636,9 +638,9 @@ TEST_F(DriveFileSyncServiceTest, RegisterNewOrigin) {
kSyncRootResourceId,
DriveFileSyncClient::OriginToDirectoryTitle(kOrigin));
- // Once the directory is created GetAccountMetadata should be called to get
+ // Once the directory is created GetAboutResource should be called to get
// the largest changestamp for the origin as a prepariation of the batch sync.
- SetUpDriveServiceExpectCallsForGetAccountMetadata();
+ SetUpDriveServiceExpectCallsForGetAboutResource();
SetUpDriveServiceExpectCallsForGetResourceList(
"sync_file_system/listing_files_in_empty_directory.json",
@@ -678,7 +680,7 @@ TEST_F(DriveFileSyncServiceTest, RegisterExistingOrigin) {
FormatTitleQuery(DriveFileSyncClient::OriginToDirectoryTitle(kOrigin)),
kSyncRootResourceId);
- SetUpDriveServiceExpectCallsForGetAccountMetadata();
+ SetUpDriveServiceExpectCallsForGetAboutResource();
// DriveFileSyncService should fetch the list of the directory content
// to start the batch sync.
@@ -724,7 +726,7 @@ TEST_F(DriveFileSyncServiceTest, UnregisterOrigin) {
InSequence sequence;
- SetUpDriveServiceExpectCallsForGetAccountMetadata();
+ SetUpDriveServiceExpectCallsForGetAboutResource();
SetUpDriveServiceExpectCallsForGetResourceList(
"sync_file_system/listing_files_in_directory.json",
std::string(),
« no previous file with comments | « chrome/browser/sync_file_system/drive_file_sync_client_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698