Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(143)

Side by Side Diff: chrome/browser/sync_file_system/drive_backend/drive_backend_sync_unittest.cc

Issue 407073003: [SyncFS] Add completion callback to PromoteDemotedChanges (1/3) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/sync_file_system/drive_backend/fake_sync_worker.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 <algorithm> 5 #include <algorithm>
6 #include <stack> 6 #include <stack>
7 7
8 #include "base/file_util.h" 8 #include "base/file_util.h"
9 #include "base/message_loop/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 #include "base/run_loop.h" 10 #include "base/run_loop.h"
(...skipping 338 matching lines...) Expand 10 before | Expand all | Expand 10 after
349 return local_sync_status; 349 return local_sync_status;
350 350
351 remote_sync_status = ProcessRemoteChange(); 351 remote_sync_status = ProcessRemoteChange();
352 if (remote_sync_status != SYNC_STATUS_OK && 352 if (remote_sync_status != SYNC_STATUS_OK &&
353 remote_sync_status != SYNC_STATUS_NO_CHANGE_TO_SYNC && 353 remote_sync_status != SYNC_STATUS_NO_CHANGE_TO_SYNC &&
354 remote_sync_status != SYNC_STATUS_FILE_BUSY) 354 remote_sync_status != SYNC_STATUS_FILE_BUSY)
355 return remote_sync_status; 355 return remote_sync_status;
356 356
357 if (local_sync_status == SYNC_STATUS_NO_CHANGE_TO_SYNC && 357 if (local_sync_status == SYNC_STATUS_NO_CHANGE_TO_SYNC &&
358 remote_sync_status == SYNC_STATUS_NO_CHANGE_TO_SYNC) { 358 remote_sync_status == SYNC_STATUS_NO_CHANGE_TO_SYNC) {
359 remote_sync_service_->PromoteDemotedChanges(); 359
360 local_sync_service_->PromoteDemotedChanges(); 360 {
361 base::RunLoop run_loop;
362 remote_sync_service_->PromoteDemotedChanges(run_loop.QuitClosure());
363 run_loop.Run();
364 }
365
366 {
367 base::RunLoop run_loop;
368 local_sync_service_->PromoteDemotedChanges(run_loop.QuitClosure());
369 run_loop.Run();
370 }
361 371
362 if (pending_remote_changes_ || pending_local_changes_) 372 if (pending_remote_changes_ || pending_local_changes_)
363 continue; 373 continue;
364 374
365 base::RunLoop run_loop; 375 base::RunLoop run_loop;
366 int64 largest_fetched_change_id = -1; 376 int64 largest_fetched_change_id = -1;
367 PostTaskAndReplyWithResult( 377 PostTaskAndReplyWithResult(
368 worker_task_runner_, 378 worker_task_runner_,
369 FROM_HERE, 379 FROM_HERE,
370 base::Bind(&MetadataDatabase::GetLargestFetchedChangeID, 380 base::Bind(&MetadataDatabase::GetLargestFetchedChangeID,
(...skipping 1325 matching lines...) Expand 10 before | Expand all | Expand 10 after
1696 1706
1697 EXPECT_EQ(1u, CountApp()); 1707 EXPECT_EQ(1u, CountApp());
1698 EXPECT_EQ(1u, CountLocalFile(app_id)); 1708 EXPECT_EQ(1u, CountLocalFile(app_id));
1699 1709
1700 EXPECT_EQ(2u, CountMetadata()); 1710 EXPECT_EQ(2u, CountMetadata());
1701 EXPECT_EQ(2u, CountTracker()); 1711 EXPECT_EQ(2u, CountTracker());
1702 } 1712 }
1703 1713
1704 } // namespace drive_backend 1714 } // namespace drive_backend
1705 } // namespace sync_file_system 1715 } // namespace sync_file_system
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/sync_file_system/drive_backend/fake_sync_worker.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698