| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 <vector> | 5 #include <vector> |
| 6 | 6 |
| 7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
| 8 #include "base/bind.h" | 8 #include "base/bind.h" |
| 9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
| 10 #include "base/location.h" | 10 #include "base/location.h" |
| (...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 211 // are also in content_unittest:LocalFileSyncContextTest. | 211 // are also in content_unittest:LocalFileSyncContextTest. |
| 212 TEST_F(LocalFileSyncServiceTest, RemoteSyncStepsSimple) { | 212 TEST_F(LocalFileSyncServiceTest, RemoteSyncStepsSimple) { |
| 213 const FileSystemURL kFile(file_system_->URL("file")); | 213 const FileSystemURL kFile(file_system_->URL("file")); |
| 214 const FileSystemURL kDir(file_system_->URL("dir")); | 214 const FileSystemURL kDir(file_system_->URL("dir")); |
| 215 const char kTestFileData[] = "0123456789"; | 215 const char kTestFileData[] = "0123456789"; |
| 216 const int kTestFileDataSize = static_cast<int>(arraysize(kTestFileData) - 1); | 216 const int kTestFileDataSize = static_cast<int>(arraysize(kTestFileData) - 1); |
| 217 | 217 |
| 218 base::FilePath local_path; | 218 base::FilePath local_path; |
| 219 ASSERT_TRUE(base::CreateTemporaryFileInDir(temp_dir_.path(), &local_path)); | 219 ASSERT_TRUE(base::CreateTemporaryFileInDir(temp_dir_.path(), &local_path)); |
| 220 ASSERT_EQ(kTestFileDataSize, | 220 ASSERT_EQ(kTestFileDataSize, |
| 221 file_util::WriteFile(local_path, kTestFileData, kTestFileDataSize)); | 221 base::WriteFile(local_path, kTestFileData, kTestFileDataSize)); |
| 222 | 222 |
| 223 // Run PrepareForProcessRemoteChange for kFile. | 223 // Run PrepareForProcessRemoteChange for kFile. |
| 224 SyncFileMetadata expected_metadata; | 224 SyncFileMetadata expected_metadata; |
| 225 expected_metadata.file_type = SYNC_FILE_TYPE_UNKNOWN; | 225 expected_metadata.file_type = SYNC_FILE_TYPE_UNKNOWN; |
| 226 expected_metadata.size = 0; | 226 expected_metadata.size = 0; |
| 227 PrepareForProcessRemoteChange(kFile, FROM_HERE, | 227 PrepareForProcessRemoteChange(kFile, FROM_HERE, |
| 228 SYNC_STATUS_OK, | 228 SYNC_STATUS_OK, |
| 229 expected_metadata); | 229 expected_metadata); |
| 230 | 230 |
| 231 // Run ApplyRemoteChange for kFile. | 231 // Run ApplyRemoteChange for kFile. |
| (...skipping 495 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 727 all_origins.insert(kOrigin2); | 727 all_origins.insert(kOrigin2); |
| 728 all_origins.insert(kOrigin3); | 728 all_origins.insert(kOrigin3); |
| 729 while (!all_origins.empty()) { | 729 while (!all_origins.empty()) { |
| 730 ASSERT_TRUE(NextOriginToProcess(&origin)); | 730 ASSERT_TRUE(NextOriginToProcess(&origin)); |
| 731 ASSERT_TRUE(ContainsKey(all_origins, origin)); | 731 ASSERT_TRUE(ContainsKey(all_origins, origin)); |
| 732 all_origins.erase(origin); | 732 all_origins.erase(origin); |
| 733 } | 733 } |
| 734 } | 734 } |
| 735 | 735 |
| 736 } // namespace sync_file_system | 736 } // namespace sync_file_system |
| OLD | NEW |