Commit 49b42b9c authored by Tarun Bansal's avatar Tarun Bansal Committed by Commit Bot

Disable data saver promo on Android one devices

Bug: 806068
Change-Id: I013b1396f3c56edb5b7dd349d9ad31616b1a5803
Reviewed-on: https://chromium-review.googlesource.com/887780Reviewed-by: default avatarScott Little <sclittle@chromium.org>
Commit-Queue: Tarun Bansal <tbansal@chromium.org>
Cr-Commit-Position: refs/heads/master@{#532056}
parent 627b1562
...@@ -22,7 +22,6 @@ ...@@ -22,7 +22,6 @@
#include "url/url_constants.h" #include "url/url_constants.h"
#if defined(OS_ANDROID) #if defined(OS_ANDROID)
#include "base/android/build_info.h"
#include "base/sys_info.h" #include "base/sys_info.h"
#endif #endif
...@@ -71,12 +70,6 @@ std::string GetStringValueForVariationParamWithDefaultValue( ...@@ -71,12 +70,6 @@ std::string GetStringValueForVariationParamWithDefaultValue(
return it->second; return it->second;
} }
bool IsIncludedInAndroidOnePromoFieldTrial(
base::StringPiece build_fingerprint) {
static const char kAndroidOneIdentifier[] = "sprout";
return build_fingerprint.find(kAndroidOneIdentifier) != std::string::npos;
}
bool CanShowAndroidLowMemoryDevicePromo() { bool CanShowAndroidLowMemoryDevicePromo() {
#if defined(OS_ANDROID) #if defined(OS_ANDROID)
return base::SysInfo::IsLowEndDevice() && return base::SysInfo::IsLowEndDevice() &&
...@@ -96,12 +89,6 @@ bool IsIncludedInPromoFieldTrial() { ...@@ -96,12 +89,6 @@ bool IsIncludedInPromoFieldTrial() {
if (IsIncludedInFieldTrial("DataCompressionProxyPromoVisibility")) if (IsIncludedInFieldTrial("DataCompressionProxyPromoVisibility"))
return true; return true;
#if defined(OS_ANDROID)
base::StringPiece android_build_fingerprint =
base::android::BuildInfo::GetInstance()->android_build_fp();
if (IsIncludedInAndroidOnePromoFieldTrial(android_build_fingerprint))
return true;
#endif
return CanShowAndroidLowMemoryDevicePromo(); return CanShowAndroidLowMemoryDevicePromo();
} }
...@@ -109,20 +96,9 @@ bool IsIncludedInFREPromoFieldTrial() { ...@@ -109,20 +96,9 @@ bool IsIncludedInFREPromoFieldTrial() {
if (IsIncludedInFieldTrial("DataReductionProxyFREPromo")) if (IsIncludedInFieldTrial("DataReductionProxyFREPromo"))
return true; return true;
#if defined(OS_ANDROID)
base::StringPiece android_build_fingerprint =
base::android::BuildInfo::GetInstance()->android_build_fp();
if (IsIncludedInAndroidOnePromoFieldTrial(android_build_fingerprint))
return true;
#endif
return CanShowAndroidLowMemoryDevicePromo(); return CanShowAndroidLowMemoryDevicePromo();
} }
bool IsIncludedInAndroidOnePromoFieldTrialForTesting(
base::StringPiece build_fingerprint) {
return IsIncludedInAndroidOnePromoFieldTrial(build_fingerprint);
}
bool IsIncludedInHoldbackFieldTrial() { bool IsIncludedInHoldbackFieldTrial() {
return IsIncludedInFieldTrial("DataCompressionProxyHoldback"); return IsIncludedInFieldTrial("DataCompressionProxyHoldback");
} }
......
...@@ -10,7 +10,6 @@ ...@@ -10,7 +10,6 @@
#include <vector> #include <vector>
#include "base/macros.h" #include "base/macros.h"
#include "base/strings/string_piece.h"
#include "base/time/time.h" #include "base/time/time.h"
#include "components/data_reduction_proxy/core/common/data_reduction_proxy_config_values.h" #include "components/data_reduction_proxy/core/common/data_reduction_proxy_config_values.h"
#include "url/gurl.h" #include "url/gurl.h"
...@@ -47,12 +46,6 @@ bool IsIncludedInHoldbackFieldTrial(); ...@@ -47,12 +46,6 @@ bool IsIncludedInHoldbackFieldTrial();
// not included in a group. // not included in a group.
std::string HoldbackFieldTrialGroup(); std::string HoldbackFieldTrialGroup();
// Returns true if this client is part of the field trial that should display
// a promotion for the data reduction proxy on Android One devices. This is for
// testing purposes and should not be called outside of tests.
bool IsIncludedInAndroidOnePromoFieldTrialForTesting(
base::StringPiece build_fingerprint);
// Returns the name of the Lo-Fi field trial. // Returns the name of the Lo-Fi field trial.
// TODO(ryansturm): crbug.com/759052 Cleanup once fully cutover to new blacklist // TODO(ryansturm): crbug.com/759052 Cleanup once fully cutover to new blacklist
const char* GetLoFiFieldTrialName(); const char* GetLoFiFieldTrialName();
......
...@@ -77,13 +77,6 @@ TEST_F(DataReductionProxyParamsTest, Flags) { ...@@ -77,13 +77,6 @@ TEST_F(DataReductionProxyParamsTest, Flags) {
CheckValues(params, "http://ovveride-1.com/", "http://ovveride-2.com/"); CheckValues(params, "http://ovveride-1.com/", "http://ovveride-2.com/");
} }
TEST_F(DataReductionProxyParamsTest, AndroidOnePromoFieldTrial) {
EXPECT_TRUE(params::IsIncludedInAndroidOnePromoFieldTrialForTesting(
"google/sprout/sprout:4.4.4/KPW53/1379542:user/release-keys"));
EXPECT_FALSE(params::IsIncludedInAndroidOnePromoFieldTrialForTesting(
"google/hammerhead/hammerhead:5.0/LRX210/1570415:user/release-keys"));
}
TEST_F(DataReductionProxyParamsTest, IsClientConfigEnabled) { TEST_F(DataReductionProxyParamsTest, IsClientConfigEnabled) {
const struct { const struct {
std::string test_case; std::string test_case;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment