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

Side by Side Diff: sync/sessions/ordered_commit_set_unittest.cc

Issue 10210009: sync: Loop committing items without downloading updates (v2) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 8 years, 7 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 | « sync/sessions/ordered_commit_set.cc ('k') | sync/sessions/session_state.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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "sync/sessions/ordered_commit_set.h" 5 #include "sync/sessions/ordered_commit_set.h"
6 #include "sync/test/engine/test_id_factory.h" 6 #include "sync/test/engine/test_id_factory.h"
7 #include "testing/gtest/include/gtest/gtest.h" 7 #include "testing/gtest/include/gtest/gtest.h"
8 8
9 using std::vector; 9 using std::vector;
10 10
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 commit_set.AddCommitItem(3, ids_.NewLocalId(), syncable::PREFERENCES); 108 commit_set.AddCommitItem(3, ids_.NewLocalId(), syncable::PREFERENCES);
109 EXPECT_FALSE(commit_set.HasBookmarkCommitId()); 109 EXPECT_FALSE(commit_set.HasBookmarkCommitId());
110 110
111 commit_set.AddCommitItem(4, ids_.NewLocalId(), syncable::BOOKMARKS); 111 commit_set.AddCommitItem(4, ids_.NewLocalId(), syncable::BOOKMARKS);
112 EXPECT_TRUE(commit_set.HasBookmarkCommitId()); 112 EXPECT_TRUE(commit_set.HasBookmarkCommitId());
113 113
114 commit_set.Truncate(4); 114 commit_set.Truncate(4);
115 EXPECT_FALSE(commit_set.HasBookmarkCommitId()); 115 EXPECT_FALSE(commit_set.HasBookmarkCommitId());
116 } 116 }
117 117
118 TEST_F(OrderedCommitSetTest, AddAndRemoveEntries) {
119 OrderedCommitSet commit_set(routes_);
120
121 ASSERT_TRUE(commit_set.Empty());
122
123 commit_set.AddCommitItem(0, ids_.NewLocalId(), syncable::AUTOFILL);
124 ASSERT_EQ(static_cast<size_t>(1), commit_set.Size());
125
126 commit_set.Clear();
127 ASSERT_TRUE(commit_set.Empty());
128 }
129
118 } // namespace sessions 130 } // namespace sessions
119 } // namespace browser_sync 131 } // namespace browser_sync
120 132
OLDNEW
« no previous file with comments | « sync/sessions/ordered_commit_set.cc ('k') | sync/sessions/session_state.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698