| Index: components/data_reduction_proxy/browser/data_reduction_proxy_settings_unittest.cc
|
| diff --git a/components/data_reduction_proxy/browser/data_reduction_proxy_settings_unittest.cc b/components/data_reduction_proxy/browser/data_reduction_proxy_settings_unittest.cc
|
| index fcb78fe51030bff5bb92975352ec8dd064c4eeec..ddfba43a30e49c08d206528d43c49045b4bf2abc 100644
|
| --- a/components/data_reduction_proxy/browser/data_reduction_proxy_settings_unittest.cc
|
| +++ b/components/data_reduction_proxy/browser/data_reduction_proxy_settings_unittest.cc
|
| @@ -31,6 +31,7 @@ const char kDataReductionProxySSL[] = "http://ssl.com:80";
|
| const char kProbeURLWithOKResponse[] = "http://ok.org/";
|
| const char kProbeURLWithBadResponse[] = "http://bad.org/";
|
| const char kProbeURLWithNoResponse[] = "http://no.org/";
|
| +const char kWarmingURLWithNoContentResponse[] = "http://warm.org/";
|
|
|
| } // namespace
|
|
|
| @@ -309,14 +310,42 @@ TEST_F(DataReductionProxySettingsTest, TestMaybeActivateDataReductionProxy) {
|
| base::MessageLoopForUI loop;
|
| // The proxy is enabled and unrestructed initially.
|
| // Request succeeded but with bad response, expect proxy to be restricted.
|
| - CheckProbe(true, kProbeURLWithBadResponse, "Bad", true, true, true, false);
|
| + CheckProbe(true,
|
| + kProbeURLWithBadResponse,
|
| + kWarmingURLWithNoContentResponse,
|
| + "Bad",
|
| + true,
|
| + true,
|
| + true,
|
| + false);
|
| // Request succeeded with valid response, expect proxy to be unrestricted.
|
| - CheckProbe(true, kProbeURLWithOKResponse, "OK", true, true, false, false);
|
| + CheckProbe(true,
|
| + kProbeURLWithOKResponse,
|
| + kWarmingURLWithNoContentResponse,
|
| + "OK",
|
| + true,
|
| + true,
|
| + false,
|
| + false);
|
| // Request failed, expect proxy to be enabled but restricted.
|
| - CheckProbe(true, kProbeURLWithNoResponse, "", false, true, true, false);
|
| + CheckProbe(true,
|
| + kProbeURLWithNoResponse,
|
| + kWarmingURLWithNoContentResponse,
|
| + "",
|
| + false,
|
| + true,
|
| + true,
|
| + false);
|
| // The proxy is disabled initially. Probes should not be emitted to change
|
| // state.
|
| - CheckProbe(false, kProbeURLWithOKResponse, "OK", true, false, false, false);
|
| + CheckProbe(false,
|
| + kProbeURLWithOKResponse,
|
| + kWarmingURLWithNoContentResponse,
|
| + "OK",
|
| + true,
|
| + false,
|
| + false,
|
| + false);
|
| }
|
|
|
| TEST_F(DataReductionProxySettingsTest, TestOnIPAddressChanged) {
|
| @@ -334,13 +363,33 @@ TEST_F(DataReductionProxySettingsTest, TestOnIPAddressChanged) {
|
| settings_->SetProxyConfigs(true, false, false, true);
|
| // IP address change triggers a probe that succeeds. Proxy remains
|
| // unrestricted.
|
| - CheckProbeOnIPChange(kProbeURLWithOKResponse, "OK", true, false, false);
|
| + CheckProbeOnIPChange(kProbeURLWithOKResponse,
|
| + kWarmingURLWithNoContentResponse,
|
| + "OK",
|
| + true,
|
| + false,
|
| + false);
|
| // IP address change triggers a probe that fails. Proxy is restricted.
|
| - CheckProbeOnIPChange(kProbeURLWithBadResponse, "Bad", true, true, false);
|
| + CheckProbeOnIPChange(kProbeURLWithBadResponse,
|
| + kWarmingURLWithNoContentResponse,
|
| + "Bad",
|
| + true,
|
| + true,
|
| + false);
|
| // IP address change triggers a probe that fails. Proxy remains restricted.
|
| - CheckProbeOnIPChange(kProbeURLWithBadResponse, "Bad", true, true, false);
|
| + CheckProbeOnIPChange(kProbeURLWithBadResponse,
|
| + kWarmingURLWithNoContentResponse,
|
| + "Bad",
|
| + true,
|
| + true,
|
| + false);
|
| // IP address change triggers a probe that succeed. Proxy is unrestricted.
|
| - CheckProbeOnIPChange(kProbeURLWithBadResponse, "OK", true, false, false);
|
| + CheckProbeOnIPChange(kProbeURLWithBadResponse,
|
| + kWarmingURLWithNoContentResponse,
|
| + "OK",
|
| + true,
|
| + false,
|
| + false);
|
| }
|
|
|
| TEST_F(DataReductionProxySettingsTest, TestOnProxyEnabledPrefChange) {
|
|
|