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