OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #include "cronet_url_request_context_config_test.h" | |
6 | |
7 #include <jni.h> | |
8 | |
9 #include "base/android/jni_android.h" | |
xunjieli
2015/12/01 17:30:38
Need to include base/logging.h for CHECK_EQ
pauljensen
2015/12/02 03:50:02
Done.
| |
10 #include "base/android/jni_string.h" | |
11 #include "base/android/scoped_java_ref.h" | |
12 #include "components/cronet/url_request_context_config.h" | |
13 #include "jni/CronetUrlRequestContextTest_jni.h" | |
14 | |
15 namespace cronet { | |
16 | |
17 // Verify that all the config set by | |
xunjieli
2015/12/01 17:30:38
nit: s/Verify/Verifies
s/config/configurations
pauljensen
2015/12/02 03:50:02
Done.
| |
18 // CronetUrlRequestContextTest.testCronetEngineBuilderConfig | |
19 // made it from the CronetEngine.Builder to the URLRequestContextConfig. | |
20 static void VerifyUrlRequestContextConfig( | |
21 JNIEnv* env, | |
22 const JavaParamRef<jclass>& jcaller, | |
23 jlong jurl_request_context_config, | |
24 const JavaParamRef<jstring>& jstorage_path) { | |
25 URLRequestContextConfig* config = | |
26 reinterpret_cast<URLRequestContextConfig*>(jurl_request_context_config); | |
27 CHECK_EQ(config->enable_spdy, false); | |
28 CHECK_EQ(config->enable_quic, true); | |
29 CHECK_EQ(config->enable_sdch, true); | |
30 CHECK_EQ(config->quic_hints.size(), 1u); | |
31 CHECK_EQ((*config->quic_hints.begin())->host, "example.com"); | |
32 CHECK_EQ((*config->quic_hints.begin())->port, 12); | |
33 CHECK_EQ((*config->quic_hints.begin())->alternate_port, 34); | |
34 CHECK_EQ(config->load_disable_cache, false); | |
35 CHECK_EQ(config->http_cache, URLRequestContextConfig::HttpCacheType::MEMORY); | |
36 CHECK_EQ(config->http_cache_max_size, 54321); | |
37 CHECK_EQ(config->data_reduction_proxy_key, "abcd"); | |
38 CHECK_EQ(config->user_agent, "efgh"); | |
39 CHECK_EQ(config->experimental_options, "ijkl"); | |
40 CHECK_EQ(config->data_reduction_primary_proxy, "mnop"); | |
41 CHECK_EQ(config->data_reduction_fallback_proxy, "qrst"); | |
42 CHECK_EQ(config->data_reduction_secure_proxy_check_url, "uvwx"); | |
43 CHECK_EQ(config->storage_path, | |
44 base::android::ConvertJavaStringToUTF8(env, jstorage_path)); | |
45 } | |
46 | |
47 bool RegisterCronetUrlRequestContextConfigTest(JNIEnv* env) { | |
48 return RegisterNativesImpl(env); | |
49 } | |
50 | |
51 } // namespace cronet | |
OLD | NEW |