Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(7)

Side by Side Diff: sync/engine/sync_scheduler_unittest.cc

Issue 16654009: Rewrite scoped_ptr<T>(NULL) to use the default ctor in sync/. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | sync/syncable/directory_backing_store.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | sync/syncable/directory_backing_store.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698