summaryrefslogtreecommitdiffstats
path: root/sync/sessions/test_util.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sync/sessions/test_util.cc')
-rw-r--r--sync/sessions/test_util.cc18
1 files changed, 10 insertions, 8 deletions
diff --git a/sync/sessions/test_util.cc b/sync/sessions/test_util.cc
index 03f6de2..24caa7b 100644
--- a/sync/sessions/test_util.cc
+++ b/sync/sessions/test_util.cc
@@ -4,8 +4,6 @@
#include "sync/sessions/test_util.h"
-#include "sync/engine/throttled_data_type_tracker.h"
-
namespace syncer {
namespace sessions {
namespace test_util {
@@ -42,14 +40,19 @@ void SimulateConnectionFailure(sessions::SyncSession* session,
void SimulateSuccess(sessions::SyncSession* session,
SyncerStep begin, SyncerStep end) {
+ const sync_pb::GetUpdatesCallerInfo::GetUpdatesSource source =
+ session->source().updates_source;
ASSERT_EQ(0U, session->status_controller().num_server_changes_remaining());
switch(end) {
case SYNCER_END:
session->mutable_status_controller()->set_commit_result(SYNCER_OK);
- // Fall through.
+ session->mutable_status_controller()->set_last_get_key_result(SYNCER_OK);
+ session->mutable_status_controller()->set_last_download_updates_result(
+ SYNCER_OK);
+ break;
case APPLY_UPDATES:
- DCHECK_EQ(end == APPLY_UPDATES, session->source().updates_source ==
- sync_pb::GetUpdatesCallerInfo::RECONFIGURATION);
+ DCHECK(source == sync_pb::GetUpdatesCallerInfo::RECONFIGURATION
+ || source == sync_pb::GetUpdatesCallerInfo::PERIODIC);
session->mutable_status_controller()->set_last_get_key_result(SYNCER_OK);
session->mutable_status_controller()->set_last_download_updates_result(
SYNCER_OK);
@@ -63,7 +66,7 @@ void SimulateThrottledImpl(sessions::SyncSession* session,
const base::TimeDelta& delta) {
session->mutable_status_controller()->set_last_download_updates_result(
SERVER_RETURN_THROTTLED);
- session->delegate()->OnSilencedUntil(base::TimeTicks::Now() + delta);
+ session->delegate()->OnThrottled(delta);
}
void SimulateTypesThrottledImpl(
@@ -72,8 +75,7 @@ void SimulateTypesThrottledImpl(
const base::TimeDelta& delta) {
session->mutable_status_controller()->set_last_download_updates_result(
SERVER_RETURN_THROTTLED);
- session->context()->throttled_data_type_tracker()->
- SetUnthrottleTime(types, base::TimeTicks::Now() + delta);
+ session->delegate()->OnTypesThrottled(types, delta);
}
void SimulatePollIntervalUpdateImpl(sessions::SyncSession* session,