summaryrefslogtreecommitdiffstats
path: root/components/suggestions
diff options
context:
space:
mode:
authormathp <mathp@chromium.org>2015-03-24 10:37:47 -0700
committerCommit bot <commit-bot@chromium.org>2015-03-24 17:38:53 +0000
commitd91e8eb029063e12650f3e325f66e9c402e4b949 (patch)
tree897caf8feda5570c7c6ba5edad5d195f622687f9 /components/suggestions
parent8ead434d80d31a0e3797fe9ac8acde66f15a549b (diff)
downloadchromium_src-d91e8eb029063e12650f3e325f66e9c402e4b949.zip
chromium_src-d91e8eb029063e12650f3e325f66e9c402e4b949.tar.gz
chromium_src-d91e8eb029063e12650f3e325f66e9c402e4b949.tar.bz2
[Suggestions] Remove support for a Control logging group.
Histograms that are no longer logged: NewTabPage.MostVisited.client0 NewTabPage.SuggestionsImpression.client0 Field trials that are deprecated: ChromeSuggestions Cleanup in the tests as well. TBR=mgiuca BUG=None TEST=SuggestionsServiceTest* Review URL: https://codereview.chromium.org/1030713002 Cr-Commit-Position: refs/heads/master@{#322025}
Diffstat (limited to 'components/suggestions')
-rw-r--r--components/suggestions/suggestions_service.cc18
-rw-r--r--components/suggestions/suggestions_service.h8
-rw-r--r--components/suggestions/suggestions_service_unittest.cc50
3 files changed, 0 insertions, 76 deletions
diff --git a/components/suggestions/suggestions_service.cc b/components/suggestions/suggestions_service.cc
index fee193e..dbc7036 100644
--- a/components/suggestions/suggestions_service.cc
+++ b/components/suggestions/suggestions_service.cc
@@ -17,7 +17,6 @@
#include "components/suggestions/blacklist_store.h"
#include "components/suggestions/suggestions_store.h"
#include "components/variations/net/variations_http_header_provider.h"
-#include "components/variations/variations_associated_data.h"
#include "net/base/escape.h"
#include "net/base/load_flags.h"
#include "net/base/net_errors.h"
@@ -51,12 +50,6 @@ void LogResponseState(SuggestionsResponseState state) {
RESPONSE_STATE_SIZE);
}
-// Obtains the experiment parameter under the supplied |key|, or empty string
-// if the parameter does not exist.
-std::string GetExperimentParam(const std::string& key) {
- return variations::GetVariationParamValue(kSuggestionsFieldTrialName, key);
-}
-
GURL BuildBlacklistRequestURL(const std::string& blacklist_url_prefix,
const GURL& candidate_url) {
return GURL(blacklist_url_prefix +
@@ -88,11 +81,6 @@ const int kSchedulingMaxDelaySec = 5 * 60;
} // namespace
-const char kSuggestionsFieldTrialName[] = "ChromeSuggestions";
-const char kSuggestionsFieldTrialControlParam[] = "control";
-const char kSuggestionsFieldTrialStateEnabled[] = "enabled";
-const char kSuggestionsFieldTrialStateParam[] = "state";
-
// TODO(mathp): Put this in TemplateURL.
const char kSuggestionsURL[] = "https://www.google.com/chromesuggestions?t=2";
const char kSuggestionsBlacklistURLPrefix[] =
@@ -118,12 +106,6 @@ SuggestionsService::SuggestionsService(
SuggestionsService::~SuggestionsService() {}
-// static
-bool SuggestionsService::IsControlGroup() {
- return GetExperimentParam(kSuggestionsFieldTrialControlParam) ==
- kSuggestionsFieldTrialStateEnabled;
-}
-
void SuggestionsService::FetchSuggestionsData(
SyncState sync_state,
SuggestionsService::ResponseCallback callback) {
diff --git a/components/suggestions/suggestions_service.h b/components/suggestions/suggestions_service.h
index 4128b93..b0d0f4c 100644
--- a/components/suggestions/suggestions_service.h
+++ b/components/suggestions/suggestions_service.h
@@ -37,11 +37,6 @@ namespace suggestions {
class BlacklistStore;
class SuggestionsStore;
-extern const char kSuggestionsFieldTrialName[];
-extern const char kSuggestionsFieldTrialControlParam[];
-extern const char kSuggestionsFieldTrialStateEnabled[];
-extern const char kSuggestionsFieldTrialStateParam[];
-
extern const char kSuggestionsURL[];
extern const char kSuggestionsBlacklistURLPrefix[];
extern const char kSuggestionsBlacklistURLParam[];
@@ -61,9 +56,6 @@ class SuggestionsService : public KeyedService, public net::URLFetcherDelegate {
scoped_ptr<BlacklistStore> blacklist_store);
~SuggestionsService() override;
- // Whether the user is part of a control group.
- static bool IsControlGroup();
-
// Request suggestions data, which will be passed to |callback|. |sync_state|
// will influence the behavior of this function (see SyncState definition).
//
diff --git a/components/suggestions/suggestions_service_unittest.cc b/components/suggestions/suggestions_service_unittest.cc
index c6253c7..78ac147 100644
--- a/components/suggestions/suggestions_service_unittest.cc
+++ b/components/suggestions/suggestions_service_unittest.cc
@@ -10,15 +10,11 @@
#include "base/bind.h"
#include "base/memory/scoped_ptr.h"
#include "base/message_loop/message_loop.h"
-#include "base/metrics/field_trial.h"
-#include "base/strings/utf_string_conversions.h"
#include "components/suggestions/blacklist_store.h"
#include "components/suggestions/image_manager.h"
#include "components/suggestions/proto/suggestions.pb.h"
#include "components/suggestions/suggestions_store.h"
#include "components/suggestions/suggestions_utils.h"
-#include "components/variations/entropy_provider.h"
-#include "components/variations/variations_associated_data.h"
#include "net/http/http_response_headers.h"
#include "net/http/http_status_code.h"
#include "net/url_request/test_url_fetcher_factory.h"
@@ -199,27 +195,6 @@ class SuggestionsServiceTest : public testing::Test {
io_message_loop_.message_loop_proxy());
}
- void EnableFieldTrial(bool control_group) {
- // Clear the existing |field_trial_list_| to avoid firing a DCHECK.
- field_trial_list_.reset(NULL);
- field_trial_list_.reset(
- new base::FieldTrialList(new metrics::SHA1EntropyProvider("foo")));
-
- variations::testing::ClearAllVariationParams();
- std::map<std::string, std::string> params;
- params[kSuggestionsFieldTrialStateParam] =
- kSuggestionsFieldTrialStateEnabled;
- if (control_group) {
- params[kSuggestionsFieldTrialControlParam] =
- kSuggestionsFieldTrialStateEnabled;
- }
- variations::AssociateVariationParams(kSuggestionsFieldTrialName, "Group1",
- params);
- field_trial_ = base::FieldTrialList::CreateFieldTrial(
- kSuggestionsFieldTrialName, "Group1");
- field_trial_->group();
- }
-
void FetchSuggestionsDataHelper(SyncState sync_state) {
scoped_ptr<SuggestionsService> suggestions_service(
CreateSuggestionsServiceWithMocks());
@@ -343,32 +318,18 @@ class SuggestionsServiceTest : public testing::Test {
scoped_refptr<net::TestURLRequestContextGetter> request_context_;
private:
- scoped_ptr<base::FieldTrialList> field_trial_list_;
- scoped_refptr<base::FieldTrial> field_trial_;
-
DISALLOW_COPY_AND_ASSIGN(SuggestionsServiceTest);
};
-TEST_F(SuggestionsServiceTest, IsControlGroup) {
- EnableFieldTrial(false);
- EXPECT_FALSE(SuggestionsService::IsControlGroup());
-
- EnableFieldTrial(true);
- EXPECT_TRUE(SuggestionsService::IsControlGroup());
-}
-
TEST_F(SuggestionsServiceTest, FetchSuggestionsData) {
- EnableFieldTrial(false);
FetchSuggestionsDataHelper(INITIALIZED_ENABLED_HISTORY);
}
TEST_F(SuggestionsServiceTest, FetchSuggestionsDataSyncNotInitializedEnabled) {
- EnableFieldTrial(false);
FetchSuggestionsDataHelper(NOT_INITIALIZED_ENABLED);
}
TEST_F(SuggestionsServiceTest, FetchSuggestionsDataSyncDisabled) {
- EnableFieldTrial(false);
scoped_ptr<SuggestionsService> suggestions_service(
CreateSuggestionsServiceWithMocks());
EXPECT_TRUE(suggestions_service != NULL);
@@ -387,7 +348,6 @@ TEST_F(SuggestionsServiceTest, FetchSuggestionsDataSyncDisabled) {
}
TEST_F(SuggestionsServiceTest, IssueRequestIfNoneOngoingError) {
- EnableFieldTrial(false);
scoped_ptr<SuggestionsService> suggestions_service(
CreateSuggestionsServiceWithMocks());
EXPECT_TRUE(suggestions_service != NULL);
@@ -407,7 +367,6 @@ TEST_F(SuggestionsServiceTest, IssueRequestIfNoneOngoingError) {
}
TEST_F(SuggestionsServiceTest, IssueRequestIfNoneOngoingResponseNotOK) {
- EnableFieldTrial(false);
scoped_ptr<SuggestionsService> suggestions_service(
CreateSuggestionsServiceWithMocks());
EXPECT_TRUE(suggestions_service != NULL);
@@ -436,7 +395,6 @@ TEST_F(SuggestionsServiceTest, IssueRequestIfNoneOngoingResponseNotOK) {
}
TEST_F(SuggestionsServiceTest, BlacklistURL) {
- EnableFieldTrial(false);
scoped_ptr<SuggestionsService> suggestions_service(
CreateSuggestionsServiceWithMocks());
EXPECT_TRUE(suggestions_service != NULL);
@@ -480,7 +438,6 @@ TEST_F(SuggestionsServiceTest, BlacklistURL) {
}
TEST_F(SuggestionsServiceTest, BlacklistURLFails) {
- EnableFieldTrial(false);
scoped_ptr<SuggestionsService> suggestions_service(
CreateSuggestionsServiceWithMocks());
EXPECT_TRUE(suggestions_service != NULL);
@@ -496,7 +453,6 @@ TEST_F(SuggestionsServiceTest, BlacklistURLFails) {
// Initial blacklist request fails, triggering a second which succeeds.
TEST_F(SuggestionsServiceTest, BlacklistURLRequestFails) {
- EnableFieldTrial(false);
scoped_ptr<SuggestionsService> suggestions_service(
CreateSuggestionsServiceWithMocks());
EXPECT_TRUE(suggestions_service != NULL);
@@ -553,7 +509,6 @@ TEST_F(SuggestionsServiceTest, BlacklistURLRequestFails) {
}
TEST_F(SuggestionsServiceTest, UndoBlacklistURL) {
- EnableFieldTrial(false);
scoped_ptr<SuggestionsService> suggestions_service(
CreateSuggestionsServiceWithMocks());
EXPECT_TRUE(suggestions_service != NULL);
@@ -590,17 +545,14 @@ TEST_F(SuggestionsServiceTest, UndoBlacklistURL) {
TEST_F(SuggestionsServiceTest, UndoBlacklistURLFailsIfNotInBlacklist) {
- EnableFieldTrial(false);
UndoBlacklistURLFailsHelper(true);
}
TEST_F(SuggestionsServiceTest, UndoBlacklistURLFailsIfAlreadyCandidate) {
- EnableFieldTrial(false);
UndoBlacklistURLFailsHelper(false);
}
TEST_F(SuggestionsServiceTest, GetBlacklistedUrl) {
- EnableFieldTrial(false);
scoped_ptr<GURL> request_url;
scoped_ptr<net::FakeURLFetcher> fetcher;
GURL retrieved_url;
@@ -626,7 +578,6 @@ TEST_F(SuggestionsServiceTest, GetBlacklistedUrl) {
}
TEST_F(SuggestionsServiceTest, UpdateBlacklistDelay) {
- EnableFieldTrial(false);
scoped_ptr<SuggestionsService> suggestions_service(
CreateSuggestionsServiceWithMocks());
base::TimeDelta initial_delay = suggestions_service->blacklist_delay();
@@ -645,7 +596,6 @@ TEST_F(SuggestionsServiceTest, UpdateBlacklistDelay) {
}
TEST_F(SuggestionsServiceTest, CheckDefaultTimeStamps) {
- EnableFieldTrial(false);
scoped_ptr<SuggestionsService> suggestions_service(
CreateSuggestionsServiceWithMocks());
SuggestionsProfile suggestions =