| Index: sync/engine/syncer_proto_util_unittest.cc
|
| diff --git a/sync/engine/syncer_proto_util_unittest.cc b/sync/engine/syncer_proto_util_unittest.cc
|
| index d70a07b1dc82d8dd42ec82ee1c66fc50b05473a2..d673116b448c9d30e2b9f7ad7684664e7ea856cf 100644
|
| --- a/sync/engine/syncer_proto_util_unittest.cc
|
| +++ b/sync/engine/syncer_proto_util_unittest.cc
|
| @@ -10,6 +10,7 @@
|
| #include "base/compiler_specific.h"
|
| #include "base/message_loop.h"
|
| #include "base/time.h"
|
| +#include "sync/engine/throttled_data_type_tracker.h"
|
| #include "sync/engine/syncproto.h"
|
| #include "sync/sessions/session_state.h"
|
| #include "sync/sessions/sync_session_context.h"
|
| @@ -31,14 +32,6 @@ using ::testing::_;
|
| namespace browser_sync {
|
| using sessions::SyncSessionContext;
|
|
|
| -class MockSyncSessionContext : public SyncSessionContext {
|
| - public:
|
| - MockSyncSessionContext() {}
|
| - ~MockSyncSessionContext() {}
|
| - MOCK_METHOD2(SetUnthrottleTime, void(syncable::ModelTypeSet,
|
| - const base::TimeTicks&));
|
| -};
|
| -
|
| class MockDelegate : public sessions::SyncSession::Delegate {
|
| public:
|
| MockDelegate() {}
|
| @@ -269,7 +262,7 @@ TEST_F(SyncerProtoUtilTest, PostAndProcessHeaders) {
|
| }
|
|
|
| TEST_F(SyncerProtoUtilTest, HandleThrottlingWithDatatypes) {
|
| - MockSyncSessionContext context;
|
| + ThrottledDataTypeTracker tdtt;
|
| SyncProtocolError error;
|
| error.error_type = browser_sync::THROTTLED;
|
| syncable::ModelTypeSet types;
|
| @@ -277,11 +270,9 @@ TEST_F(SyncerProtoUtilTest, HandleThrottlingWithDatatypes) {
|
| types.Put(syncable::PASSWORDS);
|
| error.error_data_types = types;
|
|
|
| - base::TimeTicks ticks = base::TimeTicks::Now();
|
| -
|
| - EXPECT_CALL(context, SetUnthrottleTime(HasModelTypes(types), ticks));
|
| -
|
| - SyncerProtoUtil::HandleThrottleError(error, ticks, &context, NULL);
|
| + base::TimeTicks ticks = base::TimeTicks::FromInternalValue(1);
|
| + SyncerProtoUtil::HandleThrottleError(error, ticks, &tdtt, NULL);
|
| + EXPECT_TRUE(tdtt.GetThrottledTypes().Equals(types));
|
| }
|
|
|
| TEST_F(SyncerProtoUtilTest, HandleThrottlingNoDatatypes) {
|
| @@ -289,7 +280,7 @@ TEST_F(SyncerProtoUtilTest, HandleThrottlingNoDatatypes) {
|
| SyncProtocolError error;
|
| error.error_type = browser_sync::THROTTLED;
|
|
|
| - base::TimeTicks ticks = base::TimeTicks::Now();
|
| + base::TimeTicks ticks = base::TimeTicks::FromInternalValue(1);
|
|
|
| EXPECT_CALL(delegate, OnSilencedUntil(ticks));
|
|
|
|
|