| Index: chrome/browser/sync_file_system/drive_file_sync_service_mock_unittest.cc
|
| diff --git a/chrome/browser/sync_file_system/drive_file_sync_service_mock_unittest.cc b/chrome/browser/sync_file_system/drive_file_sync_service_mock_unittest.cc
|
| index 8448c67b52b8a37acc68e51fdd2f060df8f73457..76bbc614d52bc30a5b0bedc9f3b1bb15978370be 100644
|
| --- a/chrome/browser/sync_file_system/drive_file_sync_service_mock_unittest.cc
|
| +++ b/chrome/browser/sync_file_system/drive_file_sync_service_mock_unittest.cc
|
| @@ -30,6 +30,7 @@
|
| #include "net/base/escape.h"
|
| #include "testing/gmock/include/gmock/gmock.h"
|
| #include "testing/gtest/include/gtest/gtest.h"
|
| +#include "webkit/fileapi/file_system_util.h"
|
| #include "webkit/fileapi/syncable/sync_direction.h"
|
| #include "webkit/fileapi/syncable/sync_file_metadata.h"
|
| #include "webkit/fileapi/syncable/syncable_file_system_util.h"
|
| @@ -79,10 +80,6 @@ void DidInitialize(bool* done, SyncStatusCode status, bool created) {
|
| EXPECT_TRUE(created);
|
| }
|
|
|
| -void DidUpdateEntry(SyncStatusCode status) {
|
| - EXPECT_EQ(SYNC_STATUS_OK, status);
|
| -}
|
| -
|
| void DidGetSyncRoot(bool* done,
|
| SyncStatusCode status,
|
| const std::string& resource_id) {
|
| @@ -600,47 +597,6 @@ class DriveFileSyncServiceMockTest : public testing::Test {
|
|
|
| #if !defined(OS_ANDROID)
|
|
|
| -TEST_F(DriveFileSyncServiceMockTest, BatchSyncOnInitialization) {
|
| - const GURL kOrigin1 = ExtensionNameToGURL(FPL("example1"));
|
| - const GURL kOrigin2 = ExtensionNameToGURL(FPL("example2"));
|
| - const std::string kDirectoryResourceId1(
|
| - "folder:origin_directory_resource_id");
|
| - const std::string kDirectoryResourceId2(
|
| - "folder:origin_directory_resource_id2");
|
| - const std::string kSyncRootResourceId("folder:sync_root_resource_id");
|
| -
|
| - metadata_store()->SetSyncRootDirectory(kSyncRootResourceId);
|
| - metadata_store()->AddBatchSyncOrigin(kOrigin1, kDirectoryResourceId1);
|
| - metadata_store()->AddBatchSyncOrigin(kOrigin2, kDirectoryResourceId2);
|
| - metadata_store()->MoveBatchSyncOriginToIncremental(kOrigin2);
|
| -
|
| - Sequence change_queue_seq;
|
| - EXPECT_CALL(*mock_remote_observer(), OnRemoteChangeQueueUpdated(0))
|
| - .InSequence(change_queue_seq);
|
| - EXPECT_CALL(*mock_remote_observer(), OnRemoteChangeQueueUpdated(1))
|
| - .Times(AnyNumber())
|
| - .InSequence(change_queue_seq);
|
| -
|
| - SetUpDriveServiceExpectCallsForGetAboutResource();
|
| - SetUpDriveServiceExpectCallsForGetResourceListInDirectory(
|
| - "chromeos/sync_file_system/listing_files_in_directory.json",
|
| - kDirectoryResourceId1);
|
| -
|
| - // The service will get called for incremental sync at the end after
|
| - // batch sync's done.
|
| - SetUpDriveServiceExpectCallsForIncrementalSync();
|
| -
|
| - SetUpDriveSyncService(true);
|
| - message_loop()->RunUntilIdle();
|
| -
|
| - // kOrigin1 should be a batch sync origin and kOrigin2 should be an
|
| - // incremental sync origin.
|
| - // 4 pending remote changes are from listing_files_in_directory as batch sync
|
| - // changes.
|
| - VerifySizeOfRegisteredOrigins(1u, 1u, 0u);
|
| - EXPECT_EQ(1u, remote_change_handler().ChangesSize());
|
| -}
|
| -
|
| TEST_F(DriveFileSyncServiceMockTest, RegisterNewOrigin) {
|
| const GURL kOrigin("chrome-extension://example");
|
| const std::string kDirectoryResourceId("folder:origin_directory_resource_id");
|
| @@ -750,20 +706,11 @@ TEST_F(DriveFileSyncServiceMockTest, UnregisterOrigin) {
|
| EXPECT_CALL(*mock_remote_observer(), OnRemoteChangeQueueUpdated(_))
|
| .Times(AnyNumber());
|
|
|
| - InSequence sequence;
|
| -
|
| - SetUpDriveServiceExpectCallsForGetAboutResource();
|
| - SetUpDriveServiceExpectCallsForGetResourceListInDirectory(
|
| - "chromeos/sync_file_system/listing_files_in_directory.json",
|
| - kDirectoryResourceId1);
|
| -
|
| - SetUpDriveServiceExpectCallsForIncrementalSync();
|
| -
|
| SetUpDriveSyncService(true);
|
| message_loop()->RunUntilIdle();
|
|
|
| VerifySizeOfRegisteredOrigins(1u, 1u, 0u);
|
| - EXPECT_EQ(1u, remote_change_handler().ChangesSize());
|
| + EXPECT_EQ(0u, remote_change_handler().ChangesSize());
|
|
|
| bool done = false;
|
| sync_service()->UnregisterOriginForTrackingChanges(
|
| @@ -796,14 +743,14 @@ TEST_F(DriveFileSyncServiceMockTest, UpdateRegisteredOrigins) {
|
| EXPECT_CALL(*mock_remote_observer(), OnRemoteChangeQueueUpdated(_))
|
| .Times(AnyNumber());
|
|
|
| - InSequence sequence;
|
| -
|
| - SetUpDriveServiceExpectCallsForGetAboutResource();
|
| - SetUpDriveServiceExpectCallsForGetResourceListInDirectory(
|
| - "chromeos/sync_file_system/listing_files_in_directory.json",
|
| - kDirectoryResourceId1);
|
| -
|
| - SetUpDriveServiceExpectCallsForIncrementalSync();
|
| +// InSequence sequence;
|
| +//
|
| +// SetUpDriveServiceExpectCallsForGetAboutResource();
|
| +// SetUpDriveServiceExpectCallsForGetResourceListInDirectory(
|
| +// "chromeos/sync_file_system/listing_files_in_directory.json",
|
| +// kDirectoryResourceId1);
|
| +//
|
| +// SetUpDriveServiceExpectCallsForIncrementalSync();
|
|
|
| SetUpDriveSyncService(true);
|
| message_loop()->RunUntilIdle();
|
|
|