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

Unified Diff: chrome/browser/net/predictor_unittest.cc

Issue 4192012: Convert implicit scoped_refptr constructor calls to explicit ones, part 1 (Closed) Base URL: http://git.chromium.org/git/chromium.git
Patch Set: fix presubmit Created 10 years, 2 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/net/predictor_unittest.cc
diff --git a/chrome/browser/net/predictor_unittest.cc b/chrome/browser/net/predictor_unittest.cc
index 38f028128f832cfbac550cc8e0d2cf688405d2d9..bbc798e738c33c5257fc3cd1891ea8e21828daa8 100644
--- a/chrome/browser/net/predictor_unittest.cc
+++ b/chrome/browser/net/predictor_unittest.cc
@@ -109,25 +109,25 @@ class PredictorTest : public testing::Test {
//------------------------------------------------------------------------------
TEST_F(PredictorTest, StartupShutdownTest) {
- scoped_refptr<Predictor> testing_master =
+ scoped_refptr<Predictor> testing_master(
new Predictor(host_resolver_.get(),
default_max_queueing_delay_,
PredictorInit::kMaxSpeculativeParallelResolves,
- false);
+ false));
testing_master->Shutdown();
}
TEST_F(PredictorTest, ShutdownWhenResolutionIsPendingTest) {
- scoped_refptr<net::WaitingHostResolverProc> resolver_proc =
- new net::WaitingHostResolverProc(NULL);
+ scoped_refptr<net::WaitingHostResolverProc> resolver_proc(
+ new net::WaitingHostResolverProc(NULL));
host_resolver_->Reset(resolver_proc);
- scoped_refptr<Predictor> testing_master =
+ scoped_refptr<Predictor> testing_master(
new Predictor(host_resolver_.get(),
default_max_queueing_delay_,
PredictorInit::kMaxSpeculativeParallelResolves,
- false);
+ false));
GURL localhost("http://localhost:80");
UrlList names;
@@ -149,11 +149,11 @@ TEST_F(PredictorTest, ShutdownWhenResolutionIsPendingTest) {
}
TEST_F(PredictorTest, SingleLookupTest) {
- scoped_refptr<Predictor> testing_master =
+ scoped_refptr<Predictor> testing_master(
new Predictor(host_resolver_.get(),
default_max_queueing_delay_,
PredictorInit::kMaxSpeculativeParallelResolves,
- false);
+ false));
GURL goog("http://www.google.com:80");
@@ -181,11 +181,11 @@ TEST_F(PredictorTest, SingleLookupTest) {
TEST_F(PredictorTest, ConcurrentLookupTest) {
host_resolver_->rules()->AddSimulatedFailure("*.notfound");
- scoped_refptr<Predictor> testing_master =
+ scoped_refptr<Predictor> testing_master(
new Predictor(host_resolver_.get(),
default_max_queueing_delay_,
PredictorInit::kMaxSpeculativeParallelResolves,
- false);
+ false));
GURL goog("http://www.google.com:80"),
goog2("http://gmail.google.com.com:80"),
@@ -231,11 +231,11 @@ TEST_F(PredictorTest, ConcurrentLookupTest) {
TEST_F(PredictorTest, MassiveConcurrentLookupTest) {
host_resolver_->rules()->AddSimulatedFailure("*.notfound");
- scoped_refptr<Predictor> testing_master =
+ scoped_refptr<Predictor> testing_master(
new Predictor(host_resolver_.get(),
default_max_queueing_delay_,
PredictorInit::kMaxSpeculativeParallelResolves,
- false);
+ false));
UrlList names;
for (int i = 0; i < 100; i++)
@@ -351,11 +351,11 @@ static bool GetDataFromSerialization(const GURL& motivation,
// Make sure nil referral lists really have no entries, and no latency listed.
TEST_F(PredictorTest, ReferrerSerializationNilTest) {
- scoped_refptr<Predictor> predictor =
+ scoped_refptr<Predictor> predictor(
new Predictor(host_resolver_.get(),
default_max_queueing_delay_,
PredictorInit::kMaxSpeculativeParallelResolves,
- false);
+ false));
scoped_ptr<ListValue> referral_list(NewEmptySerializationList());
predictor->SerializeReferrers(referral_list.get());
EXPECT_EQ(1U, referral_list->GetSize());
@@ -370,11 +370,11 @@ TEST_F(PredictorTest, ReferrerSerializationNilTest) {
// deserialized into the database, and can be extracted back out via
// serialization without being changed.
TEST_F(PredictorTest, ReferrerSerializationSingleReferrerTest) {
- scoped_refptr<Predictor> predictor =
+ scoped_refptr<Predictor> predictor(
new Predictor(host_resolver_.get(),
default_max_queueing_delay_,
PredictorInit::kMaxSpeculativeParallelResolves,
- false);
+ false));
const GURL motivation_url("http://www.google.com:91");
const GURL subresource_url("http://icons.google.com:90");
const double kUseRate = 23.4;
@@ -398,11 +398,11 @@ TEST_F(PredictorTest, ReferrerSerializationSingleReferrerTest) {
// Make sure the Trim() functionality works as expected.
TEST_F(PredictorTest, ReferrerSerializationTrimTest) {
- scoped_refptr<Predictor> predictor =
+ scoped_refptr<Predictor> predictor(
new Predictor(host_resolver_.get(),
default_max_queueing_delay_,
PredictorInit::kMaxSpeculativeParallelResolves,
- false);
+ false));
GURL motivation_url("http://www.google.com:110");
GURL icon_subresource_url("http://icons.google.com:111");

Powered by Google App Engine
This is Rietveld 408576698