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

Side by Side Diff: components/cronet/android/test/javatests/src/org/chromium/net/CronetUrlRequestContextTest.java

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 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 package org.chromium.net; 5 package org.chromium.net;
6 6
7 import static org.chromium.base.CollectionUtil.newHashSet; 7 import static org.chromium.base.CollectionUtil.newHashSet;
8 8
9 import android.content.Context; 9 import android.content.Context;
10 import android.content.ContextWrapper; 10 import android.content.ContextWrapper;
(...skipping 1092 matching lines...) Expand 10 before | Expand all | Expand 10 after
1103 builder.enableHTTP2(false); 1103 builder.enableHTTP2(false);
1104 builder.enableQUIC(true); 1104 builder.enableQUIC(true);
1105 builder.enableSDCH(true); 1105 builder.enableSDCH(true);
1106 builder.addQuicHint("example.com", 12, 34); 1106 builder.addQuicHint("example.com", 12, 34);
1107 builder.enableHttpCache(CronetEngine.Builder.HTTP_CACHE_IN_MEMORY, 54321 ); 1107 builder.enableHttpCache(CronetEngine.Builder.HTTP_CACHE_IN_MEMORY, 54321 );
1108 builder.enableDataReductionProxy("abcd"); 1108 builder.enableDataReductionProxy("abcd");
1109 builder.setUserAgent("efgh"); 1109 builder.setUserAgent("efgh");
1110 builder.setExperimentalOptions("ijkl"); 1110 builder.setExperimentalOptions("ijkl");
1111 builder.setDataReductionProxyOptions("mnop", "qrst", "uvwx"); 1111 builder.setDataReductionProxyOptions("mnop", "qrst", "uvwx");
1112 builder.setStoragePath(CronetTestFramework.getTestStorage(getContext())) ; 1112 builder.setStoragePath(CronetTestFramework.getTestStorage(getContext())) ;
1113 builder.enableLocalTrustAnchorPinning(true);
1113 nativeVerifyUrlRequestContextConfig( 1114 nativeVerifyUrlRequestContextConfig(
1114 CronetUrlRequestContext.createNativeUrlRequestContextConfig(getC ontext(), builder), 1115 CronetUrlRequestContext.createNativeUrlRequestContextConfig(getC ontext(), builder),
1115 CronetTestFramework.getTestStorage(getContext())); 1116 CronetTestFramework.getTestStorage(getContext()));
1116 } 1117 }
1117 1118
1118 // Verifies that CronetEngine.Builder config from testCronetEngineBuilderCon fig() is properly 1119 // Verifies that CronetEngine.Builder config from testCronetEngineBuilderCon fig() is properly
1119 // translated to a native UrlRequestContextConfig. 1120 // translated to a native UrlRequestContextConfig.
1120 private static native void nativeVerifyUrlRequestContextConfig(long config, String storagePath); 1121 private static native void nativeVerifyUrlRequestContextConfig(long config, String storagePath);
1121 1122
1122 private static class TestBadLibraryLoader extends CronetEngine.Builder.Libra ryLoader { 1123 private static class TestBadLibraryLoader extends CronetEngine.Builder.Libra ryLoader {
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
1168 } 1169 }
1169 }.start(); 1170 }.start();
1170 otherThreadDone.block(); 1171 otherThreadDone.block();
1171 builder.build().shutdown(); 1172 builder.build().shutdown();
1172 uiThreadDone.open(); 1173 uiThreadDone.open();
1173 } 1174 }
1174 }); 1175 });
1175 assertTrue(uiThreadDone.block(1000)); 1176 assertTrue(uiThreadDone.block(1000));
1176 } 1177 }
1177 } 1178 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698