Create a new DataReductionProxyConfig class
[chromium-blink-merge.git] / components / data_reduction_proxy / core / browser / data_reduction_proxy_config_test_utils.h
blobe28ee88db4cad47b45177a25d4de3869e92e2695
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef COMPONENTS_DATA_REDUCTION_PROXY_CORE_BROWSER_DATA_REDUCTION_PROXY_CONFIG_TEST_UTILS_H_
6 #define COMPONENTS_DATA_REDUCTION_PROXY_CORE_BROWSER_DATA_REDUCTION_PROXY_CONFIG_TEST_UTILS_H_
8 #include "base/memory/scoped_ptr.h"
9 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_config.h"
10 #include "net/base/net_util.h"
11 #include "testing/gmock/include/gmock/gmock.h"
13 namespace net {
14 class URLFetcher;
17 namespace data_reduction_proxy {
19 class MockDataReductionProxyConfig : public DataReductionProxyConfig {
20 public:
21 MockDataReductionProxyConfig();
22 MockDataReductionProxyConfig(int flags);
23 ~MockDataReductionProxyConfig() override;
25 MOCK_METHOD0(GetURLFetcherForProbe, net::URLFetcher*());
26 MOCK_METHOD1(RecordProbeURLFetchResult, void(ProbeURLFetchResult result));
27 MOCK_METHOD3(LogProxyState,
28 void(bool enabled, bool restricted, bool at_startup));
30 // SetProxyConfigs should always call LogProxyState exactly once.
31 virtual void SetProxyConfigs(bool enabled,
32 bool alternative_enabled,
33 bool restricted,
34 bool at_startup) override;
36 virtual void GetNetworkList(net::NetworkInterfaceList* interfaces,
37 int policy) override;
39 net::NetworkInterfaceList* interfaces() {
40 return network_interfaces_.get();
43 private:
44 scoped_ptr<net::NetworkInterfaceList> network_interfaces_;
47 } // namespace data_reduction_proxy
49 #endif // COMPONENTS_DATA_REDUCTION_PROXY_CORE_BROWSER_DATA_REDUCTION_PROXY_CONFIG_TEST_UTILS_H_