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 "base/bind.h" | 5 #include "base/bind.h" |
6 #include "base/callback.h" | 6 #include "base/callback.h" |
7 #include "base/compiler_specific.h" | 7 #include "base/compiler_specific.h" |
8 #include "base/memory/weak_ptr.h" | 8 #include "base/memory/weak_ptr.h" |
9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
10 #include "base/test/test_timeouts.h" | 10 #include "base/test/test_timeouts.h" |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 << ModelTypeSetToString(rhs_set); | 100 << ModelTypeSetToString(rhs_set); |
101 } else { | 101 } else { |
102 return testing::AssertionSuccess(); | 102 return testing::AssertionSuccess(); |
103 } | 103 } |
104 } | 104 } |
105 | 105 |
106 // Convenient to use in tests wishing to analyze SyncShare calls over time. | 106 // Convenient to use in tests wishing to analyze SyncShare calls over time. |
107 static const size_t kMinNumSamples = 5; | 107 static const size_t kMinNumSamples = 5; |
108 class SyncSchedulerTest : public testing::Test { | 108 class SyncSchedulerTest : public testing::Test { |
109 public: | 109 public: |
110 SyncSchedulerTest() | 110 SyncSchedulerTest() : weak_ptr_factory_(this), syncer_(NULL), delay_(NULL) {} |
111 : weak_ptr_factory_(this), | |
112 context_(NULL), | |
113 syncer_(NULL), | |
114 delay_(NULL) {} | |
115 | 111 |
116 class MockDelayProvider : public BackoffDelayProvider { | 112 class MockDelayProvider : public BackoffDelayProvider { |
117 public: | 113 public: |
118 MockDelayProvider() : BackoffDelayProvider( | 114 MockDelayProvider() : BackoffDelayProvider( |
119 TimeDelta::FromSeconds(kInitialBackoffRetrySeconds), | 115 TimeDelta::FromSeconds(kInitialBackoffRetrySeconds), |
120 TimeDelta::FromSeconds(kInitialBackoffImmediateRetrySeconds)) { | 116 TimeDelta::FromSeconds(kInitialBackoffImmediateRetrySeconds)) { |
121 } | 117 } |
122 | 118 |
123 MOCK_METHOD1(GetDelay, TimeDelta(const TimeDelta&)); | 119 MOCK_METHOD1(GetDelay, TimeDelta(const TimeDelta&)); |
124 }; | 120 }; |
(...skipping 1191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1316 base::Bind(&CallbackCounter::Callback, base::Unretained(&counter))); | 1312 base::Bind(&CallbackCounter::Callback, base::Unretained(&counter))); |
1317 scheduler()->ScheduleConfiguration(params); | 1313 scheduler()->ScheduleConfiguration(params); |
1318 | 1314 |
1319 scheduler()->OnConnectionStatusChange(); | 1315 scheduler()->OnConnectionStatusChange(); |
1320 scheduler()->OnConnectionStatusChange(); | 1316 scheduler()->OnConnectionStatusChange(); |
1321 | 1317 |
1322 PumpLoop(); // Run the nudge, that will fail and schedule a quick retry. | 1318 PumpLoop(); // Run the nudge, that will fail and schedule a quick retry. |
1323 } | 1319 } |
1324 | 1320 |
1325 } // namespace syncer | 1321 } // namespace syncer |
OLD | NEW |