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

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

Issue 104493005: Update some uses of Value in chrome/browser to use the base:: namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix Created 7 years 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
« no previous file with comments | « chrome/browser/net/predictor.cc ('k') | chrome/browser/net/pref_proxy_config_tracker_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/net/predictor_unittest.cc
diff --git a/chrome/browser/net/predictor_unittest.cc b/chrome/browser/net/predictor_unittest.cc
index 225c3e3ef9056c6c772b574efdb6b1e034ca06d4..fff3325ec9bab9636a71151ce222280b7ceb2c17 100644
--- a/chrome/browser/net/predictor_unittest.cc
+++ b/chrome/browser/net/predictor_unittest.cc
@@ -264,14 +264,14 @@ TEST_F(PredictorTest, MassiveConcurrentLookupTest) {
// Return a motivation_list if we can find one for the given motivating_host (or
// NULL if a match is not found).
-static const ListValue* FindSerializationMotivation(
+static const base::ListValue* FindSerializationMotivation(
const GURL& motivation,
- const ListValue* referral_list) {
+ const base::ListValue* referral_list) {
CHECK_LT(0u, referral_list->GetSize()); // Room for version.
int format_version = -1;
CHECK(referral_list->GetInteger(0, &format_version));
CHECK_EQ(Predictor::kPredictorReferrerVersion, format_version);
- const ListValue* motivation_list(NULL);
+ const base::ListValue* motivation_list(NULL);
for (size_t i = 1; i < referral_list->GetSize(); ++i) {
referral_list->GetList(i, &motivation_list);
std::string existing_spec;
@@ -282,14 +282,15 @@ static const ListValue* FindSerializationMotivation(
return NULL;
}
-static ListValue* FindSerializationMotivation(const GURL& motivation,
- ListValue* referral_list) {
- return const_cast<ListValue*>(FindSerializationMotivation(
- motivation, static_cast<const ListValue*>(referral_list)));
+static base::ListValue* FindSerializationMotivation(
+ const GURL& motivation,
+ base::ListValue* referral_list) {
+ return const_cast<base::ListValue*>(FindSerializationMotivation(
+ motivation, static_cast<const base::ListValue*>(referral_list)));
}
// Create a new empty serialization list.
-static ListValue* NewEmptySerializationList() {
+static base::ListValue* NewEmptySerializationList() {
base::ListValue* list = new base::ListValue;
list->Append(
new base::FundamentalValue(Predictor::kPredictorReferrerVersion));
@@ -302,22 +303,22 @@ static ListValue* NewEmptySerializationList() {
static void AddToSerializedList(const GURL& motivation,
const GURL& subresource,
double use_rate,
- ListValue* referral_list ) {
+ base::ListValue* referral_list) {
// Find the motivation if it is already used.
- ListValue* motivation_list = FindSerializationMotivation(motivation,
+ base::ListValue* motivation_list = FindSerializationMotivation(motivation,
referral_list);
if (!motivation_list) {
// This is the first mention of this motivation, so build a list.
- motivation_list = new ListValue;
- motivation_list->Append(new StringValue(motivation.spec()));
+ motivation_list = new base::ListValue;
+ motivation_list->Append(new base::StringValue(motivation.spec()));
// Provide empty subresource list.
- motivation_list->Append(new ListValue());
+ motivation_list->Append(new base::ListValue());
// ...and make it part of the serialized referral_list.
referral_list->Append(motivation_list);
}
- ListValue* subresource_list(NULL);
+ base::ListValue* subresource_list(NULL);
// 0 == url; 1 == subresource_list.
EXPECT_TRUE(motivation_list->GetList(1, &subresource_list));
@@ -335,13 +336,13 @@ static void AddToSerializedList(const GURL& motivation,
// Data is written into use_rate arguments.
static bool GetDataFromSerialization(const GURL& motivation,
const GURL& subresource,
- const ListValue& referral_list,
+ const base::ListValue& referral_list,
double* use_rate) {
- const ListValue* motivation_list =
+ const base::ListValue* motivation_list =
FindSerializationMotivation(motivation, &referral_list);
if (!motivation_list)
return false;
- const ListValue* subresource_list;
+ const base::ListValue* subresource_list;
EXPECT_TRUE(motivation_list->GetList(1, &subresource_list));
for (size_t i = 0; i < subresource_list->GetSize();) {
std::string url_spec;
@@ -361,7 +362,7 @@ TEST_F(PredictorTest, ReferrerSerializationNilTest) {
Predictor predictor(true);
predictor.SetHostResolver(host_resolver_.get());
- scoped_ptr<ListValue> referral_list(NewEmptySerializationList());
+ scoped_ptr<base::ListValue> referral_list(NewEmptySerializationList());
predictor.SerializeReferrers(referral_list.get());
EXPECT_EQ(1U, referral_list->GetSize());
EXPECT_FALSE(GetDataFromSerialization(
@@ -380,14 +381,14 @@ TEST_F(PredictorTest, ReferrerSerializationSingleReferrerTest) {
const GURL motivation_url("http://www.google.com:91");
const GURL subresource_url("http://icons.google.com:90");
const double kUseRate = 23.4;
- scoped_ptr<ListValue> referral_list(NewEmptySerializationList());
+ scoped_ptr<base::ListValue> referral_list(NewEmptySerializationList());
AddToSerializedList(motivation_url, subresource_url,
kUseRate, referral_list.get());
predictor.DeserializeReferrers(*referral_list.get());
- ListValue recovered_referral_list;
+ base::ListValue recovered_referral_list;
predictor.SerializeReferrers(&recovered_referral_list);
EXPECT_EQ(2U, recovered_referral_list.GetSize());
double rate;
@@ -405,7 +406,7 @@ TEST_F(PredictorTest, GetHtmlReferrerLists) {
Predictor predictor(true);
predictor.SetHostResolver(host_resolver_.get());
const double kUseRate = 23.4;
- scoped_ptr<ListValue> referral_list(NewEmptySerializationList());
+ scoped_ptr<base::ListValue> referral_list(NewEmptySerializationList());
AddToSerializedList(
GURL("http://d.google.com/x1"),
@@ -496,7 +497,7 @@ TEST_F(PredictorTest, ReferrerSerializationTrimTest) {
GURL img_subresource_url("http://img.google.com:118");
const double kRateImg = 8.0 * Predictor::kDiscardableExpectedValue;
- scoped_ptr<ListValue> referral_list(NewEmptySerializationList());
+ scoped_ptr<base::ListValue> referral_list(NewEmptySerializationList());
AddToSerializedList(
motivation_url, icon_subresource_url, kRateIcon, referral_list.get());
AddToSerializedList(
@@ -504,7 +505,7 @@ TEST_F(PredictorTest, ReferrerSerializationTrimTest) {
predictor.DeserializeReferrers(*referral_list.get());
- ListValue recovered_referral_list;
+ base::ListValue recovered_referral_list;
predictor.SerializeReferrers(&recovered_referral_list);
EXPECT_EQ(2U, recovered_referral_list.GetSize());
double rate;
@@ -678,7 +679,7 @@ TEST_F(PredictorTest, CanonicalizeUrl) {
TEST_F(PredictorTest, DiscardPredictorResults) {
Predictor predictor(true);
predictor.SetHostResolver(host_resolver_.get());
- ListValue referral_list;
+ base::ListValue referral_list;
predictor.SerializeReferrers(&referral_list);
EXPECT_EQ(1U, referral_list.GetSize());
« no previous file with comments | « chrome/browser/net/predictor.cc ('k') | chrome/browser/net/pref_proxy_config_tracker_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698