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

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

Issue 880963006: Create a new DataReductionProxyConfig class (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 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
new file mode 100644
index 0000000000000000000000000000000000000000..e28ee88db4cad47b45177a25d4de3869e92e2695
--- /dev/null
+++ b/components/data_reduction_proxy/core/browser/data_reduction_proxy_config_test_utils.h
@@ -0,0 +1,49 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef COMPONENTS_DATA_REDUCTION_PROXY_CORE_BROWSER_DATA_REDUCTION_PROXY_CONFIG_TEST_UTILS_H_
+#define COMPONENTS_DATA_REDUCTION_PROXY_CORE_BROWSER_DATA_REDUCTION_PROXY_CONFIG_TEST_UTILS_H_
+
+#include "base/memory/scoped_ptr.h"
+#include "components/data_reduction_proxy/core/browser/data_reduction_proxy_config.h"
+#include "net/base/net_util.h"
+#include "testing/gmock/include/gmock/gmock.h"
+
+namespace net {
+class URLFetcher;
+}
+
+namespace data_reduction_proxy {
+
+class MockDataReductionProxyConfig : public DataReductionProxyConfig {
+ public:
+ MockDataReductionProxyConfig();
+ MockDataReductionProxyConfig(int flags);
+ ~MockDataReductionProxyConfig() override;
+
+ MOCK_METHOD0(GetURLFetcherForProbe, net::URLFetcher*());
+ MOCK_METHOD1(RecordProbeURLFetchResult, void(ProbeURLFetchResult result));
+ MOCK_METHOD3(LogProxyState,
+ void(bool enabled, bool restricted, bool at_startup));
+
+ // SetProxyConfigs should always call LogProxyState exactly once.
+ virtual void SetProxyConfigs(bool enabled,
+ bool alternative_enabled,
+ bool restricted,
+ bool at_startup) override;
+
+ virtual void GetNetworkList(net::NetworkInterfaceList* interfaces,
+ int policy) override;
+
+ net::NetworkInterfaceList* interfaces() {
+ return network_interfaces_.get();
+ }
+
+ private:
+ scoped_ptr<net::NetworkInterfaceList> network_interfaces_;
+};
+
+} // namespace data_reduction_proxy
+
+#endif // COMPONENTS_DATA_REDUCTION_PROXY_CORE_BROWSER_DATA_REDUCTION_PROXY_CONFIG_TEST_UTILS_H_

Powered by Google App Engine
This is Rietveld 408576698