OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "chrome/browser/net/spdyproxy/data_reduction_proxy_settings_android.h" | 5 #include "chrome/browser/net/spdyproxy/data_reduction_proxy_settings_android.h" |
6 | 6 |
7 #include "base/android/jni_android.h" | 7 #include "base/android/jni_android.h" |
8 #include "base/android/jni_string.h" | 8 #include "base/android/jni_string.h" |
9 #include "base/android/scoped_java_ref.h" | 9 #include "base/android/scoped_java_ref.h" |
10 #include "base/base64.h" | 10 #include "base/base64.h" |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 new MockDataReductionProxySettings<C>(flags); | 69 new MockDataReductionProxySettings<C>(flags); |
70 EXPECT_CALL(*settings, GetOriginalProfilePrefs()) | 70 EXPECT_CALL(*settings, GetOriginalProfilePrefs()) |
71 .Times(AnyNumber()) | 71 .Times(AnyNumber()) |
72 .WillRepeatedly(Return(&pref_service_)); | 72 .WillRepeatedly(Return(&pref_service_)); |
73 EXPECT_CALL(*settings, GetLocalStatePrefs()) | 73 EXPECT_CALL(*settings, GetLocalStatePrefs()) |
74 .Times(AnyNumber()) | 74 .Times(AnyNumber()) |
75 .WillRepeatedly(Return(&pref_service_)); | 75 .WillRepeatedly(Return(&pref_service_)); |
76 EXPECT_CALL(*settings, GetURLFetcherForAvailabilityCheck()).Times(0); | 76 EXPECT_CALL(*settings, GetURLFetcherForAvailabilityCheck()).Times(0); |
77 EXPECT_CALL(*settings, LogProxyState(_, _, _)).Times(0); | 77 EXPECT_CALL(*settings, LogProxyState(_, _, _)).Times(0); |
78 settings_.reset(settings); | 78 settings_.reset(settings); |
| 79 settings_->SetDataReductionProxyStatisticsPrefs(statistics_prefs_.get()); |
79 } | 80 } |
80 | 81 |
81 template <class C> | 82 template <class C> |
82 void data_reduction_proxy::DataReductionProxySettingsTestBase::SetProbeResult( | 83 void data_reduction_proxy::DataReductionProxySettingsTestBase::SetProbeResult( |
83 const std::string& test_url, | 84 const std::string& test_url, |
84 const std::string& warmup_test_url, | 85 const std::string& warmup_test_url, |
85 const std::string& response, | 86 const std::string& response, |
86 ProbeURLFetchResult result, | 87 ProbeURLFetchResult result, |
87 bool success, | 88 bool success, |
88 int expected_calls) { | 89 int expected_calls) { |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
188 | 189 |
189 jlong value; | 190 jlong value; |
190 for (size_t i = 0; i < data_reduction_proxy::kNumDaysInHistory; ++i) { | 191 for (size_t i = 0; i < data_reduction_proxy::kNumDaysInHistory; ++i) { |
191 env_->GetLongArrayRegion(result.obj(), i, 1, &value); | 192 env_->GetLongArrayRegion(result.obj(), i, 1, &value); |
192 ASSERT_EQ( | 193 ASSERT_EQ( |
193 static_cast<long>( | 194 static_cast<long>( |
194 (data_reduction_proxy::kNumDaysInHistory - 1 - i) * 2), value); | 195 (data_reduction_proxy::kNumDaysInHistory - 1 - i) * 2), value); |
195 } | 196 } |
196 } | 197 } |
197 | 198 |
OLD | NEW |