| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/sync_file_system/drive_file_sync_service.h" | 5 #include "chrome/browser/sync_file_system/drive_file_sync_service.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 #include "testing/gmock/include/gmock/gmock.h" | 29 #include "testing/gmock/include/gmock/gmock.h" |
| 30 #include "testing/gtest/include/gtest/gtest.h" | 30 #include "testing/gtest/include/gtest/gtest.h" |
| 31 #include "webkit/fileapi/syncable/sync_file_metadata.h" | 31 #include "webkit/fileapi/syncable/sync_file_metadata.h" |
| 32 #include "webkit/fileapi/syncable/syncable_file_system_util.h" | 32 #include "webkit/fileapi/syncable/syncable_file_system_util.h" |
| 33 | 33 |
| 34 #define FPL(x) FILE_PATH_LITERAL(x) | 34 #define FPL(x) FILE_PATH_LITERAL(x) |
| 35 | 35 |
| 36 using ::testing::AnyNumber; | 36 using ::testing::AnyNumber; |
| 37 using ::testing::AtLeast; | 37 using ::testing::AtLeast; |
| 38 using ::testing::InSequence; | 38 using ::testing::InSequence; |
| 39 using ::testing::Sequence; |
| 39 using ::testing::StrictMock; | 40 using ::testing::StrictMock; |
| 40 using ::testing::_; | 41 using ::testing::_; |
| 41 | 42 |
| 42 using google_apis::ResourceEntry; | 43 using google_apis::ResourceEntry; |
| 43 using google_apis::DriveServiceInterface; | 44 using google_apis::DriveServiceInterface; |
| 44 using google_apis::DriveUploaderInterface; | 45 using google_apis::DriveUploaderInterface; |
| 45 using google_apis::test_util::LoadJSONFile; | 46 using google_apis::test_util::LoadJSONFile; |
| 46 | 47 |
| 47 using extensions::Extension; | 48 using extensions::Extension; |
| 48 using extensions::DictionaryBuilder; | 49 using extensions::DictionaryBuilder; |
| (...skipping 519 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 568 "folder:origin_directory_resource_id"); | 569 "folder:origin_directory_resource_id"); |
| 569 const std::string kDirectoryResourceId2( | 570 const std::string kDirectoryResourceId2( |
| 570 "folder:origin_directory_resource_id2"); | 571 "folder:origin_directory_resource_id2"); |
| 571 const std::string kSyncRootResourceId("folder:sync_root_resource_id"); | 572 const std::string kSyncRootResourceId("folder:sync_root_resource_id"); |
| 572 | 573 |
| 573 metadata_store()->SetSyncRootDirectory(kSyncRootResourceId); | 574 metadata_store()->SetSyncRootDirectory(kSyncRootResourceId); |
| 574 metadata_store()->AddBatchSyncOrigin(kOrigin1, kDirectoryResourceId1); | 575 metadata_store()->AddBatchSyncOrigin(kOrigin1, kDirectoryResourceId1); |
| 575 metadata_store()->AddBatchSyncOrigin(kOrigin2, kDirectoryResourceId2); | 576 metadata_store()->AddBatchSyncOrigin(kOrigin2, kDirectoryResourceId2); |
| 576 metadata_store()->MoveBatchSyncOriginToIncremental(kOrigin2); | 577 metadata_store()->MoveBatchSyncOriginToIncremental(kOrigin2); |
| 577 | 578 |
| 579 Sequence change_queue_seq; |
| 580 EXPECT_CALL(*mock_remote_observer(), OnRemoteChangeQueueUpdated(0)) |
| 581 .InSequence(change_queue_seq); |
| 578 EXPECT_CALL(*mock_remote_observer(), OnRemoteChangeQueueUpdated(3)) | 582 EXPECT_CALL(*mock_remote_observer(), OnRemoteChangeQueueUpdated(3)) |
| 579 .Times(AnyNumber()); | 583 .InSequence(change_queue_seq); |
| 580 | 584 |
| 581 InSequence sequence; | 585 InSequence sequence; |
| 582 | 586 |
| 583 SetUpDriveServiceExpectCallsForGetAccountMetadata(); | 587 SetUpDriveServiceExpectCallsForGetAccountMetadata(); |
| 584 SetUpDriveServiceExpectCallsForGetResourceList( | 588 SetUpDriveServiceExpectCallsForGetResourceList( |
| 585 "sync_file_system/listing_files_in_directory.json", | 589 "sync_file_system/listing_files_in_directory.json", |
| 586 std::string(), | 590 std::string(), |
| 587 kDirectoryResourceId1); | 591 kDirectoryResourceId1); |
| 588 | 592 |
| 589 EXPECT_CALL(*mock_remote_observer(), | 593 EXPECT_CALL(*mock_remote_observer(), |
| (...skipping 480 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1070 kOrigin, kFilePath, true /* is_deleted */, | 1074 kOrigin, kFilePath, true /* is_deleted */, |
| 1071 kFileResourceId2, 7, "deleted_file_md5")); | 1075 kFileResourceId2, 7, "deleted_file_md5")); |
| 1072 EXPECT_TRUE(AppendIncrementalRemoteChange( | 1076 EXPECT_TRUE(AppendIncrementalRemoteChange( |
| 1073 kOrigin, kFilePath, false /* is_deleted */, | 1077 kOrigin, kFilePath, false /* is_deleted */, |
| 1074 kFileResourceId, 8, "updated_file_md5")); | 1078 kFileResourceId, 8, "updated_file_md5")); |
| 1075 } | 1079 } |
| 1076 | 1080 |
| 1077 #endif // !defined(OS_ANDROID) | 1081 #endif // !defined(OS_ANDROID) |
| 1078 | 1082 |
| 1079 } // namespace sync_file_system | 1083 } // namespace sync_file_system |
| OLD | NEW |