| 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.ContextUtils; | 9 import org.chromium.base.ContextUtils; |
| 10 import org.chromium.base.PathUtils; | 10 import org.chromium.base.PathUtils; |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 private static final String LOOPBACK_ADDRESS = "127.0.0.1"; | 27 private static final String LOOPBACK_ADDRESS = "127.0.0.1"; |
| 28 | 28 |
| 29 private CronetTestFramework mCronetTestFramework; | 29 private CronetTestFramework mCronetTestFramework; |
| 30 // {@code true} when test is being run against system HttpURLConnection impl
ementation. | 30 // {@code true} when test is being run against system HttpURLConnection impl
ementation. |
| 31 private boolean mTestingSystemHttpURLConnection; | 31 private boolean mTestingSystemHttpURLConnection; |
| 32 private boolean mTestingJavaImpl = false; | 32 private boolean mTestingJavaImpl = false; |
| 33 | 33 |
| 34 @Override | 34 @Override |
| 35 protected void setUp() throws Exception { | 35 protected void setUp() throws Exception { |
| 36 super.setUp(); | 36 super.setUp(); |
| 37 System.loadLibrary("cronet_tests"); |
| 37 ContextUtils.initApplicationContext(getContext().getApplicationContext()
); | 38 ContextUtils.initApplicationContext(getContext().getApplicationContext()
); |
| 39 ContextUtils.initApplicationContextForNative(); |
| 38 PathUtils.setPrivateDataDirectorySuffix(PRIVATE_DATA_DIRECTORY_SUFFIX); | 40 PathUtils.setPrivateDataDirectorySuffix(PRIVATE_DATA_DIRECTORY_SUFFIX); |
| 39 CronetTestFramework.prepareTestStorage(getContext()); | 41 CronetTestFramework.prepareTestStorage(getContext()); |
| 40 } | 42 } |
| 41 | 43 |
| 42 /** | 44 /** |
| 43 * Starts the CronetTest framework. | 45 * Starts the CronetTest framework. |
| 44 */ | 46 */ |
| 45 protected CronetTestFramework startCronetTestFramework() { | 47 protected CronetTestFramework startCronetTestFramework() { |
| 46 return startCronetTestFrameworkWithUrlAndCronetEngineBuilder(null, null)
; | 48 return startCronetTestFrameworkWithUrlAndCronetEngineBuilder(null, null)
; |
| 47 } | 49 } |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 173 | 175 |
| 174 @Target(ElementType.METHOD) | 176 @Target(ElementType.METHOD) |
| 175 @Retention(RetentionPolicy.RUNTIME) | 177 @Retention(RetentionPolicy.RUNTIME) |
| 176 public @interface OnlyRunCronetHttpURLConnection { | 178 public @interface OnlyRunCronetHttpURLConnection { |
| 177 } | 179 } |
| 178 | 180 |
| 179 @Target(ElementType.METHOD) | 181 @Target(ElementType.METHOD) |
| 180 @Retention(RetentionPolicy.RUNTIME) | 182 @Retention(RetentionPolicy.RUNTIME) |
| 181 public @interface OnlyRunNativeCronet {} | 183 public @interface OnlyRunNativeCronet {} |
| 182 } | 184 } |
| OLD | NEW |