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 "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 23 matching lines...) Expand all Loading... |
34 class AwContentsClientBridgeTest : public Test { | 34 class AwContentsClientBridgeTest : public Test { |
35 public: | 35 public: |
36 typedef AwContentsClientBridge::SelectCertificateCallback | 36 typedef AwContentsClientBridge::SelectCertificateCallback |
37 SelectCertificateCallback; | 37 SelectCertificateCallback; |
38 | 38 |
39 AwContentsClientBridgeTest() { } | 39 AwContentsClientBridgeTest() { } |
40 | 40 |
41 // Callback method called when a cert is selected. | 41 // Callback method called when a cert is selected. |
42 void CertSelected(X509Certificate* cert); | 42 void CertSelected(X509Certificate* cert); |
43 protected: | 43 protected: |
44 virtual void SetUp(); | 44 void SetUp() override; |
45 void TestCertType(SSLClientCertType type, const std::string& expected_name); | 45 void TestCertType(SSLClientCertType type, const std::string& expected_name); |
46 // Create the TestBrowserThreads. Just instantiate the member variable. | 46 // Create the TestBrowserThreads. Just instantiate the member variable. |
47 content::TestBrowserThreadBundle thread_bundle_; | 47 content::TestBrowserThreadBundle thread_bundle_; |
48 base::android::ScopedJavaGlobalRef<jobject> jbridge_; | 48 base::android::ScopedJavaGlobalRef<jobject> jbridge_; |
49 scoped_ptr<AwContentsClientBridge> bridge_; | 49 scoped_ptr<AwContentsClientBridge> bridge_; |
50 scoped_refptr<SSLCertRequestInfo> cert_request_info_; | 50 scoped_refptr<SSLCertRequestInfo> cert_request_info_; |
51 X509Certificate* selected_cert_; | 51 X509Certificate* selected_cert_; |
52 int cert_selected_callbacks_; | 52 int cert_selected_callbacks_; |
53 JNIEnv* env_; | 53 JNIEnv* env_; |
54 }; | 54 }; |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 requestId, | 143 requestId, |
144 NULL, | 144 NULL, |
145 Java_MockAwContentsClientBridge_createTestPrivateKey( | 145 Java_MockAwContentsClientBridge_createTestPrivateKey( |
146 env_, jbridge_.obj()).obj()); | 146 env_, jbridge_.obj()).obj()); |
147 base::RunLoop().RunUntilIdle(); | 147 base::RunLoop().RunUntilIdle(); |
148 EXPECT_EQ(NULL, selected_cert_); | 148 EXPECT_EQ(NULL, selected_cert_); |
149 EXPECT_EQ(1, cert_selected_callbacks_); | 149 EXPECT_EQ(1, cert_selected_callbacks_); |
150 } | 150 } |
151 | 151 |
152 } // android_webview | 152 } // android_webview |
OLD | NEW |