| 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 <stddef.h> | 5 #include <stddef.h> |
| 6 #include <stdint.h> | 6 #include <stdint.h> |
| 7 | 7 |
| 8 #include "base/bind.h" | 8 #include "base/bind.h" |
| 9 #include "base/callback.h" | 9 #include "base/callback.h" |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| (...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 233 | 233 |
| 234 ModelTypeSet GetThrottledTypes() { | 234 ModelTypeSet GetThrottledTypes() { |
| 235 return scheduler_->nudge_tracker_.GetThrottledTypes(); | 235 return scheduler_->nudge_tracker_.GetThrottledTypes(); |
| 236 } | 236 } |
| 237 | 237 |
| 238 base::TimeDelta GetRetryTimerDelay() { | 238 base::TimeDelta GetRetryTimerDelay() { |
| 239 EXPECT_TRUE(scheduler_->retry_timer_.IsRunning()); | 239 EXPECT_TRUE(scheduler_->retry_timer_.IsRunning()); |
| 240 return scheduler_->retry_timer_.GetCurrentDelay(); | 240 return scheduler_->retry_timer_.GetCurrentDelay(); |
| 241 } | 241 } |
| 242 | 242 |
| 243 static scoped_ptr<InvalidationInterface> BuildInvalidation( | 243 static std::unique_ptr<InvalidationInterface> BuildInvalidation( |
| 244 int64_t version, | 244 int64_t version, |
| 245 const std::string& payload) { | 245 const std::string& payload) { |
| 246 return MockInvalidation::Build(version, payload); | 246 return MockInvalidation::Build(version, payload); |
| 247 } | 247 } |
| 248 | 248 |
| 249 private: | 249 private: |
| 250 syncable::Directory* directory() { | 250 syncable::Directory* directory() { |
| 251 return dir_maker_.directory(); | 251 return dir_maker_.directory(); |
| 252 } | 252 } |
| 253 | 253 |
| 254 base::MessageLoop loop_; | 254 base::MessageLoop loop_; |
| 255 TestDirectorySetterUpper dir_maker_; | 255 TestDirectorySetterUpper dir_maker_; |
| 256 CancelationSignal cancelation_signal_; | 256 CancelationSignal cancelation_signal_; |
| 257 scoped_ptr<MockConnectionManager> connection_; | 257 std::unique_ptr<MockConnectionManager> connection_; |
| 258 scoped_ptr<ModelTypeRegistry> model_type_registry_; | 258 std::unique_ptr<ModelTypeRegistry> model_type_registry_; |
| 259 scoped_ptr<SyncSessionContext> context_; | 259 std::unique_ptr<SyncSessionContext> context_; |
| 260 scoped_ptr<SyncSchedulerImpl> scheduler_; | 260 std::unique_ptr<SyncSchedulerImpl> scheduler_; |
| 261 MockNudgeHandler mock_nudge_handler_; | 261 MockNudgeHandler mock_nudge_handler_; |
| 262 MockSyncer* syncer_; | 262 MockSyncer* syncer_; |
| 263 MockDelayProvider* delay_; | 263 MockDelayProvider* delay_; |
| 264 std::vector<scoped_refptr<ModelSafeWorker> > workers_; | 264 std::vector<scoped_refptr<ModelSafeWorker> > workers_; |
| 265 scoped_refptr<ExtensionsActivity> extensions_activity_; | 265 scoped_refptr<ExtensionsActivity> extensions_activity_; |
| 266 ModelSafeRoutingInfo routing_info_; | 266 ModelSafeRoutingInfo routing_info_; |
| 267 base::WeakPtrFactory<SyncSchedulerTest> weak_ptr_factory_; | 267 base::WeakPtrFactory<SyncSchedulerTest> weak_ptr_factory_; |
| 268 }; | 268 }; |
| 269 | 269 |
| 270 void RecordSyncShareImpl(SyncShareTimes* times) { | 270 void RecordSyncShareImpl(SyncShareTimes* times) { |
| (...skipping 1196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1467 ASSERT_TRUE(scheduler()->IsBackingOff()); | 1467 ASSERT_TRUE(scheduler()->IsBackingOff()); |
| 1468 | 1468 |
| 1469 // Now succeed. | 1469 // Now succeed. |
| 1470 connection()->SetServerReachable(); | 1470 connection()->SetServerReachable(); |
| 1471 PumpLoopFor(2 * delta); | 1471 PumpLoopFor(2 * delta); |
| 1472 ASSERT_EQ(1, success_counter.times_called()); | 1472 ASSERT_EQ(1, success_counter.times_called()); |
| 1473 ASSERT_FALSE(scheduler()->IsBackingOff()); | 1473 ASSERT_FALSE(scheduler()->IsBackingOff()); |
| 1474 } | 1474 } |
| 1475 | 1475 |
| 1476 } // namespace syncer | 1476 } // namespace syncer |
| OLD | NEW |