Commit a362e159 authored by tim@chromium.org's avatar tim@chromium.org

sync: fix a couple less-than comparisons to be less-than-eq in tests.

TBR=akalin

BUG=26339
TEST=SyncerThread2Test

Review URL: http://codereview.chromium.org/6267015

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@72691 0039d316-1c4b-4281-b951-d872f2087c98
parent 39cf828f
...@@ -88,7 +88,7 @@ class SyncerThread2Test : public testing::Test { ...@@ -88,7 +88,7 @@ class SyncerThread2Test : public testing::Test {
SCOPED_TRACE(testing::Message() << "SyncShare # (" << i << ")"); SCOPED_TRACE(testing::Message() << "SyncShare # (" << i << ")");
TimeTicks optimal_next_sync = optimal_start + poll_interval * i; TimeTicks optimal_next_sync = optimal_start + poll_interval * i;
EXPECT_GE(data[i], optimal_next_sync); EXPECT_GE(data[i], optimal_next_sync);
EXPECT_LT(data[i], optimal_next_sync + poll_interval); EXPECT_LE(data[i], optimal_next_sync + poll_interval);
EXPECT_EQ(GetUpdatesCallerInfo::PERIODIC, EXPECT_EQ(GetUpdatesCallerInfo::PERIODIC,
records.snapshots[i]->source.first); records.snapshots[i]->source.first);
} }
...@@ -502,6 +502,7 @@ TEST_F(SyncerThread2Test, BackoffRelief) { ...@@ -502,6 +502,7 @@ TEST_F(SyncerThread2Test, BackoffRelief) {
TimeTicks optimal_start = TimeTicks::Now() + poll + backoff; TimeTicks optimal_start = TimeTicks::Now() + poll + backoff;
syncer_thread()->Start(SyncerThread::NORMAL_MODE); syncer_thread()->Start(SyncerThread::NORMAL_MODE);
done.TimedWait(timeout()); done.TimedWait(timeout());
syncer_thread()->Stop();
// Check for healthy polling after backoff is relieved. // Check for healthy polling after backoff is relieved.
// Can't use AnalyzePollRun because first sync is a continuation. Bleh. // Can't use AnalyzePollRun because first sync is a continuation. Bleh.
...@@ -509,7 +510,7 @@ TEST_F(SyncerThread2Test, BackoffRelief) { ...@@ -509,7 +510,7 @@ TEST_F(SyncerThread2Test, BackoffRelief) {
SCOPED_TRACE(testing::Message() << "SyncShare # (" << i << ")"); SCOPED_TRACE(testing::Message() << "SyncShare # (" << i << ")");
TimeTicks optimal_next_sync = optimal_start + poll * i; TimeTicks optimal_next_sync = optimal_start + poll * i;
EXPECT_GE(r.times[i], optimal_next_sync); EXPECT_GE(r.times[i], optimal_next_sync);
EXPECT_LT(r.times[i], optimal_next_sync + poll); EXPECT_LE(r.times[i], optimal_next_sync + poll);
EXPECT_EQ(i == 0 ? GetUpdatesCallerInfo::SYNC_CYCLE_CONTINUATION EXPECT_EQ(i == 0 ? GetUpdatesCallerInfo::SYNC_CYCLE_CONTINUATION
: GetUpdatesCallerInfo::PERIODIC, : GetUpdatesCallerInfo::PERIODIC,
r.snapshots[i]->source.first); r.snapshots[i]->source.first);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment