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 | 7 |
8 #include "base/android/jni_android.h" | 8 #include "base/android/jni_android.h" |
9 #include "base/android/jni_string.h" | 9 #include "base/android/jni_string.h" |
10 #include "base/android/scoped_java_ref.h" | 10 #include "base/android/scoped_java_ref.h" |
11 #include "base/base64.h" | 11 #include "base/base64.h" |
12 #include "base/command_line.h" | 12 #include "base/command_line.h" |
13 #include "base/metrics/field_trial.h" | 13 #include "base/metrics/field_trial.h" |
14 #include "base/prefs/pref_service.h" | 14 #include "base/prefs/pref_service.h" |
15 #include "base/prefs/testing_pref_service.h" | 15 #include "base/prefs/testing_pref_service.h" |
16 #include "base/strings/string_number_conversions.h" | 16 #include "base/strings/string_number_conversions.h" |
17 #include "chrome/browser/net/spdyproxy/data_reduction_proxy_settings_android.h" | 17 #include "chrome/browser/net/spdyproxy/data_reduction_proxy_settings_android.h" |
18 #include "chrome/browser/prefs/proxy_prefs.h" | 18 #include "chrome/browser/prefs/proxy_prefs.h" |
19 #include "chrome/browser/prefs/scoped_user_pref_update.h" | 19 #include "chrome/browser/prefs/scoped_user_pref_update.h" |
20 #include "chrome/common/chrome_switches.h" | 20 #include "chrome/common/chrome_switches.h" |
21 #include "chrome/common/metrics/variations/variations_util.h" | 21 #include "chrome/common/metrics/variations/variations_util.h" |
22 #include "chrome/common/pref_names.h" | 22 #include "chrome/common/pref_names.h" |
23 #include "components/variations/entropy_provider.h" | 23 #include "components/variations/entropy_provider.h" |
24 #include "net/url_request/test_url_fetcher_factory.h" | 24 #include "net/url_request/test_url_fetcher_factory.h" |
25 #include "testing/gtest/include/gtest/gtest.h" | 25 #include "testing/gtest/include/gtest/gtest.h" |
26 #include "url/gurl.h" | 26 #include "url/gurl.h" |
27 | 27 |
28 const char kDataReductionProxyOrigin[] = "https://foo:443/"; | 28 const char kDataReductionProxyOrigin[] = "https://foo:443/"; |
29 const char kDataReductionProxyOriginHostPort[] = "foo:443"; | |
30 const char kDataReductionProxyAuth[] = "12345"; | 29 const char kDataReductionProxyAuth[] = "12345"; |
31 | 30 |
32 class TestDataReductionProxySettingsAndroid | 31 class TestDataReductionProxySettingsAndroid |
33 : public DataReductionProxySettingsAndroid { | 32 : public DataReductionProxySettingsAndroid { |
34 public: | 33 public: |
35 TestDataReductionProxySettingsAndroid(JNIEnv* env, | 34 TestDataReductionProxySettingsAndroid(JNIEnv* env, |
36 jobject obj, | 35 jobject obj, |
37 PrefService* profile_prefs, | 36 PrefService* profile_prefs, |
38 PrefService* local_state_prefs) | 37 PrefService* local_state_prefs) |
39 : DataReductionProxySettingsAndroid(env, obj), | 38 : DataReductionProxySettingsAndroid(env, obj), |
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
200 ASSERT_EQ(static_cast<jsize>(spdyproxy::kNumDaysInHistory), java_array_len); | 199 ASSERT_EQ(static_cast<jsize>(spdyproxy::kNumDaysInHistory), java_array_len); |
201 | 200 |
202 jlong value; | 201 jlong value; |
203 for (size_t i = 0; i < spdyproxy::kNumDaysInHistory; ++i) { | 202 for (size_t i = 0; i < spdyproxy::kNumDaysInHistory; ++i) { |
204 env_->GetLongArrayRegion(result.obj(), i, 1, &value); | 203 env_->GetLongArrayRegion(result.obj(), i, 1, &value); |
205 ASSERT_EQ( | 204 ASSERT_EQ( |
206 static_cast<long>((spdyproxy::kNumDaysInHistory - 1 - i) * 2), value); | 205 static_cast<long>((spdyproxy::kNumDaysInHistory - 1 - i) * 2), value); |
207 } | 206 } |
208 } | 207 } |
209 | 208 |
OLD | NEW |