| Index: components/data_reduction_proxy/core/browser/data_reduction_proxy_config_unittest.cc
|
| diff --git a/components/data_reduction_proxy/core/browser/data_reduction_proxy_config_unittest.cc b/components/data_reduction_proxy/core/browser/data_reduction_proxy_config_unittest.cc
|
| index 6bf0dfb65e02a81bb9c5c27d1d7c3d182f6fd93f..a0798cb130c805a2c7427ed4abee0d2d63612f42 100644
|
| --- a/components/data_reduction_proxy/core/browser/data_reduction_proxy_config_unittest.cc
|
| +++ b/components/data_reduction_proxy/core/browser/data_reduction_proxy_config_unittest.cc
|
| @@ -930,7 +930,7 @@ TEST_F(DataReductionProxyConfigTest, LoFiOn) {
|
| .WillRepeatedly(testing::Return(tests[i].network_prohibitively_slow));
|
|
|
| base::HistogramTester histogram_tester;
|
| - config()->UpdateLoFiStatusOnMainFrameRequest(false, nullptr);
|
| + bool should_enable_lofi = config()->ShouldEnableLoFiMode(nullptr);
|
| if (tests[i].expect_bucket_count != 0) {
|
| histogram_tester.ExpectBucketCount(
|
| "DataReductionProxy.AutoLoFiRequestHeaderState.Unknown",
|
| @@ -938,49 +938,7 @@ TEST_F(DataReductionProxyConfigTest, LoFiOn) {
|
| tests[i].expect_bucket_count);
|
| }
|
|
|
| - EXPECT_EQ(tests[i].expect_lofi_header,
|
| - config()->ShouldUseLoFiHeaderForRequests())
|
| - << i;
|
| - }
|
| -}
|
| -
|
| -TEST_F(DataReductionProxyConfigTest, LoFiStatusTransition) {
|
| - const struct {
|
| - bool lofi_switch_enabled;
|
| - } tests[] = {
|
| - {
|
| - false,
|
| - },
|
| - {
|
| - true,
|
| - },
|
| - };
|
| -
|
| - for (size_t i = 0; i < arraysize(tests); ++i) {
|
| - config()->ResetLoFiStatusForTest();
|
| - if (tests[i].lofi_switch_enabled) {
|
| - base::CommandLine::ForCurrentProcess()->AppendSwitchASCII(
|
| - switches::kDataReductionProxyLoFi,
|
| - switches::kDataReductionProxyLoFiValueAlwaysOn);
|
| - } else {
|
| - EXPECT_CALL(*config(), IsIncludedInLoFiEnabledFieldTrial())
|
| - .WillRepeatedly(testing::Return(true));
|
| -
|
| - EXPECT_CALL(*config(), IsNetworkQualityProhibitivelySlow(_))
|
| - .WillRepeatedly(testing::Return(true));
|
| - }
|
| -
|
| - // First, set the status to enabled.
|
| - config()->UpdateLoFiStatusOnMainFrameRequest(false, nullptr);
|
| - EXPECT_EQ(true, config()->ShouldUseLoFiHeaderForRequests()) << i;
|
| -
|
| - // Full page reload with Lo-Fi disabled (main frame request).
|
| - config()->UpdateLoFiStatusOnMainFrameRequest(true, nullptr);
|
| - EXPECT_FALSE(config()->ShouldUseLoFiHeaderForRequests()) << i;
|
| -
|
| - // New page load (main frame request).
|
| - config()->UpdateLoFiStatusOnMainFrameRequest(false, nullptr);
|
| - EXPECT_EQ(true, config()->ShouldUseLoFiHeaderForRequests()) << i;
|
| + EXPECT_EQ(tests[i].expect_lofi_header, should_enable_lofi) << i;
|
| }
|
| }
|
|
|
|
|