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
3 // found in the LICENSE file.
5 package org.chromium.android_webview.unittest;
7 import org.chromium.android_webview.AwContentsClientBridge;
8 import org.chromium.android_webview.ClientCertLookupTable;
9 import org.chromium.base.CalledByNative;
10 import org.chromium.net.AndroidKeyStore;
11 import org.chromium.net.AndroidPrivateKey;
12 import org.chromium.net.DefaultAndroidKeyStore;
14 class MockAwContentsClientBridge extends AwContentsClientBridge {
17 private String[] mKeyTypes;
19 public MockAwContentsClientBridge() {
20 super(new DefaultAndroidKeyStore(), new ClientCertLookupTable());
24 protected void selectClientCertificate(final int id, final String[] keyTypes,
25 byte[][] encodedPrincipals, final String host, final int port) {
31 private static MockAwContentsClientBridge getAwContentsClientBridge() {
32 return new MockAwContentsClientBridge();
36 private String[] getKeyTypes() {
41 private int getRequestId() {
46 private AndroidPrivateKey createTestPrivateKey() {
47 return new AndroidPrivateKey() {
49 public AndroidKeyStore getKeyStore() {
56 private byte[][] createTestCertChain() {
57 return new byte[][]{{1}};