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