Chromium Code Reviews| 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 android.test.AndroidTestCase; | 7 import android.test.AndroidTestCase; |
| 8 | 8 |
| 9 import org.chromium.base.PathUtils; | 9 import org.chromium.base.PathUtils; |
| 10 | 10 |
| (...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 156 protected void registerHostResolver(CronetTestFramework framework) { | 156 protected void registerHostResolver(CronetTestFramework framework) { |
| 157 registerHostResolver(framework, false); | 157 registerHostResolver(framework, false); |
| 158 } | 158 } |
| 159 | 159 |
| 160 /** | 160 /** |
| 161 * Registers test host resolver. | 161 * Registers test host resolver. |
| 162 * | 162 * |
| 163 * @param isLegacyAPI true if the test should use the legacy API. | 163 * @param isLegacyAPI true if the test should use the legacy API. |
| 164 */ | 164 */ |
| 165 protected void registerHostResolver(CronetTestFramework framework, boolean i sLegacyAPI) { | 165 protected void registerHostResolver(CronetTestFramework framework, boolean i sLegacyAPI) { |
| 166 long urlRequestContextAdapter; | |
| 167 if (isLegacyAPI) { | 166 if (isLegacyAPI) { |
| 168 urlRequestContextAdapter = ((ChromiumUrlRequestFactory) framework.mR equestFactory) | 167 CronetTestUtil.registerHostResolverProc(framework.mRequestFactory, " 127.0.0.1"); |
|
mef
2016/01/26 21:45:03
nit: maybe make a const?
pauljensen
2016/01/29 17:10:09
Done.
| |
| 169 .getRequestContext() | |
| 170 .getUrlRequestContextAdapter(); | |
| 171 } else { | 168 } else { |
| 172 urlRequestContextAdapter = ((CronetUrlRequestContext) framework.mCro netEngine) | 169 CronetTestUtil.registerHostResolverProc(framework.mCronetEngine, "12 7.0.0.1"); |
| 173 .getUrlRequestContextAdapter(); | |
| 174 } | 170 } |
| 175 NativeTestServer.registerHostResolverProc(urlRequestContextAdapter, isLe gacyAPI); | |
| 176 } | 171 } |
| 177 | 172 |
| 178 @Target(ElementType.METHOD) | 173 @Target(ElementType.METHOD) |
| 179 @Retention(RetentionPolicy.RUNTIME) | 174 @Retention(RetentionPolicy.RUNTIME) |
| 180 public @interface CompareDefaultWithCronet { | 175 public @interface CompareDefaultWithCronet { |
| 181 } | 176 } |
| 182 | 177 |
| 183 @Target(ElementType.METHOD) | 178 @Target(ElementType.METHOD) |
| 184 @Retention(RetentionPolicy.RUNTIME) | 179 @Retention(RetentionPolicy.RUNTIME) |
| 185 public @interface OnlyRunCronetHttpURLConnection { | 180 public @interface OnlyRunCronetHttpURLConnection { |
| 186 } | 181 } |
| 187 | 182 |
| 188 @Target(ElementType.METHOD) | 183 @Target(ElementType.METHOD) |
| 189 @Retention(RetentionPolicy.RUNTIME) | 184 @Retention(RetentionPolicy.RUNTIME) |
| 190 public @interface OnlyRunNativeCronet {} | 185 public @interface OnlyRunNativeCronet {} |
| 191 } | 186 } |
| OLD | NEW |