| 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" |
| 11 #include "base/message_loop.h" | 11 #include "base/message_loop.h" |
| 12 #include "base/time.h" | 12 #include "base/time.h" |
| 13 #include "sync/engine/syncproto.h" | 13 #include "sync/engine/syncproto.h" |
| 14 #include "sync/engine/throttled_data_type_tracker.h" | 14 #include "sync/engine/throttled_data_type_tracker.h" |
| 15 #include "sync/internal_api/public/syncable/model_type_test_util.h" | 15 #include "sync/internal_api/public/syncable/model_type_test_util.h" |
| 16 #include "sync/protocol/bookmark_specifics.pb.h" | 16 #include "sync/protocol/bookmark_specifics.pb.h" |
| 17 #include "sync/protocol/password_specifics.pb.h" | 17 #include "sync/protocol/password_specifics.pb.h" |
| 18 #include "sync/protocol/sync.pb.h" | 18 #include "sync/protocol/sync.pb.h" |
| 19 #include "sync/protocol/sync_enums.pb.h" | 19 #include "sync/protocol/sync_enums.pb.h" |
| 20 #include "sync/sessions/session_state.h" | 20 #include "sync/sessions/session_state.h" |
| 21 #include "sync/sessions/sync_session_context.h" | 21 #include "sync/sessions/sync_session_context.h" |
| 22 #include "sync/syncable/blob.h" | 22 #include "sync/syncable/blob.h" |
| 23 #include "sync/syncable/directory.h" | 23 #include "sync/syncable/directory.h" |
| 24 #include "sync/test/engine/mock_connection_manager.h" | 24 #include "sync/test/engine/mock_connection_manager.h" |
| 25 #include "sync/test/engine/test_directory_setter_upper.h" | 25 #include "sync/test/engine/test_directory_setter_upper.h" |
| 26 #include "testing/gtest/include/gtest/gtest.h" | 26 #include "testing/gtest/include/gtest/gtest.h" |
| 27 | 27 |
| 28 using syncable::Blob; | |
| 29 using ::testing::_; | 28 using ::testing::_; |
| 30 | 29 |
| 31 namespace syncer { | 30 namespace syncer { |
| 31 |
| 32 using sessions::SyncSessionContext; | 32 using sessions::SyncSessionContext; |
| 33 using syncable::Blob; |
| 33 | 34 |
| 34 class MockDelegate : public sessions::SyncSession::Delegate { | 35 class MockDelegate : public sessions::SyncSession::Delegate { |
| 35 public: | 36 public: |
| 36 MockDelegate() {} | 37 MockDelegate() {} |
| 37 ~MockDelegate() {} | 38 ~MockDelegate() {} |
| 38 | 39 |
| 39 MOCK_METHOD0(IsSyncingCurrentlySilenced, bool()); | 40 MOCK_METHOD0(IsSyncingCurrentlySilenced, bool()); |
| 40 MOCK_METHOD1(OnReceivedShortPollIntervalUpdate, void(const base::TimeDelta&)); | 41 MOCK_METHOD1(OnReceivedShortPollIntervalUpdate, void(const base::TimeDelta&)); |
| 41 MOCK_METHOD1(OnReceivedLongPollIntervalUpdate ,void(const base::TimeDelta&)); | 42 MOCK_METHOD1(OnReceivedLongPollIntervalUpdate ,void(const base::TimeDelta&)); |
| 42 MOCK_METHOD1(OnReceivedSessionsCommitDelay, void(const base::TimeDelta&)); | 43 MOCK_METHOD1(OnReceivedSessionsCommitDelay, void(const base::TimeDelta&)); |
| (...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 281 error.error_type = syncer::THROTTLED; | 282 error.error_type = syncer::THROTTLED; |
| 282 | 283 |
| 283 base::TimeTicks ticks = base::TimeTicks::FromInternalValue(1); | 284 base::TimeTicks ticks = base::TimeTicks::FromInternalValue(1); |
| 284 | 285 |
| 285 EXPECT_CALL(delegate, OnSilencedUntil(ticks)); | 286 EXPECT_CALL(delegate, OnSilencedUntil(ticks)); |
| 286 | 287 |
| 287 SyncerProtoUtil::HandleThrottleError(error, ticks, &tracker, &delegate); | 288 SyncerProtoUtil::HandleThrottleError(error, ticks, &tracker, &delegate); |
| 288 EXPECT_TRUE(tracker.GetThrottledTypes().Empty()); | 289 EXPECT_TRUE(tracker.GetThrottledTypes().Empty()); |
| 289 } | 290 } |
| 290 } // namespace syncer | 291 } // namespace syncer |
| OLD | NEW |