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

Side by Side Diff: components/data_reduction_proxy/browser/data_reduction_proxy_settings_test_utils.h

Issue 373153003: Bypass data reduction proxy when using VPN (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 5 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef COMPONENTS_DATA_REDUCTION_PROXY_BROWSER_DATA_REDUCTION_PROXY_SETTINGS_TE ST_UTILS_H_ 5 #ifndef COMPONENTS_DATA_REDUCTION_PROXY_BROWSER_DATA_REDUCTION_PROXY_SETTINGS_TE ST_UTILS_H_
6 #define COMPONENTS_DATA_REDUCTION_PROXY_BROWSER_DATA_REDUCTION_PROXY_SETTINGS_TE ST_UTILS_H_ 6 #define COMPONENTS_DATA_REDUCTION_PROXY_BROWSER_DATA_REDUCTION_PROXY_SETTINGS_TE ST_UTILS_H_
7 7
8 8
9 #include "base/memory/scoped_ptr.h"
9 #include "base/prefs/testing_pref_service.h" 10 #include "base/prefs/testing_pref_service.h"
10 #include "components/data_reduction_proxy/browser/data_reduction_proxy_configura tor.h" 11 #include "components/data_reduction_proxy/browser/data_reduction_proxy_configura tor.h"
11 #include "components/data_reduction_proxy/browser/data_reduction_proxy_params_te st_utils.h" 12 #include "components/data_reduction_proxy/browser/data_reduction_proxy_params_te st_utils.h"
12 #include "components/data_reduction_proxy/browser/data_reduction_proxy_settings. h" 13 #include "components/data_reduction_proxy/browser/data_reduction_proxy_settings. h"
14 #include "net/base/net_util.h"
13 #include "net/url_request/test_url_fetcher_factory.h" 15 #include "net/url_request/test_url_fetcher_factory.h"
14 #include "net/url_request/url_request_test_util.h" 16 #include "net/url_request/url_request_test_util.h"
15 #include "testing/gmock/include/gmock/gmock.h" 17 #include "testing/gmock/include/gmock/gmock.h"
16 #include "testing/gtest/include/gtest/gtest.h" 18 #include "testing/gtest/include/gtest/gtest.h"
17 19
18 class PrefService; 20 class PrefService;
19 class TestingPrefServiceSimple; 21 class TestingPrefServiceSimple;
20 22
21 namespace data_reduction_proxy { 23 namespace data_reduction_proxy {
22 24
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 void(ProxyStartupState state)); 80 void(ProxyStartupState state));
79 81
80 // SetProxyConfigs should always call LogProxyState exactly once. 82 // SetProxyConfigs should always call LogProxyState exactly once.
81 virtual void SetProxyConfigs(bool enabled, 83 virtual void SetProxyConfigs(bool enabled,
82 bool alternative_enabled, 84 bool alternative_enabled,
83 bool restricted, 85 bool restricted,
84 bool at_startup) OVERRIDE { 86 bool at_startup) OVERRIDE {
85 EXPECT_CALL(*this, LogProxyState(enabled, restricted, at_startup)).Times(1); 87 EXPECT_CALL(*this, LogProxyState(enabled, restricted, at_startup)).Times(1);
86 C::SetProxyConfigs(enabled, alternative_enabled, restricted, at_startup); 88 C::SetProxyConfigs(enabled, alternative_enabled, restricted, at_startup);
87 } 89 }
90 virtual void GetNetworkList(net::NetworkInterfaceList* interfaces,
91 int policy) OVERRIDE {
92 if (!network_interfaces_.get())
93 return;
94 for (size_t i = 0; i < network_interfaces_->size(); ++i)
95 interfaces->push_back(network_interfaces_->at(i));
96 }
97
98 scoped_ptr<net::NetworkInterfaceList> network_interfaces_;
88 }; 99 };
89 100
90 class DataReductionProxySettingsTestBase : public testing::Test { 101 class DataReductionProxySettingsTestBase : public testing::Test {
91 public: 102 public:
92 static void AddTestProxyToCommandLine(); 103 static void AddTestProxyToCommandLine();
93 104
94 DataReductionProxySettingsTestBase(); 105 DataReductionProxySettingsTestBase();
95 DataReductionProxySettingsTestBase(bool allowed, 106 DataReductionProxySettingsTestBase(bool allowed,
96 bool fallback_allowed, 107 bool fallback_allowed,
97 bool alt_allowed, 108 bool alt_allowed,
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
179 response, 190 response,
180 result, 191 result,
181 success, 192 success,
182 expected_calls); 193 expected_calls);
183 } 194 }
184 }; 195 };
185 196
186 } // namespace data_reduction_proxy 197 } // namespace data_reduction_proxy
187 198
188 #endif // COMPONENTS_DATA_REDUCTION_PROXY_BROWSER_DATA_REDUCTION_PROXY_SETTINGS _TEST_UTILS_H_ 199 #endif // COMPONENTS_DATA_REDUCTION_PROXY_BROWSER_DATA_REDUCTION_PROXY_SETTINGS _TEST_UTILS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698