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

Side by Side Diff: chrome/browser/net/dns_probe_service_unittest.cc

Issue 16703018: Rewrite scoped_ptr<T>(NULL) to use the default ctor in chrome/. (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
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 "chrome/browser/net/dns_probe_service.h" 5 #include "chrome/browser/net/dns_probe_service.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/compiler_specific.h" 8 #include "base/compiler_specific.h"
9 #include "base/memory/weak_ptr.h" 9 #include "base/memory/weak_ptr.h"
10 #include "base/message_loop.h" 10 #include "base/message_loop.h"
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 81
82 bool system_job_created_; 82 bool system_job_created_;
83 bool public_job_created_; 83 bool public_job_created_;
84 84
85 private: 85 private:
86 // Override methods in DnsProbeService to return mock jobs: 86 // Override methods in DnsProbeService to return mock jobs:
87 87
88 virtual scoped_ptr<DnsProbeJob> CreateSystemProbeJob( 88 virtual scoped_ptr<DnsProbeJob> CreateSystemProbeJob(
89 const DnsProbeJob::CallbackType& job_callback) OVERRIDE { 89 const DnsProbeJob::CallbackType& job_callback) OVERRIDE {
90 if (mock_system_fail_) 90 if (mock_system_fail_)
91 return scoped_ptr<DnsProbeJob>(NULL); 91 return scoped_ptr<DnsProbeJob>();
92 92
93 system_job_created_ = true; 93 system_job_created_ = true;
94 return scoped_ptr<DnsProbeJob>( 94 return scoped_ptr<DnsProbeJob>(
95 new MockDnsProbeJob(job_callback, 95 new MockDnsProbeJob(job_callback,
96 mock_system_result_)); 96 mock_system_result_));
97 } 97 }
98 98
99 virtual scoped_ptr<DnsProbeJob> CreatePublicProbeJob( 99 virtual scoped_ptr<DnsProbeJob> CreatePublicProbeJob(
100 const DnsProbeJob::CallbackType& job_callback) OVERRIDE { 100 const DnsProbeJob::CallbackType& job_callback) OVERRIDE {
101 public_job_created_ = true; 101 public_job_created_ = true;
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
211 211
212 Reset(); 212 Reset();
213 213
214 RunUntilIdle(); 214 RunUntilIdle();
215 EXPECT_FALSE(callback_called_); 215 EXPECT_FALSE(callback_called_);
216 } 216 }
217 217
218 } // namespace 218 } // namespace
219 219
220 } // namespace chrome_browser_net 220 } // namespace chrome_browser_net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698