Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(78)

Side by Side Diff: components/cronet/android/test/cronet_url_request_context_config_test.cc

Issue 2052363002: Enable public key pinning of local trust anchors (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 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 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 "cronet_url_request_context_config_test.h" 5 #include "cronet_url_request_context_config_test.h"
6 6
7 #include <jni.h> 7 #include <jni.h>
8 8
9 #include "base/android/jni_android.h" 9 #include "base/android/jni_android.h"
10 #include "base/android/jni_string.h" 10 #include "base/android/jni_string.h"
(...skipping 11 matching lines...) Expand all
22 static void VerifyUrlRequestContextConfig( 22 static void VerifyUrlRequestContextConfig(
23 JNIEnv* env, 23 JNIEnv* env,
24 const JavaParamRef<jclass>& jcaller, 24 const JavaParamRef<jclass>& jcaller,
25 jlong jurl_request_context_config, 25 jlong jurl_request_context_config,
26 const JavaParamRef<jstring>& jstorage_path) { 26 const JavaParamRef<jstring>& jstorage_path) {
27 URLRequestContextConfig* config = 27 URLRequestContextConfig* config =
28 reinterpret_cast<URLRequestContextConfig*>(jurl_request_context_config); 28 reinterpret_cast<URLRequestContextConfig*>(jurl_request_context_config);
29 CHECK_EQ(config->enable_spdy, false); 29 CHECK_EQ(config->enable_spdy, false);
30 CHECK_EQ(config->enable_quic, true); 30 CHECK_EQ(config->enable_quic, true);
31 CHECK_EQ(config->enable_sdch, true); 31 CHECK_EQ(config->enable_sdch, true);
32 CHECK_EQ(config->pin_local_trust_anchors, true);
32 CHECK_EQ(config->quic_hints.size(), 1u); 33 CHECK_EQ(config->quic_hints.size(), 1u);
33 CHECK_EQ((*config->quic_hints.begin())->host, "example.com"); 34 CHECK_EQ((*config->quic_hints.begin())->host, "example.com");
34 CHECK_EQ((*config->quic_hints.begin())->port, 12); 35 CHECK_EQ((*config->quic_hints.begin())->port, 12);
35 CHECK_EQ((*config->quic_hints.begin())->alternate_port, 34); 36 CHECK_EQ((*config->quic_hints.begin())->alternate_port, 34);
36 CHECK_NE(config->quic_user_agent_id.find("Cronet/" CRONET_VERSION), 37 CHECK_NE(config->quic_user_agent_id.find("Cronet/" CRONET_VERSION),
37 std::string::npos); 38 std::string::npos);
38 CHECK_EQ(config->load_disable_cache, false); 39 CHECK_EQ(config->load_disable_cache, false);
39 CHECK_EQ(config->http_cache, URLRequestContextConfig::HttpCacheType::MEMORY); 40 CHECK_EQ(config->http_cache, URLRequestContextConfig::HttpCacheType::MEMORY);
40 CHECK_EQ(config->http_cache_max_size, 54321); 41 CHECK_EQ(config->http_cache_max_size, 54321);
41 CHECK_EQ(config->data_reduction_proxy_key, "abcd"); 42 CHECK_EQ(config->data_reduction_proxy_key, "abcd");
42 CHECK_EQ(config->user_agent, "efgh"); 43 CHECK_EQ(config->user_agent, "efgh");
43 CHECK_EQ(config->experimental_options, "ijkl"); 44 CHECK_EQ(config->experimental_options, "ijkl");
44 CHECK_EQ(config->data_reduction_primary_proxy, "mnop"); 45 CHECK_EQ(config->data_reduction_primary_proxy, "mnop");
45 CHECK_EQ(config->data_reduction_fallback_proxy, "qrst"); 46 CHECK_EQ(config->data_reduction_fallback_proxy, "qrst");
46 CHECK_EQ(config->data_reduction_secure_proxy_check_url, "uvwx"); 47 CHECK_EQ(config->data_reduction_secure_proxy_check_url, "uvwx");
47 CHECK_EQ(config->storage_path, 48 CHECK_EQ(config->storage_path,
48 base::android::ConvertJavaStringToUTF8(env, jstorage_path)); 49 base::android::ConvertJavaStringToUTF8(env, jstorage_path));
49 } 50 }
50 51
51 bool RegisterCronetUrlRequestContextConfigTest(JNIEnv* env) { 52 bool RegisterCronetUrlRequestContextConfigTest(JNIEnv* env) {
52 return RegisterNativesImpl(env); 53 return RegisterNativesImpl(env);
53 } 54 }
54 55
55 } // namespace cronet 56 } // namespace cronet
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698