summaryrefslogtreecommitdiffstats
path: root/sync/sessions/status_controller_unittest.cc
diff options
context:
space:
mode:
authorrlarocque@chromium.org <rlarocque@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-10-17 23:58:41 +0000
committerrlarocque@chromium.org <rlarocque@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-10-17 23:58:41 +0000
commit16449b24f3f63906f32f6a89032617c73ff72edf (patch)
treecde2539a385947dd3bf11ba686316a3e946f025a /sync/sessions/status_controller_unittest.cc
parent9835d34c8ece44b0dabcf650310a1bb8b7d017c6 (diff)
downloadchromium_src-16449b24f3f63906f32f6a89032617c73ff72edf.zip
chromium_src-16449b24f3f63906f32f6a89032617c73ff72edf.tar.gz
chromium_src-16449b24f3f63906f32f6a89032617c73ff72edf.tar.bz2
sync: Remove UpdateProgress and related code
Following the merge of the process updates and verify updates step, there is no longer any need for the UpdateProgress class. Its only use outside of tests was to pass data between the verify and update steps during a sync cycle. The class had some use in tests, but most of the assertions based on it were somewhat redundant. They can be replaced by assertions on similar, but non-ModelSafe, counts. BUG=156238 Review URL: https://chromiumcodereview.appspot.com/11190013 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@162576 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'sync/sessions/status_controller_unittest.cc')
-rw-r--r--sync/sessions/status_controller_unittest.cc28
1 files changed, 5 insertions, 23 deletions
diff --git a/sync/sessions/status_controller_unittest.cc b/sync/sessions/status_controller_unittest.cc
index 619e1fa..3e5143b 100644
--- a/sync/sessions/status_controller_unittest.cc
+++ b/sync/sessions/status_controller_unittest.cc
@@ -45,37 +45,22 @@ TEST_F(StatusControllerTest, ReadYourWrites) {
TEST_F(StatusControllerTest, HasConflictingUpdates) {
StatusController status(routes_);
EXPECT_FALSE(status.HasConflictingUpdates());
+
{
ScopedModelSafeGroupRestriction r(&status, GROUP_UI);
- EXPECT_FALSE(status.update_progress());
- status.mutable_update_progress()->AddAppliedUpdate(SUCCESS,
- syncable::Id());
- status.mutable_update_progress()->AddAppliedUpdate(CONFLICT_SIMPLE,
- syncable::Id());
- EXPECT_TRUE(status.update_progress()->HasConflictingUpdates());
+ status.increment_num_updates_applied();
+ status.mutable_simple_conflict_ids()->insert(syncable::Id());
}
EXPECT_TRUE(status.HasConflictingUpdates());
-
- {
- ScopedModelSafeGroupRestriction r(&status, GROUP_PASSIVE);
- EXPECT_FALSE(status.update_progress());
- }
}
TEST_F(StatusControllerTest, HasConflictingUpdates_NonBlockingUpdates) {
StatusController status(routes_);
EXPECT_FALSE(status.HasConflictingUpdates());
- {
- ScopedModelSafeGroupRestriction r(&status, GROUP_UI);
- EXPECT_FALSE(status.update_progress());
- status.mutable_update_progress()->AddAppliedUpdate(SUCCESS,
- syncable::Id());
- status.mutable_update_progress()->AddAppliedUpdate(CONFLICT_HIERARCHY,
- syncable::Id());
- EXPECT_TRUE(status.update_progress()->HasConflictingUpdates());
- }
+ status.increment_num_updates_applied();
+ status.increment_num_encryption_conflicts();
EXPECT_TRUE(status.HasConflictingUpdates());
}
@@ -116,9 +101,6 @@ TEST_F(StatusControllerTest, TotalNumConflictingItems) {
// Basic test that non group-restricted state accessors don't cause violations.
TEST_F(StatusControllerTest, Unrestricted) {
StatusController status(routes_);
- const UpdateProgress* progress =
- status.GetUnrestrictedUpdateProgress(GROUP_UI);
- EXPECT_FALSE(progress);
status.model_neutral_state();
status.download_updates_succeeded();
status.ServerSaysNothingMoreToDownload();