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

Side by Side Diff: sync/engine/build_commit_command_unittest.cc

Issue 10038041: sync: Loop committing items without downloading updates (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 8 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
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/engine/build_commit_command.h" 5 #include "sync/engine/build_commit_command.h"
6 #include "sync/test/engine/syncer_command_test.h" 6 #include "sync/test/engine/syncer_command_test.h"
7 7
8 namespace browser_sync { 8 namespace browser_sync {
9 9
10 // A test fixture for tests exercising ClearDataCommandTest. 10 // A test fixture for tests exercising ClearDataCommandTest.
11 class BuildCommitCommandTest : public SyncerCommandTest { 11 class BuildCommitCommandTest : public SyncerCommandTest {
12 protected: 12 protected:
13 BuildCommitCommandTest() {} 13 BuildCommitCommandTest()
14 : batch_commit_set_(ModelSafeRoutingInfo()),
15 command_(batch_commit_set_, &commit_message_) {
16 }
17
18 private:
19 sessions::OrderedCommitSet batch_commit_set_;
20 ClientToServerMessage commit_message_;
21
22 protected:
14 BuildCommitCommand command_; 23 BuildCommitCommand command_;
15 24
16 private: 25 private:
17 DISALLOW_COPY_AND_ASSIGN(BuildCommitCommandTest); 26 DISALLOW_COPY_AND_ASSIGN(BuildCommitCommandTest);
18 }; 27 };
19 28
20 TEST_F(BuildCommitCommandTest, InterpolatePosition) { 29 TEST_F(BuildCommitCommandTest, InterpolatePosition) {
21 EXPECT_LT(BuildCommitCommand::GetFirstPosition(), 30 EXPECT_LT(BuildCommitCommand::GetFirstPosition(),
22 BuildCommitCommand::GetLastPosition()); 31 BuildCommitCommand::GetLastPosition());
23 32
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 command_.InterpolatePosition(0, BuildCommitCommand::GetGap())); 98 command_.InterpolatePosition(0, BuildCommitCommand::GetGap()));
90 EXPECT_EQ(BuildCommitCommand::GetGap() / 4, 99 EXPECT_EQ(BuildCommitCommand::GetGap() / 4,
91 command_.InterpolatePosition(0, BuildCommitCommand::GetGap()*2)); 100 command_.InterpolatePosition(0, BuildCommitCommand::GetGap()*2));
92 EXPECT_EQ(BuildCommitCommand::GetGap(), 101 EXPECT_EQ(BuildCommitCommand::GetGap(),
93 command_.InterpolatePosition(0, BuildCommitCommand::GetGap()*2 + 1)); 102 command_.InterpolatePosition(0, BuildCommitCommand::GetGap()*2 + 1));
94 } 103 }
95 104
96 } // namespace browser_sync 105 } // namespace browser_sync
97 106
98 107
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698