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

Unified Diff: components/data_reduction_proxy/core/common/data_reduction_proxy_params_test_utils.h

Issue 684223003: Data Reduction Proxy Interstitials (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Thestig comment and test fix Created 5 years, 10 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
Index: components/data_reduction_proxy/core/common/data_reduction_proxy_params_test_utils.h
diff --git a/components/data_reduction_proxy/core/common/data_reduction_proxy_params_test_utils.h b/components/data_reduction_proxy/core/common/data_reduction_proxy_params_test_utils.h
index 8357d24d3763af0fed23151c1bd6edf0571787ba..4a797f039498d94f641483181f745c3f05c70e49 100644
--- a/components/data_reduction_proxy/core/common/data_reduction_proxy_params_test_utils.h
+++ b/components/data_reduction_proxy/core/common/data_reduction_proxy_params_test_utils.h
@@ -7,8 +7,14 @@
#include "components/data_reduction_proxy/core/common/data_reduction_proxy_params.h"
+namespace base {
+class TimeDelta;
+}
+
namespace net {
+class ProxyConfig;
class ProxyServer;
+class URLRequest;
}
namespace data_reduction_proxy {
@@ -33,6 +39,19 @@ class TestDataReductionProxyParams : public DataReductionProxyParams {
unsigned int has_definitions);
bool init_result() const;
+ // Overrides from DataReductionProxyParams.
+ bool IsBypassedByDataReductionProxyLocalRules(
+ const net::URLRequest& request,
+ const net::ProxyConfig& data_reduction_proxy_config) const override;
+ bool AreDataReductionProxiesBypassed(
+ const net::URLRequest& request,
+ const net::ProxyConfig& data_reduction_proxy_config,
+ base::TimeDelta* min_retry_delay) const override;
+
+ // Once called, the mocked method will repeatedly return |return_value|.
+ void MockIsBypassedByDataReductionProxyLocalRules(bool return_value);
+ void MockAreDataReductionProxiesBypassed(bool return_value);
+
// Test values to replace the values specified in preprocessor defines.
static std::string DefaultDevOrigin();
static std::string DefaultDevFallbackOrigin();
@@ -76,6 +95,11 @@ class TestDataReductionProxyParams : public DataReductionProxyParams {
unsigned int has_definitions_;
bool init_result_;
+
+ bool mock_is_bypassed_by_data_reduction_proxy_local_rules_;
+ bool mock_are_data_reduction_proxies_bypassed_;
+ bool is_bypassed_by_data_reduction_proxy_local_rules_return_value_;
+ bool are_data_reduction_proxies_bypassed_return_value_;
};
} // namespace data_reduction_proxy
#endif // COMPONENTS_DATA_REDUCTION_PROXY_CORE_BROWSER_DATA_REDUCTION_PROXY_PARAMS_TEST_UTILS_H_

Powered by Google App Engine
This is Rietveld 408576698