| 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_unittest.h" | 5 #include "chrome/browser/net/spdyproxy/data_reduction_proxy_settings_unittest.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 24 matching lines...) Expand all Loading... |
| 35 public: | 35 public: |
| 36 // DataReductionProxySettingsTest implementation: | 36 // DataReductionProxySettingsTest implementation: |
| 37 virtual void SetUp() OVERRIDE { | 37 virtual void SetUp() OVERRIDE { |
| 38 env_ = base::android::AttachCurrentThread(); | 38 env_ = base::android::AttachCurrentThread(); |
| 39 DataReductionProxySettingsAndroid::Register(env_); | 39 DataReductionProxySettingsAndroid::Register(env_); |
| 40 DataReductionProxySettingsTestBase::SetUp(); | 40 DataReductionProxySettingsTestBase::SetUp(); |
| 41 } | 41 } |
| 42 | 42 |
| 43 void CheckProxyPacPref(const std::string& expected_pac_url, | 43 void CheckProxyPacPref(const std::string& expected_pac_url, |
| 44 const std::string& expected_mode) { | 44 const std::string& expected_mode) { |
| 45 const DictionaryValue* dict = pref_service_.GetDictionary(prefs::kProxy); | 45 const base::DictionaryValue* dict = |
| 46 pref_service_.GetDictionary(prefs::kProxy); |
| 46 std::string mode; | 47 std::string mode; |
| 47 std::string pac_url; | 48 std::string pac_url; |
| 48 dict->GetString("mode", &mode); | 49 dict->GetString("mode", &mode); |
| 49 ASSERT_EQ(expected_mode, mode); | 50 ASSERT_EQ(expected_mode, mode); |
| 50 dict->GetString("pac_url", &pac_url); | 51 dict->GetString("pac_url", &pac_url); |
| 51 ASSERT_EQ(expected_pac_url, pac_url); | 52 ASSERT_EQ(expected_pac_url, pac_url); |
| 52 } | 53 } |
| 53 | 54 |
| 54 DataReductionProxySettingsAndroid* Settings() { | 55 DataReductionProxySettingsAndroid* Settings() { |
| 55 return static_cast<DataReductionProxySettingsAndroid*>(settings_.get()); | 56 return static_cast<DataReductionProxySettingsAndroid*>(settings_.get()); |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 126 ASSERT_EQ(static_cast<jsize>(spdyproxy::kNumDaysInHistory), java_array_len); | 127 ASSERT_EQ(static_cast<jsize>(spdyproxy::kNumDaysInHistory), java_array_len); |
| 127 | 128 |
| 128 jlong value; | 129 jlong value; |
| 129 for (size_t i = 0; i < spdyproxy::kNumDaysInHistory; ++i) { | 130 for (size_t i = 0; i < spdyproxy::kNumDaysInHistory; ++i) { |
| 130 env_->GetLongArrayRegion(result.obj(), i, 1, &value); | 131 env_->GetLongArrayRegion(result.obj(), i, 1, &value); |
| 131 ASSERT_EQ( | 132 ASSERT_EQ( |
| 132 static_cast<long>((spdyproxy::kNumDaysInHistory - 1 - i) * 2), value); | 133 static_cast<long>((spdyproxy::kNumDaysInHistory - 1 - i) * 2), value); |
| 133 } | 134 } |
| 134 } | 135 } |
| 135 | 136 |
| OLD | NEW |