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 13 matching lines...) Expand all Loading... |
24 private static final String LOOPBACK_ADDRESS = "127.0.0.1"; | 24 private static final String LOOPBACK_ADDRESS = "127.0.0.1"; |
25 | 25 |
26 private CronetTestFramework mCronetTestFramework; | 26 private CronetTestFramework mCronetTestFramework; |
27 // {@code true} when test is being run against system HttpURLConnection impl
ementation. | 27 // {@code true} when test is being run against system HttpURLConnection impl
ementation. |
28 private boolean mTestingSystemHttpURLConnection; | 28 private boolean mTestingSystemHttpURLConnection; |
29 private boolean mTestingJavaImpl = false; | 29 private boolean mTestingJavaImpl = false; |
30 | 30 |
31 @Override | 31 @Override |
32 protected void setUp() throws Exception { | 32 protected void setUp() throws Exception { |
33 super.setUp(); | 33 super.setUp(); |
| 34 System.loadLibrary("cronet_tests"); |
34 ContextUtils.initApplicationContext(getContext().getApplicationContext()
); | 35 ContextUtils.initApplicationContext(getContext().getApplicationContext()
); |
| 36 ContextUtils.initApplicationContextForNative(); |
35 PathUtils.setPrivateDataDirectorySuffix(PRIVATE_DATA_DIRECTORY_SUFFIX); | 37 PathUtils.setPrivateDataDirectorySuffix(PRIVATE_DATA_DIRECTORY_SUFFIX); |
36 CronetTestFramework.prepareTestStorage(getContext()); | 38 CronetTestFramework.prepareTestStorage(getContext()); |
37 } | 39 } |
38 | 40 |
39 /** | 41 /** |
40 * Starts the CronetTest framework. | 42 * Starts the CronetTest framework. |
41 */ | 43 */ |
42 protected CronetTestFramework startCronetTestFramework() { | 44 protected CronetTestFramework startCronetTestFramework() { |
43 return startCronetTestFrameworkWithUrlAndCronetEngineBuilder(null, null)
; | 45 return startCronetTestFrameworkWithUrlAndCronetEngineBuilder(null, null)
; |
44 } | 46 } |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
164 | 166 |
165 @Target(ElementType.METHOD) | 167 @Target(ElementType.METHOD) |
166 @Retention(RetentionPolicy.RUNTIME) | 168 @Retention(RetentionPolicy.RUNTIME) |
167 public @interface OnlyRunCronetHttpURLConnection { | 169 public @interface OnlyRunCronetHttpURLConnection { |
168 } | 170 } |
169 | 171 |
170 @Target(ElementType.METHOD) | 172 @Target(ElementType.METHOD) |
171 @Retention(RetentionPolicy.RUNTIME) | 173 @Retention(RetentionPolicy.RUNTIME) |
172 public @interface OnlyRunNativeCronet {} | 174 public @interface OnlyRunNativeCronet {} |
173 } | 175 } |
OLD | NEW |