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

Unified Diff: sync/sessions/sync_session_unittest.cc

Issue 10933075: FYI: Remove PerModelSafeGroupState + move ConflictResolution (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sync/sessions/sync_session.cc ('k') | sync/sessions/test_util.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sync/sessions/sync_session_unittest.cc
diff --git a/sync/sessions/sync_session_unittest.cc b/sync/sessions/sync_session_unittest.cc
index bc69fe87588f615a9cc8846a4e395b8301c6722c..7fa46fba5dff3261f06320d202b6ca598e34f51f 100644
--- a/sync/sessions/sync_session_unittest.cc
+++ b/sync/sessions/sync_session_unittest.cc
@@ -13,7 +13,6 @@
#include "sync/engine/throttled_data_type_tracker.h"
#include "sync/internal_api/public/base/model_type.h"
#include "sync/internal_api/public/base/model_type_state_map_test_util.h"
-#include "sync/sessions/session_state.h"
#include "sync/sessions/status_controller.h"
#include "sync/syncable/syncable_id.h"
#include "sync/syncable/write_transaction.h"
@@ -162,27 +161,6 @@ TEST_F(SyncSessionTest, EnabledGroups) {
EXPECT_EQ(expected_enabled_groups, session->GetEnabledGroups());
}
-TEST_F(SyncSessionTest, EnabledGroupsWithConflictsEmpty) {
- scoped_ptr<SyncSession> session(MakeSession());
- // Auto-create conflict progress. This shouldn't put that group in
- // conflict.
- session->mutable_status_controller()->
- GetUnrestrictedMutableConflictProgressForTest(GROUP_PASSIVE);
- EXPECT_TRUE(session->GetEnabledGroupsWithConflicts().empty());
-}
-
-TEST_F(SyncSessionTest, EnabledGroupsWithConflicts) {
- scoped_ptr<SyncSession> session(MakeSession());
- // Put GROUP_UI in conflict.
- session->mutable_status_controller()->
- GetUnrestrictedMutableConflictProgressForTest(GROUP_UI)->
- AddSimpleConflictingItemById(syncable::Id());
- std::set<ModelSafeGroup> expected_enabled_groups_with_conflicts;
- expected_enabled_groups_with_conflicts.insert(GROUP_UI);
- EXPECT_EQ(expected_enabled_groups_with_conflicts,
- session->GetEnabledGroupsWithConflicts());
-}
-
TEST_F(SyncSessionTest, ScopedContextHelpers) {
ConflictResolver resolver;
EXPECT_FALSE(context_->resolver());
@@ -215,10 +193,6 @@ TEST_F(SyncSessionTest, MoreToDownloadIfDownloadFailed) {
// When DownloadUpdatesCommand fails, these should be false.
EXPECT_FALSE(status()->ServerSaysNothingMoreToDownload());
EXPECT_FALSE(status()->download_updates_succeeded());
-
- // Download updates has its own loop in the syncer; it shouldn't factor
- // into HasMoreToSync.
- EXPECT_FALSE(session_->HasMoreToSync());
}
TEST_F(SyncSessionTest, MoreToDownloadIfGotChangesRemaining) {
@@ -231,10 +205,6 @@ TEST_F(SyncSessionTest, MoreToDownloadIfGotChangesRemaining) {
->set_changes_remaining(1000L);
EXPECT_FALSE(status()->ServerSaysNothingMoreToDownload());
EXPECT_TRUE(status()->download_updates_succeeded());
-
- // Download updates has its own loop in the syncer; it shouldn't factor
- // into HasMoreToSync.
- EXPECT_FALSE(session_->HasMoreToSync());
}
TEST_F(SyncSessionTest, MoreToDownloadIfGotNoChangesRemaining) {
@@ -245,29 +215,6 @@ TEST_F(SyncSessionTest, MoreToDownloadIfGotNoChangesRemaining) {
->set_changes_remaining(0);
EXPECT_TRUE(status()->ServerSaysNothingMoreToDownload());
EXPECT_TRUE(status()->download_updates_succeeded());
-
- // Download updates has its own loop in the syncer; it shouldn't factor
- // into HasMoreToSync.
- EXPECT_FALSE(session_->HasMoreToSync());
-}
-
-TEST_F(SyncSessionTest, MoreToSyncIfConflictsResolved) {
- // Conflict resolution happens after get updates and commit,
- // so we need to loop back and get updates / commit again now
- // that we have made forward progress.
- status()->update_conflicts_resolved(true);
- EXPECT_TRUE(session_->HasMoreToSync());
-}
-
-TEST_F(SyncSessionTest, ResetTransientState) {
- status()->update_conflicts_resolved(true);
- status()->increment_num_successful_commits();
- EXPECT_TRUE(session_->HasMoreToSync());
- session_->PrepareForAnotherSyncCycle();
- EXPECT_EQ(sync_pb::GetUpdatesCallerInfo::SYNC_CYCLE_CONTINUATION,
- session_->source().updates_source);
- EXPECT_FALSE(status()->conflicts_resolved());
- EXPECT_FALSE(session_->HasMoreToSync());
}
TEST_F(SyncSessionTest, Coalesce) {
« no previous file with comments | « sync/sessions/sync_session.cc ('k') | sync/sessions/test_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698