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

Side by Side Diff: android_webview/native/aw_contents_client_bridge_unittest.cc

Issue 1133863004: Prune some remnants of DSA client certificate support. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: test server Created 5 years, 7 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "android_webview/native/aw_contents_client_bridge.h" 5 #include "android_webview/native/aw_contents_client_bridge.h"
6 6
7 #include "base/android/jni_android.h" 7 #include "base/android/jni_android.h"
8 #include "base/android/jni_array.h" 8 #include "base/android/jni_array.h"
9 #include "base/android/scoped_java_ref.h" 9 #include "base/android/scoped_java_ref.h"
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 cert_selected_callbacks_ = 0; 85 cert_selected_callbacks_ = 0;
86 cert_request_info_ = new net::SSLCertRequestInfo; 86 cert_request_info_ = new net::SSLCertRequestInfo;
87 } 87 }
88 88
89 void AwContentsClientBridgeTest::CertSelected(X509Certificate* cert) { 89 void AwContentsClientBridgeTest::CertSelected(X509Certificate* cert) {
90 selected_cert_ = cert; 90 selected_cert_ = cert;
91 cert_selected_callbacks_++; 91 cert_selected_callbacks_++;
92 } 92 }
93 93
94 TEST_F(AwContentsClientBridgeTest, TestClientCertKeyTypesCorrectlyEncoded) { 94 TEST_F(AwContentsClientBridgeTest, TestClientCertKeyTypesCorrectlyEncoded) {
95 SSLClientCertType cert_types[3] = {net::CLIENT_CERT_RSA_SIGN, 95 SSLClientCertType cert_types[2] = {net::CLIENT_CERT_RSA_SIGN,
96 net::CLIENT_CERT_DSS_SIGN, net::CLIENT_CERT_ECDSA_SIGN}; 96 net::CLIENT_CERT_ECDSA_SIGN};
97 std::string expected_names[3] = {"RSA", "DSA" ,"ECDSA"}; 97 std::string expected_names[2] = {"RSA", "ECDSA"};
98 98
99 for(int i = 0; i < 3; i++) { 99 for (int i = 0; i < 2; i++) {
100 TestCertType(cert_types[i], expected_names[i]); 100 TestCertType(cert_types[i], expected_names[i]);
101 } 101 }
102 } 102 }
103 103
104 void AwContentsClientBridgeTest::TestCertType(SSLClientCertType type, 104 void AwContentsClientBridgeTest::TestCertType(SSLClientCertType type,
105 const std::string& expected_name) { 105 const std::string& expected_name) {
106 cert_request_info_->cert_key_types.clear(); 106 cert_request_info_->cert_key_types.clear();
107 cert_request_info_->cert_key_types.push_back(type); 107 cert_request_info_->cert_key_types.push_back(type);
108 bridge_->SelectClientCertificate( 108 bridge_->SelectClientCertificate(
109 cert_request_info_.get(), 109 cert_request_info_.get(),
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 requestId, 154 requestId,
155 NULL, 155 NULL,
156 Java_MockAwContentsClientBridge_createTestPrivateKey( 156 Java_MockAwContentsClientBridge_createTestPrivateKey(
157 env_, jbridge_.obj()).obj()); 157 env_, jbridge_.obj()).obj());
158 base::RunLoop().RunUntilIdle(); 158 base::RunLoop().RunUntilIdle();
159 EXPECT_EQ(NULL, selected_cert_); 159 EXPECT_EQ(NULL, selected_cert_);
160 EXPECT_EQ(1, cert_selected_callbacks_); 160 EXPECT_EQ(1, cert_selected_callbacks_);
161 } 161 }
162 162
163 } // android_webview 163 } // android_webview
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698