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 27 matching lines...) Expand all Loading... |
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(OnReceivedClientInvalidationHintBufferSize, void(int)); |
47 MOCK_METHOD1(OnSyncProtocolError, void(const sessions::SyncSessionSnapshot&)); | 47 MOCK_METHOD1(OnSyncProtocolError, void(const sessions::SyncSessionSnapshot&)); |
48 MOCK_METHOD0(OnShouldStopSyncingPermanently, void()); | |
49 MOCK_METHOD1(OnSilencedUntil, void(const base::TimeTicks&)); | 48 MOCK_METHOD1(OnSilencedUntil, void(const base::TimeTicks&)); |
50 }; | 49 }; |
51 | 50 |
52 // Builds a ClientToServerResponse with some data type ids, including | 51 // Builds a ClientToServerResponse with some data type ids, including |
53 // invalid ones. GetTypesToMigrate() should return only the valid | 52 // invalid ones. GetTypesToMigrate() should return only the valid |
54 // model types. | 53 // model types. |
55 TEST(SyncerProtoUtil, GetTypesToMigrate) { | 54 TEST(SyncerProtoUtil, GetTypesToMigrate) { |
56 sync_pb::ClientToServerResponse response; | 55 sync_pb::ClientToServerResponse response; |
57 response.add_migrated_data_type_id( | 56 response.add_migrated_data_type_id( |
58 GetSpecificsFieldNumberFromModelType(BOOKMARKS)); | 57 GetSpecificsFieldNumberFromModelType(BOOKMARKS)); |
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
306 dcm.set_send_error(false); | 305 dcm.set_send_error(false); |
307 EXPECT_TRUE(SyncerProtoUtil::PostAndProcessHeaders(&dcm, NULL, | 306 EXPECT_TRUE(SyncerProtoUtil::PostAndProcessHeaders(&dcm, NULL, |
308 msg, &response)); | 307 msg, &response)); |
309 | 308 |
310 dcm.set_access_denied(true); | 309 dcm.set_access_denied(true); |
311 EXPECT_FALSE(SyncerProtoUtil::PostAndProcessHeaders(&dcm, NULL, | 310 EXPECT_FALSE(SyncerProtoUtil::PostAndProcessHeaders(&dcm, NULL, |
312 msg, &response)); | 311 msg, &response)); |
313 } | 312 } |
314 | 313 |
315 } // namespace syncer | 314 } // namespace syncer |
OLD | NEW |