Upstream version 7.36.149.0
[platform/framework/web/crosswalk.git] / src / chrome / browser / sync_file_system / drive_backend_v1 / api_util_unittest.cc
index 23509c4..8a7e3ad 100644 (file)
@@ -71,9 +71,6 @@ class APIUtilTest : public testing::Test {
         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 {
@@ -118,11 +115,6 @@ class APIUtilTest : public testing::Test {
                   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,
@@ -241,7 +233,6 @@ void DidDeleteFile(GDataErrorCode* error_out,
 }
 
 void APIUtilTest::TestGetSyncRoot() {
-  LoadAccountMetadata();
   const std::string sync_root_id = SetUpSyncRootDirectory();
 
   Output output;
@@ -254,8 +245,6 @@ void APIUtilTest::TestGetSyncRoot() {
 }
 
 void APIUtilTest::TestCreateSyncRoot() {
-  LoadAccountMetadata();
-
   Output output;
   api_util()->GetDriveDirectoryForSyncRoot(
       base::Bind(&DidGetResourceID, &output));
@@ -271,7 +260,6 @@ void APIUtilTest::TestCreateSyncRoot() {
 }
 
 void APIUtilTest::TestCreateSyncRoot_Conflict() {
-  LoadAccountMetadata();
   fake_drive_service()->set_make_directory_conflict(true);
 
   Output output;
@@ -345,15 +333,14 @@ void APIUtilTest::TestCreateOriginDirectory_Conflict() {
 }
 
 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() {
@@ -395,7 +382,8 @@ 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);
 
@@ -423,7 +411,7 @@ void APIUtilTest::TestListChanges() {
   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();