| OLD | NEW | 
|---|
| 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/syncer_proto_util.h" | 5 #include "sync/engine/syncer_proto_util.h" | 
| 6 | 6 | 
| 7 #include <string> | 7 #include <string> | 
| 8 | 8 | 
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" | 
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" | 
| (...skipping 25 matching lines...) Expand all  Loading... | 
| 36 | 36 | 
| 37 class MockDelegate : public sessions::SyncSession::Delegate { | 37 class MockDelegate : public sessions::SyncSession::Delegate { | 
| 38  public: | 38  public: | 
| 39    MockDelegate() {} | 39    MockDelegate() {} | 
| 40    ~MockDelegate() {} | 40    ~MockDelegate() {} | 
| 41 | 41 | 
| 42   MOCK_METHOD0(IsSyncingCurrentlySilenced, bool()); | 42   MOCK_METHOD0(IsSyncingCurrentlySilenced, bool()); | 
| 43   MOCK_METHOD1(OnReceivedShortPollIntervalUpdate, void(const base::TimeDelta&)); | 43   MOCK_METHOD1(OnReceivedShortPollIntervalUpdate, void(const base::TimeDelta&)); | 
| 44   MOCK_METHOD1(OnReceivedLongPollIntervalUpdate ,void(const base::TimeDelta&)); | 44   MOCK_METHOD1(OnReceivedLongPollIntervalUpdate ,void(const base::TimeDelta&)); | 
| 45   MOCK_METHOD1(OnReceivedSessionsCommitDelay, void(const base::TimeDelta&)); | 45   MOCK_METHOD1(OnReceivedSessionsCommitDelay, void(const base::TimeDelta&)); | 
|  | 46   MOCK_METHOD1(OnReceivedClientInvalidationHintBufferSize, void(int)); | 
| 46   MOCK_METHOD1(OnSyncProtocolError, void(const sessions::SyncSessionSnapshot&)); | 47   MOCK_METHOD1(OnSyncProtocolError, void(const sessions::SyncSessionSnapshot&)); | 
| 47   MOCK_METHOD0(OnShouldStopSyncingPermanently, void()); | 48   MOCK_METHOD0(OnShouldStopSyncingPermanently, void()); | 
| 48   MOCK_METHOD1(OnSilencedUntil, void(const base::TimeTicks&)); | 49   MOCK_METHOD1(OnSilencedUntil, void(const base::TimeTicks&)); | 
| 49 }; | 50 }; | 
| 50 | 51 | 
| 51 // Builds a ClientToServerResponse with some data type ids, including | 52 // Builds a ClientToServerResponse with some data type ids, including | 
| 52 // invalid ones.  GetTypesToMigrate() should return only the valid | 53 // invalid ones.  GetTypesToMigrate() should return only the valid | 
| 53 // model types. | 54 // model types. | 
| 54 TEST(SyncerProtoUtil, GetTypesToMigrate) { | 55 TEST(SyncerProtoUtil, GetTypesToMigrate) { | 
| 55   sync_pb::ClientToServerResponse response; | 56   sync_pb::ClientToServerResponse response; | 
| (...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 318 | 319 | 
| 319   base::TimeTicks ticks = base::TimeTicks::FromInternalValue(1); | 320   base::TimeTicks ticks = base::TimeTicks::FromInternalValue(1); | 
| 320 | 321 | 
| 321   EXPECT_CALL(delegate, OnSilencedUntil(ticks)); | 322   EXPECT_CALL(delegate, OnSilencedUntil(ticks)); | 
| 322 | 323 | 
| 323   SyncerProtoUtil::HandleThrottleError(error, ticks, &tracker, &delegate); | 324   SyncerProtoUtil::HandleThrottleError(error, ticks, &tracker, &delegate); | 
| 324   EXPECT_TRUE(tracker.GetThrottledTypes().Empty()); | 325   EXPECT_TRUE(tracker.GetThrottledTypes().Empty()); | 
| 325 } | 326 } | 
| 326 | 327 | 
| 327 }  // namespace syncer | 328 }  // namespace syncer | 
| OLD | NEW | 
|---|