Upstream version 7.36.149.0
[platform/framework/web/crosswalk.git] / src / chrome / browser / sync_file_system / drive_backend / remote_to_local_syncer_unittest.cc
index 49690ae..8d39f00 100644 (file)
@@ -57,24 +57,24 @@ class RemoteToLocalSyncerTest : public testing::Test {
 
     scoped_ptr<drive::FakeDriveService>
         fake_drive_service(new drive::FakeDriveService);
-    ASSERT_TRUE(fake_drive_service->LoadAccountMetadataForWapi(
-        "sync_file_system/account_metadata.json"));
-    ASSERT_TRUE(fake_drive_service->LoadResourceListForWapi(
-        "gdata/empty_feed.json"));
 
     scoped_ptr<drive::DriveUploaderInterface>
         drive_uploader(new drive::DriveUploader(
             fake_drive_service.get(),
             base::MessageLoopProxy::current().get()));
-    fake_drive_helper_.reset(new FakeDriveServiceHelper(
-        fake_drive_service.get(), drive_uploader.get(),
-        kSyncRootFolderTitle));
-    fake_remote_change_processor_.reset(new FakeRemoteChangeProcessor);
+    fake_drive_helper_.reset(
+        new FakeDriveServiceHelper(fake_drive_service.get(),
+                                   drive_uploader.get(),
+                                   kSyncRootFolderTitle));
+    remote_change_processor_.reset(new FakeRemoteChangeProcessor);
 
     context_.reset(new SyncEngineContext(
         fake_drive_service.PassAs<drive::DriveServiceInterface>(),
-        drive_uploader.Pass(), base::MessageLoopProxy::current()));
-    context_->SetRemoteChangeProcessor(fake_remote_change_processor_.get());
+        drive_uploader.Pass(),
+        base::MessageLoopProxy::current(),
+        base::MessageLoopProxy::current(),
+        base::MessageLoopProxy::current()));
+    context_->SetRemoteChangeProcessor(remote_change_processor_.get());
 
     RegisterSyncableFileSystem();
 
@@ -86,10 +86,7 @@ class RemoteToLocalSyncerTest : public testing::Test {
 
   virtual void TearDown() OVERRIDE {
     sync_task_manager_.reset();
-
     RevokeSyncableFileSystem();
-
-    fake_remote_change_processor_.reset();
     fake_drive_helper_.reset();
     context_.reset();
     base::RunLoop().RunUntilIdle();
@@ -100,7 +97,6 @@ class RemoteToLocalSyncerTest : public testing::Test {
         new SyncEngineInitializer(
             context_.get(),
             base::MessageLoopProxy::current(),
-            context_->GetDriveService(),
             database_dir_.path(),
             in_memory_env_.get());
     SyncStatusCode status = SYNC_STATUS_UNKNOWN;
@@ -171,13 +167,13 @@ class RemoteToLocalSyncerTest : public testing::Test {
   }
 
   void CreateLocalFolder(const fileapi::FileSystemURL& url) {
-    fake_remote_change_processor_->UpdateLocalFileMetadata(
+    remote_change_processor_->UpdateLocalFileMetadata(
         url, FileChange(FileChange::FILE_CHANGE_ADD_OR_UPDATE,
                         SYNC_FILE_TYPE_DIRECTORY));
   }
 
   void CreateLocalFile(const fileapi::FileSystemURL& url) {
-    fake_remote_change_processor_->UpdateLocalFileMetadata(
+    remote_change_processor_->UpdateLocalFileMetadata(
         url, FileChange(FileChange::FILE_CHANGE_ADD_OR_UPDATE,
                         SYNC_FILE_TYPE_FILE));
   }
@@ -186,7 +182,7 @@ class RemoteToLocalSyncerTest : public testing::Test {
     SyncStatusCode status = SYNC_STATUS_UNKNOWN;
     scoped_ptr<RemoteToLocalSyncer>
         syncer(new RemoteToLocalSyncer(context_.get()));
-    syncer->RunSequential(CreateResultReceiver(&status));
+    syncer->RunExclusive(CreateResultReceiver(&status));
     base::RunLoop().RunUntilIdle();
     return status;
   }
@@ -215,7 +211,7 @@ class RemoteToLocalSyncerTest : public testing::Test {
   }
 
   void VerifyConsistency() {
-    fake_remote_change_processor_->VerifyConsistency(expected_changes_);
+    remote_change_processor_->VerifyConsistency(expected_changes_);
   }
 
  private:
@@ -225,7 +221,7 @@ class RemoteToLocalSyncerTest : public testing::Test {
 
   scoped_ptr<SyncEngineContext> context_;
   scoped_ptr<FakeDriveServiceHelper> fake_drive_helper_;
-  scoped_ptr<FakeRemoteChangeProcessor> fake_remote_change_processor_;
+  scoped_ptr<FakeRemoteChangeProcessor> remote_change_processor_;
 
   scoped_ptr<SyncTaskManager> sync_task_manager_;