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> |
| 6 #include <stdint.h> |
| 7 |
5 #include "base/bind.h" | 8 #include "base/bind.h" |
6 #include "base/callback.h" | 9 #include "base/callback.h" |
7 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
8 #include "base/memory/weak_ptr.h" | 11 #include "base/memory/weak_ptr.h" |
9 #include "base/run_loop.h" | 12 #include "base/run_loop.h" |
10 #include "base/test/test_timeouts.h" | 13 #include "base/test/test_timeouts.h" |
11 #include "sync/engine/backoff_delay_provider.h" | 14 #include "sync/engine/backoff_delay_provider.h" |
12 #include "sync/engine/sync_scheduler_impl.h" | 15 #include "sync/engine/sync_scheduler_impl.h" |
13 #include "sync/engine/syncer.h" | 16 #include "sync/engine/syncer.h" |
14 #include "sync/internal_api/public/base/cancelation_signal.h" | 17 #include "sync/internal_api/public/base/cancelation_signal.h" |
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
231 ModelTypeSet GetThrottledTypes() { | 234 ModelTypeSet GetThrottledTypes() { |
232 return scheduler_->nudge_tracker_.GetThrottledTypes(); | 235 return scheduler_->nudge_tracker_.GetThrottledTypes(); |
233 } | 236 } |
234 | 237 |
235 base::TimeDelta GetRetryTimerDelay() { | 238 base::TimeDelta GetRetryTimerDelay() { |
236 EXPECT_TRUE(scheduler_->retry_timer_.IsRunning()); | 239 EXPECT_TRUE(scheduler_->retry_timer_.IsRunning()); |
237 return scheduler_->retry_timer_.GetCurrentDelay(); | 240 return scheduler_->retry_timer_.GetCurrentDelay(); |
238 } | 241 } |
239 | 242 |
240 static scoped_ptr<InvalidationInterface> BuildInvalidation( | 243 static scoped_ptr<InvalidationInterface> BuildInvalidation( |
241 int64 version, | 244 int64_t version, |
242 const std::string& payload) { | 245 const std::string& payload) { |
243 return MockInvalidation::Build(version, payload); | 246 return MockInvalidation::Build(version, payload); |
244 } | 247 } |
245 | 248 |
246 private: | 249 private: |
247 syncable::Directory* directory() { | 250 syncable::Directory* directory() { |
248 return dir_maker_.directory(); | 251 return dir_maker_.directory(); |
249 } | 252 } |
250 | 253 |
251 base::MessageLoop loop_; | 254 base::MessageLoop loop_; |
(...skipping 1212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1464 ASSERT_TRUE(scheduler()->IsBackingOff()); | 1467 ASSERT_TRUE(scheduler()->IsBackingOff()); |
1465 | 1468 |
1466 // Now succeed. | 1469 // Now succeed. |
1467 connection()->SetServerReachable(); | 1470 connection()->SetServerReachable(); |
1468 PumpLoopFor(2 * delta); | 1471 PumpLoopFor(2 * delta); |
1469 ASSERT_EQ(1, success_counter.times_called()); | 1472 ASSERT_EQ(1, success_counter.times_called()); |
1470 ASSERT_FALSE(scheduler()->IsBackingOff()); | 1473 ASSERT_FALSE(scheduler()->IsBackingOff()); |
1471 } | 1474 } |
1472 | 1475 |
1473 } // namespace syncer | 1476 } // namespace syncer |
OLD | NEW |