| 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 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 Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |