| 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 "chrome/browser/sync_file_system/drive_backend/conflict_resolver.h" | 5 #include "chrome/browser/sync_file_system/drive_backend/conflict_resolver.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/callback.h" | 8 #include "base/callback.h" |
| 9 #include "base/files/file_util.h" | 9 #include "base/files/file_util.h" |
| 10 #include "base/files/scoped_temp_dir.h" | 10 #include "base/files/scoped_temp_dir.h" |
| (...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 210 const int kRetryLimit = 100; | 210 const int kRetryLimit = 100; |
| 211 SyncStatusCode status; | 211 SyncStatusCode status; |
| 212 int retry_count = 0; | 212 int retry_count = 0; |
| 213 MetadataDatabase* metadata_database = context_->GetMetadataDatabase(); | 213 MetadataDatabase* metadata_database = context_->GetMetadataDatabase(); |
| 214 do { | 214 do { |
| 215 if (retry_count++ > kRetryLimit) | 215 if (retry_count++ > kRetryLimit) |
| 216 break; | 216 break; |
| 217 status = RunRemoteToLocalSyncer(); | 217 status = RunRemoteToLocalSyncer(); |
| 218 } while (status == SYNC_STATUS_OK || | 218 } while (status == SYNC_STATUS_OK || |
| 219 status == SYNC_STATUS_RETRY || | 219 status == SYNC_STATUS_RETRY || |
| 220 metadata_database->PromoteLowerPriorityTrackersToNormal()); | 220 metadata_database->PromoteDemotedTrackers()); |
| 221 EXPECT_EQ(SYNC_STATUS_NO_CHANGE_TO_SYNC, status); | 221 EXPECT_EQ(SYNC_STATUS_NO_CHANGE_TO_SYNC, status); |
| 222 } | 222 } |
| 223 | 223 |
| 224 SyncStatusCode RunConflictResolver() { | 224 SyncStatusCode RunConflictResolver() { |
| 225 SyncStatusCode status = SYNC_STATUS_UNKNOWN; | 225 SyncStatusCode status = SYNC_STATUS_UNKNOWN; |
| 226 ConflictResolver resolver(context_.get()); | 226 ConflictResolver resolver(context_.get()); |
| 227 resolver.RunPreflight(SyncTaskToken::CreateForTesting( | 227 resolver.RunPreflight(SyncTaskToken::CreateForTesting( |
| 228 CreateResultReceiver(&status))); | 228 CreateResultReceiver(&status))); |
| 229 base::RunLoop().RunUntilIdle(); | 229 base::RunLoop().RunUntilIdle(); |
| 230 return status; | 230 return status; |
| (...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 520 | 520 |
| 521 EXPECT_EQ(4, CountParents(file)); | 521 EXPECT_EQ(4, CountParents(file)); |
| 522 | 522 |
| 523 EXPECT_EQ(SYNC_STATUS_OK, RunConflictResolver()); | 523 EXPECT_EQ(SYNC_STATUS_OK, RunConflictResolver()); |
| 524 | 524 |
| 525 EXPECT_EQ(1, CountParents(file)); | 525 EXPECT_EQ(1, CountParents(file)); |
| 526 } | 526 } |
| 527 | 527 |
| 528 } // namespace drive_backend | 528 } // namespace drive_backend |
| 529 } // namespace sync_file_system | 529 } // namespace sync_file_system |
| OLD | NEW |