Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_netw ork_delegate.h" | 5 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_netw ork_delegate.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
| 9 #include "base/prefs/pref_registry_simple.h" | 9 #include "base/prefs/pref_registry_simple.h" |
| 10 #include "base/prefs/testing_pref_service.h" | 10 #include "base/prefs/testing_pref_service.h" |
| 11 #include "base/run_loop.h" | 11 #include "base/run_loop.h" |
| 12 #include "base/strings/string_number_conversions.h" | 12 #include "base/strings/string_number_conversions.h" |
| 13 #include "base/test/histogram_tester.h" | 13 #include "base/test/histogram_tester.h" |
| 14 #include "base/time/time.h" | 14 #include "base/time/time.h" |
| 15 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_auth _request_handler.h" | 15 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_auth _request_handler.h" |
| 16 #include "components/data_reduction_proxy/core/common/data_reduction_proxy_heade rs_test_utils.h" | 16 #include "components/data_reduction_proxy/core/common/data_reduction_proxy_heade rs_test_utils.h" |
| 17 #include "components/data_reduction_proxy/core/common/data_reduction_proxy_param s_test_utils.h" | 17 #include "components/data_reduction_proxy/core/common/data_reduction_proxy_param s_test_utils.h" |
| 18 #include "components/data_reduction_proxy/core/common/data_reduction_proxy_pref_ names.h" | 18 #include "components/data_reduction_proxy/core/common/data_reduction_proxy_pref_ names.h" |
| 19 #include "net/http/http_response_headers.h" | 19 #include "net/http/http_response_headers.h" |
| 20 #include "net/url_request/url_request.h" | 20 #include "net/url_request/url_request.h" |
| 21 #include "net/url_request/url_request_job_factory_impl.h" | 21 #include "net/url_request/url_request_job_factory_impl.h" |
| 22 #include "net/url_request/url_request_test_job.h" | 22 #include "net/url_request/url_request_test_job.h" |
| 23 #include "net/url_request/url_request_test_util.h" | 23 #include "net/url_request/url_request_test_util.h" |
| 24 #include "testing/gtest/include/gtest/gtest.h" | 24 #include "testing/gtest/include/gtest/gtest.h" |
| 25 | 25 |
| 26 namespace data_reduction_proxy { | 26 namespace data_reduction_proxy { |
| 27 namespace { | 27 namespace { |
| 28 | 28 |
| 29 class TestNetworkDelegate : public net::NetworkDelegateImpl { | 29 typedef net::NetworkDelegateImpl TestNetworkDelegate; |
|
Nico
2014/12/29 22:17:40
using TestNetworkDelegate = net::NetworkDelegateIm
dcheng
2014/12/29 23:39:28
Done.
| |
| 30 public: | |
| 31 TestNetworkDelegate() { | |
| 32 } | |
| 33 | |
| 34 virtual ~TestNetworkDelegate() { | |
| 35 } | |
| 36 }; | |
| 37 | 30 |
| 38 const char kChromeProxyHeader[] = "chrome-proxy"; | 31 const char kChromeProxyHeader[] = "chrome-proxy"; |
| 39 | 32 |
| 40 #if defined(OS_ANDROID) | 33 #if defined(OS_ANDROID) |
| 41 const Client kClient = Client::CHROME_ANDROID; | 34 const Client kClient = Client::CHROME_ANDROID; |
| 42 #elif defined(OS_IOS) | 35 #elif defined(OS_IOS) |
| 43 const Client kClient = Client::CHROME_IOS; | 36 const Client kClient = Client::CHROME_IOS; |
| 44 #elif defined(OS_MACOSX) | 37 #elif defined(OS_MACOSX) |
| 45 const Client kClient = Client::CHROME_MAC; | 38 const Client kClient = Client::CHROME_MAC; |
| 46 #elif defined(OS_CHROMEOS) | 39 #elif defined(OS_CHROMEOS) |
| (...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 301 kReceivedLength); | 294 kReceivedLength); |
| 302 | 295 |
| 303 stats_value.reset( | 296 stats_value.reset( |
| 304 DataReductionProxyNetworkDelegate::HistoricNetworkStatsInfoToValue( | 297 DataReductionProxyNetworkDelegate::HistoricNetworkStatsInfoToValue( |
| 305 &simple_pref_service_)); | 298 &simple_pref_service_)); |
| 306 EXPECT_TRUE(stats_value->GetAsDictionary(&dict)); | 299 EXPECT_TRUE(stats_value->GetAsDictionary(&dict)); |
| 307 VerifyPrefs(dict); | 300 VerifyPrefs(dict); |
| 308 } | 301 } |
| 309 | 302 |
| 310 } // namespace data_reduction_proxy | 303 } // namespace data_reduction_proxy |
| OLD | NEW |