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

Unified Diff: components/data_reduction_proxy/core/browser/data_reduction_proxy_request_options_unittest.cc

Issue 1380933002: Set exp id in the CP header if user is in Lo-Fi control. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased, addressed comment Created 5 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
« no previous file with comments | « components/data_reduction_proxy/core/browser/data_reduction_proxy_request_options.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/data_reduction_proxy/core/browser/data_reduction_proxy_request_options_unittest.cc
diff --git a/components/data_reduction_proxy/core/browser/data_reduction_proxy_request_options_unittest.cc b/components/data_reduction_proxy/core/browser/data_reduction_proxy_request_options_unittest.cc
index 511f8d993e53832865d5c97d8a1d40ca636dd02e..8daef65327ae1aeaad63da0d1ac7fe10ae041d47 100644
--- a/components/data_reduction_proxy/core/browser/data_reduction_proxy_request_options_unittest.cc
+++ b/components/data_reduction_proxy/core/browser/data_reduction_proxy_request_options_unittest.cc
@@ -314,21 +314,18 @@ TEST_F(DataReductionProxyRequestOptionsTest, LoFiOnThroughCommandLineSwitch) {
TEST_F(DataReductionProxyRequestOptionsTest, AutoLoFi) {
const struct {
bool auto_lofi_enabled_group;
+ bool auto_lofi_control_group;
bool network_prohibitively_slow;
-
} tests[] = {
- {
- false, false,
- },
- {
- false, true,
- },
- {
- true, false,
- },
- {
- true, true,
- },
+ {false, false, false},
+ {false, false, true},
+ {true, false, false},
+ {true, false, true},
+ {false, true, false},
+ {false, true, true},
+ // Repeat this test data to simulate user moving out of Lo-Fi control
+ // experiment.
+ {false, true, false},
};
for (size_t i = 0; i < arraysize(tests); ++i) {
@@ -337,6 +334,8 @@ TEST_F(DataReductionProxyRequestOptionsTest, AutoLoFi) {
// trial and network is prohibitively slow.
bool expect_lofi_header =
tests[i].auto_lofi_enabled_group && tests[i].network_prohibitively_slow;
+ bool expect_lofi_experiment_header =
+ tests[i].auto_lofi_control_group && tests[i].network_prohibitively_slow;
std::string expected_header;
if (!expect_lofi_header) {
@@ -350,8 +349,15 @@ TEST_F(DataReductionProxyRequestOptionsTest, AutoLoFi) {
std::string(), "low", std::vector<std::string>(),
&expected_header);
}
+
+ if (expect_lofi_experiment_header) {
+ expected_header = expected_header.append(", exp=");
+ expected_header = expected_header.append(kLoFiExperimentID);
+ }
test_context_->config()->SetIncludedInLoFiEnabledFieldTrial(
tests[i].auto_lofi_enabled_group);
+ test_context_->config()->SetIncludedInLoFiControlFieldTrial(
+ tests[i].auto_lofi_control_group);
test_context_->config()->SetNetworkProhibitivelySlow(
tests[i].network_prohibitively_slow);
« no previous file with comments | « components/data_reduction_proxy/core/browser/data_reduction_proxy_request_options.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698