OLD | NEW |
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 "chrome/browser/sync/test/integration/updated_progress_marker_checker.h
" | 5 #include "chrome/browser/sync/test/integration/updated_progress_marker_checker.h
" |
6 | 6 |
7 #include "components/browser_sync/browser/profile_sync_service.h" | 7 #include "components/browser_sync/profile_sync_service.h" |
8 #include "components/sync/engine/cycle/sync_cycle_snapshot.h" | 8 #include "components/sync/engine/cycle/sync_cycle_snapshot.h" |
9 | 9 |
10 UpdatedProgressMarkerChecker::UpdatedProgressMarkerChecker( | 10 UpdatedProgressMarkerChecker::UpdatedProgressMarkerChecker( |
11 ProfileSyncService* service) : SingleClientStatusChangeChecker(service) {} | 11 ProfileSyncService* service) : SingleClientStatusChangeChecker(service) {} |
12 | 12 |
13 UpdatedProgressMarkerChecker::~UpdatedProgressMarkerChecker() {} | 13 UpdatedProgressMarkerChecker::~UpdatedProgressMarkerChecker() {} |
14 | 14 |
15 bool UpdatedProgressMarkerChecker::IsExitConditionSatisfied() { | 15 bool UpdatedProgressMarkerChecker::IsExitConditionSatisfied() { |
16 // Checks to see if our self-notify sync cycle has completed and | 16 // Checks to see if our self-notify sync cycle has completed and |
17 // there's nothing to commit. | 17 // there's nothing to commit. |
(...skipping 18 matching lines...) Expand all Loading... |
36 // ProfileSyncService. If we're calling this right after the sync session | 36 // ProfileSyncService. If we're calling this right after the sync session |
37 // completes, then the snapshot is much more likely to be up to date. | 37 // completes, then the snapshot is much more likely to be up to date. |
38 const syncer::SyncCycleSnapshot& snap = service()->GetLastCycleSnapshot(); | 38 const syncer::SyncCycleSnapshot& snap = service()->GetLastCycleSnapshot(); |
39 return snap.model_neutral_state().num_successful_commits == 0 && | 39 return snap.model_neutral_state().num_successful_commits == 0 && |
40 service()->IsSyncActive() && !service()->HasUnsyncedItems(); | 40 service()->IsSyncActive() && !service()->HasUnsyncedItems(); |
41 } | 41 } |
42 | 42 |
43 std::string UpdatedProgressMarkerChecker::GetDebugMessage() const { | 43 std::string UpdatedProgressMarkerChecker::GetDebugMessage() const { |
44 return "Waiting for progress markers"; | 44 return "Waiting for progress markers"; |
45 } | 45 } |
OLD | NEW |