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

Unified Diff: components/data_reduction_proxy/core/browser/data_reduction_proxy_config_test_utils.h

Issue 2426903003: Record Proxy Server scheme accurately (Closed)
Patch Set: addressed comments, moved various other tests from Mock framework Created 4 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
Index: components/data_reduction_proxy/core/browser/data_reduction_proxy_config_test_utils.h
diff --git a/components/data_reduction_proxy/core/browser/data_reduction_proxy_config_test_utils.h b/components/data_reduction_proxy/core/browser/data_reduction_proxy_config_test_utils.h
index 94425c60ee89b9a80ad86fac2bb4060bcc322c68..4d00ecb0c96395ff8bb83f5a21569526511269ae 100644
--- a/components/data_reduction_proxy/core/browser/data_reduction_proxy_config_test_utils.h
+++ b/components/data_reduction_proxy/core/browser/data_reduction_proxy_config_test_utils.h
@@ -10,6 +10,7 @@
#include "base/macros.h"
#include "base/memory/ref_counted.h"
+#include "base/optional.h"
#include "base/time/time.h"
#include "components/data_reduction_proxy/core/browser/data_reduction_proxy_config.h"
#include "net/base/network_interfaces.h"
@@ -102,9 +103,27 @@ class TestDataReductionProxyConfig : public DataReductionProxyConfig {
base::TimeTicks GetTicksNow() const override;
+ bool WasDataReductionProxyUsed(
+ const net::URLRequest* request,
+ DataReductionProxyTypeInfo* proxy_info) const override;
+
+ // Sets the data reduction proxy as not used. Subsequent calls to
+ // WasDataReductionProxyUsed() would return false.
+ void SetWasDataReductionProxyNotUsed();
+
+ // Sets the proxy index of the data reduction proxy. Subsequent calls to
+ // WasDataReductionProxyUsed are affected.
+ void SetWasDataReductionProxyUsedProxyIndex(int proxy_index);
+
+ // Resets the behavior of WasDataReductionProxyUsed() calls.
+ void ResetWasDataReductionProxyUsed();
+
private:
base::TickClock* tick_clock_;
+ base::Optional<bool> was_data_reduction_proxy_used_;
+ base::Optional<int> proxy_index_;
+
std::unique_ptr<net::NetworkInterfaceList> network_interfaces_;
bool network_quality_prohibitively_slow_set_;

Powered by Google App Engine
This is Rietveld 408576698