Chromium Code Reviews| 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 settings_->SetDataReductionProxyStatistics(statistics_prefs_.get()); |
|
sgurun-gerrit only
2014/10/17 20:29:38
why change name?
hush (inactive)
2014/10/17 21:19:47
the idea of the base class "DataReductionProxyStat
| |
| 80 } | 80 } |
| 81 | 81 |
| 82 template <class C> | 82 template <class C> |
| 83 void data_reduction_proxy::DataReductionProxySettingsTestBase::SetProbeResult( | 83 void data_reduction_proxy::DataReductionProxySettingsTestBase::SetProbeResult( |
| 84 const std::string& test_url, | 84 const std::string& test_url, |
| 85 const std::string& response, | 85 const std::string& response, |
| 86 ProbeURLFetchResult result, | 86 ProbeURLFetchResult result, |
| 87 bool success, | 87 bool success, |
| 88 int expected_calls) { | 88 int expected_calls) { |
| 89 MockDataReductionProxySettings<C>* settings = | 89 MockDataReductionProxySettings<C>* settings = |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 187 | 187 |
| 188 jlong value; | 188 jlong value; |
| 189 for (size_t i = 0; i < data_reduction_proxy::kNumDaysInHistory; ++i) { | 189 for (size_t i = 0; i < data_reduction_proxy::kNumDaysInHistory; ++i) { |
| 190 env_->GetLongArrayRegion(result.obj(), i, 1, &value); | 190 env_->GetLongArrayRegion(result.obj(), i, 1, &value); |
| 191 ASSERT_EQ( | 191 ASSERT_EQ( |
| 192 static_cast<long>( | 192 static_cast<long>( |
| 193 (data_reduction_proxy::kNumDaysInHistory - 1 - i) * 2), value); | 193 (data_reduction_proxy::kNumDaysInHistory - 1 - i) * 2), value); |
| 194 } | 194 } |
| 195 } | 195 } |
| 196 | 196 |
| OLD | NEW |