summaryrefslogtreecommitdiffstats
path: root/chrome/browser/net/predictor_unittest.cc
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser/net/predictor_unittest.cc')
-rw-r--r--chrome/browser/net/predictor_unittest.cc55
1 files changed, 27 insertions, 28 deletions
diff --git a/chrome/browser/net/predictor_unittest.cc b/chrome/browser/net/predictor_unittest.cc
index a0a0113..bbc798e 100644
--- a/chrome/browser/net/predictor_unittest.cc
+++ b/chrome/browser/net/predictor_unittest.cc
@@ -65,7 +65,7 @@ class PredictorTest : public testing::Test {
: io_thread_(BrowserThread::IO, &loop_),
host_resolver_(new net::MockCachingHostResolver()),
default_max_queueing_delay_(TimeDelta::FromMilliseconds(
- PredictorInit::kMaxPrefetchQueueingDelayMs)) {
+ PredictorInit::kMaxSpeculativeResolveQueueDelayMs)) {
}
protected:
@@ -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::kMaxPrefetchConcurrentLookups,
- false);
+ PredictorInit::kMaxSpeculativeParallelResolves,
+ 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::kMaxPrefetchConcurrentLookups,
- false);
+ PredictorInit::kMaxSpeculativeParallelResolves,
+ 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::kMaxPrefetchConcurrentLookups,
- false);
+ PredictorInit::kMaxSpeculativeParallelResolves,
+ 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::kMaxPrefetchConcurrentLookups,
- false);
+ PredictorInit::kMaxSpeculativeParallelResolves,
+ false));
GURL goog("http://www.google.com:80"),
goog2("http://gmail.google.com.com:80"),
@@ -221,7 +221,6 @@ TEST_F(PredictorTest, ConcurrentLookupTest) {
EXPECT_FALSE(testing_master->WasFound(bad1));
EXPECT_FALSE(testing_master->WasFound(bad2));
- EXPECT_GT(testing_master->peak_pending_lookups(), names.size() / 2);
EXPECT_LE(testing_master->peak_pending_lookups(), names.size());
EXPECT_LE(testing_master->peak_pending_lookups(),
testing_master->max_concurrent_dns_lookups());
@@ -232,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::kMaxPrefetchConcurrentLookups,
- false);
+ PredictorInit::kMaxSpeculativeParallelResolves,
+ false));
UrlList names;
for (int i = 0; i < 100; i++)
@@ -352,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::kMaxPrefetchConcurrentLookups,
- false);
+ PredictorInit::kMaxSpeculativeParallelResolves,
+ false));
scoped_ptr<ListValue> referral_list(NewEmptySerializationList());
predictor->SerializeReferrers(referral_list.get());
EXPECT_EQ(1U, referral_list->GetSize());
@@ -371,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::kMaxPrefetchConcurrentLookups,
- false);
+ PredictorInit::kMaxSpeculativeParallelResolves,
+ false));
const GURL motivation_url("http://www.google.com:91");
const GURL subresource_url("http://icons.google.com:90");
const double kUseRate = 23.4;
@@ -399,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::kMaxPrefetchConcurrentLookups,
- false);
+ PredictorInit::kMaxSpeculativeParallelResolves,
+ false));
GURL motivation_url("http://www.google.com:110");
GURL icon_subresource_url("http://icons.google.com:111");