| 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/scoped_temp_dir.h" | 9 #include "base/files/scoped_temp_dir.h" |
| 10 #include "base/run_loop.h" | 10 #include "base/run_loop.h" |
| (...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 232 }; | 232 }; |
| 233 | 233 |
| 234 TEST_F(ConflictResolverTest, NoFileToBeResolved) { | 234 TEST_F(ConflictResolverTest, NoFileToBeResolved) { |
| 235 const GURL kOrigin("chrome-extension://example"); | 235 const GURL kOrigin("chrome-extension://example"); |
| 236 const std::string sync_root = CreateSyncRoot(); | 236 const std::string sync_root = CreateSyncRoot(); |
| 237 const std::string app_root = CreateRemoteFolder(sync_root, kOrigin.host()); | 237 const std::string app_root = CreateRemoteFolder(sync_root, kOrigin.host()); |
| 238 InitializeMetadataDatabase(); | 238 InitializeMetadataDatabase(); |
| 239 RegisterApp(kOrigin.host(), app_root); | 239 RegisterApp(kOrigin.host(), app_root); |
| 240 RunSyncerUntilIdle(); | 240 RunSyncerUntilIdle(); |
| 241 | 241 |
| 242 EXPECT_EQ(SYNC_STATUS_NO_CHANGE_TO_SYNC, RunConflictResolver()); | 242 EXPECT_EQ(SYNC_STATUS_NO_CONFLICT, RunConflictResolver()); |
| 243 } | 243 } |
| 244 | 244 |
| 245 TEST_F(ConflictResolverTest, ResolveConflict_Files) { | 245 TEST_F(ConflictResolverTest, ResolveConflict_Files) { |
| 246 const GURL kOrigin("chrome-extension://example"); | 246 const GURL kOrigin("chrome-extension://example"); |
| 247 const std::string sync_root = CreateSyncRoot(); | 247 const std::string sync_root = CreateSyncRoot(); |
| 248 const std::string app_root = CreateRemoteFolder(sync_root, kOrigin.host()); | 248 const std::string app_root = CreateRemoteFolder(sync_root, kOrigin.host()); |
| 249 InitializeMetadataDatabase(); | 249 InitializeMetadataDatabase(); |
| 250 RegisterApp(kOrigin.host(), app_root); | 250 RegisterApp(kOrigin.host(), app_root); |
| 251 RunSyncerUntilIdle(); | 251 RunSyncerUntilIdle(); |
| 252 | 252 |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 369 | 369 |
| 370 EXPECT_EQ(4, CountParents(file)); | 370 EXPECT_EQ(4, CountParents(file)); |
| 371 | 371 |
| 372 EXPECT_EQ(SYNC_STATUS_OK, RunConflictResolver()); | 372 EXPECT_EQ(SYNC_STATUS_OK, RunConflictResolver()); |
| 373 | 373 |
| 374 EXPECT_EQ(1, CountParents(file)); | 374 EXPECT_EQ(1, CountParents(file)); |
| 375 } | 375 } |
| 376 | 376 |
| 377 } // namespace drive_backend | 377 } // namespace drive_backend |
| 378 } // namespace sync_file_system | 378 } // namespace sync_file_system |
| OLD | NEW |