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 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
204 | 204 |
205 // More complete tests for PrepareForProcessRemoteChange and ApplyRemoteChange | 205 // More complete tests for PrepareForProcessRemoteChange and ApplyRemoteChange |
206 // are also in content_unittest:LocalFileSyncContextTest. | 206 // are also in content_unittest:LocalFileSyncContextTest. |
207 TEST_F(LocalFileSyncServiceTest, RemoteSyncStepsSimple) { | 207 TEST_F(LocalFileSyncServiceTest, RemoteSyncStepsSimple) { |
208 const FileSystemURL kFile(file_system_->URL("file")); | 208 const FileSystemURL kFile(file_system_->URL("file")); |
209 const FileSystemURL kDir(file_system_->URL("dir")); | 209 const FileSystemURL kDir(file_system_->URL("dir")); |
210 const char kTestFileData[] = "0123456789"; | 210 const char kTestFileData[] = "0123456789"; |
211 const int kTestFileDataSize = static_cast<int>(arraysize(kTestFileData) - 1); | 211 const int kTestFileDataSize = static_cast<int>(arraysize(kTestFileData) - 1); |
212 | 212 |
213 base::FilePath local_path; | 213 base::FilePath local_path; |
214 ASSERT_TRUE(file_util::CreateTemporaryFileInDir(temp_dir_.path(), | 214 ASSERT_TRUE(base::CreateTemporaryFileInDir(temp_dir_.path(), &local_path)); |
215 &local_path)); | |
216 ASSERT_EQ(kTestFileDataSize, | 215 ASSERT_EQ(kTestFileDataSize, |
217 file_util::WriteFile(local_path, kTestFileData, kTestFileDataSize)); | 216 file_util::WriteFile(local_path, kTestFileData, kTestFileDataSize)); |
218 | 217 |
219 // Run PrepareForProcessRemoteChange for kFile. | 218 // Run PrepareForProcessRemoteChange for kFile. |
220 SyncFileMetadata expected_metadata; | 219 SyncFileMetadata expected_metadata; |
221 expected_metadata.file_type = SYNC_FILE_TYPE_UNKNOWN; | 220 expected_metadata.file_type = SYNC_FILE_TYPE_UNKNOWN; |
222 expected_metadata.size = 0; | 221 expected_metadata.size = 0; |
223 PrepareForProcessRemoteChange(kFile, FROM_HERE, | 222 PrepareForProcessRemoteChange(kFile, FROM_HERE, |
224 SYNC_STATUS_OK, | 223 SYNC_STATUS_OK, |
225 expected_metadata); | 224 expected_metadata); |
(...skipping 496 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
722 all_origins.insert(kOrigin2); | 721 all_origins.insert(kOrigin2); |
723 all_origins.insert(kOrigin3); | 722 all_origins.insert(kOrigin3); |
724 while (!all_origins.empty()) { | 723 while (!all_origins.empty()) { |
725 ASSERT_TRUE(NextOriginToProcess(&origin)); | 724 ASSERT_TRUE(NextOriginToProcess(&origin)); |
726 ASSERT_TRUE(ContainsKey(all_origins, origin)); | 725 ASSERT_TRUE(ContainsKey(all_origins, origin)); |
727 all_origins.erase(origin); | 726 all_origins.erase(origin); |
728 } | 727 } |
729 } | 728 } |
730 | 729 |
731 } // namespace sync_file_system | 730 } // namespace sync_file_system |
OLD | NEW |