OLD | NEW |
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 <memory> | 7 #include <memory> |
8 | 8 |
9 #include "base/android/jni_android.h" | 9 #include "base/android/jni_android.h" |
10 #include "base/android/jni_array.h" | 10 #include "base/android/jni_array.h" |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 | 70 |
71 DISALLOW_COPY_AND_ASSIGN(TestClientCertificateDelegate); | 71 DISALLOW_COPY_AND_ASSIGN(TestClientCertificateDelegate); |
72 }; | 72 }; |
73 | 73 |
74 } // namespace | 74 } // namespace |
75 | 75 |
76 void AwContentsClientBridgeTest::SetUp() { | 76 void AwContentsClientBridgeTest::SetUp() { |
77 env_ = AttachCurrentThread(); | 77 env_ = AttachCurrentThread(); |
78 ASSERT_THAT(env_, NotNull()); | 78 ASSERT_THAT(env_, NotNull()); |
79 ASSERT_TRUE(android_webview::RegisterAwContentsClientBridge(env_)); | 79 ASSERT_TRUE(android_webview::RegisterAwContentsClientBridge(env_)); |
80 ASSERT_TRUE(RegisterNativesImpl(env_)); | |
81 ASSERT_TRUE(net::android::RegisterJni(env_)); | 80 ASSERT_TRUE(net::android::RegisterJni(env_)); |
82 jbridge_.Reset(env_, | 81 jbridge_.Reset(env_, |
83 Java_MockAwContentsClientBridge_getAwContentsClientBridge(env_).obj()); | 82 Java_MockAwContentsClientBridge_getAwContentsClientBridge(env_).obj()); |
84 bridge_.reset(new AwContentsClientBridge(env_, jbridge_.obj())); | 83 bridge_.reset(new AwContentsClientBridge(env_, jbridge_.obj())); |
85 selected_cert_ = nullptr; | 84 selected_cert_ = nullptr; |
86 cert_selected_callbacks_ = 0; | 85 cert_selected_callbacks_ = 0; |
87 cert_request_info_ = new net::SSLCertRequestInfo; | 86 cert_request_info_ = new net::SSLCertRequestInfo; |
88 } | 87 } |
89 | 88 |
90 void AwContentsClientBridgeTest::CertSelected(X509Certificate* cert) { | 89 void AwContentsClientBridgeTest::CertSelected(X509Certificate* cert) { |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
152 int requestId = | 151 int requestId = |
153 Java_MockAwContentsClientBridge_getRequestId(env_, jbridge_.obj()); | 152 Java_MockAwContentsClientBridge_getRequestId(env_, jbridge_.obj()); |
154 bridge_->ProvideClientCertificateResponse(env_, jbridge_, requestId, nullptr, | 153 bridge_->ProvideClientCertificateResponse(env_, jbridge_, requestId, nullptr, |
155 nullptr); | 154 nullptr); |
156 base::RunLoop().RunUntilIdle(); | 155 base::RunLoop().RunUntilIdle(); |
157 EXPECT_EQ(nullptr, selected_cert_); | 156 EXPECT_EQ(nullptr, selected_cert_); |
158 EXPECT_EQ(1, cert_selected_callbacks_); | 157 EXPECT_EQ(1, cert_selected_callbacks_); |
159 } | 158 } |
160 | 159 |
161 } // android_webview | 160 } // android_webview |
OLD | NEW |