temp_dir_.path(),
scoped_ptr<DriveServiceInterface>(fake_drive_service_),
scoped_ptr<DriveUploaderInterface>(fake_drive_uploader_));
-
- fake_drive_service_->LoadResourceListForWapi(
- "sync_file_system/initialize.json");
}
virtual void TearDown() OVERRIDE {
entry));
}
- void LoadAccountMetadata() {
- fake_drive_service_->LoadAccountMetadataForWapi(
- "sync_file_system/account_metadata.json");
- }
-
void VerifyTitleUniqueness(const std::string& parent_resource_id,
const std::string& title,
const std::string& resource_id,
}
void APIUtilTest::TestGetSyncRoot() {
- LoadAccountMetadata();
const std::string sync_root_id = SetUpSyncRootDirectory();
Output output;
}
void APIUtilTest::TestCreateSyncRoot() {
- LoadAccountMetadata();
-
Output output;
api_util()->GetDriveDirectoryForSyncRoot(
base::Bind(&DidGetResourceID, &output));
}
void APIUtilTest::TestCreateSyncRoot_Conflict() {
- LoadAccountMetadata();
fake_drive_service()->set_make_directory_conflict(true);
Output output;
}
void APIUtilTest::TestGetLargestChangeStamp() {
- LoadAccountMetadata();
-
Output output;
api_util()->GetLargestChangeStamp(
base::Bind(&DidGetLargestChangeStamp, &output));
base::MessageLoop::current()->RunUntilIdle();
EXPECT_EQ(google_apis::HTTP_SUCCESS, output.error);
- EXPECT_EQ(654321, output.largest_changestamp);
+ EXPECT_EQ(fake_drive_service()->about_resource().largest_change_id(),
+ output.largest_changestamp);
}
void APIUtilTest::TestListFiles() {
}
void APIUtilTest::TestListChanges() {
- const int64 kStartChangestamp = 6;
+ const int64 old_changestamp =
+ fake_drive_service()->about_resource().largest_change_id();
const std::string sync_root_id = SetUpSyncRootDirectory();
const std::string origin_root_id = SetUpOriginRootDirectory(sync_root_id);
error = google_apis::GDATA_OTHER_ERROR;
document_feed.reset();
api_util()->ListChanges(
- kStartChangestamp,
+ old_changestamp + 6,
base::Bind(&DidGetResourceList, &error, &document_feed));
base::MessageLoop::current()->RunUntilIdle();