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 29 matching lines...) Expand all Loading... |
40 private CronetTestFramework mCronetTestFramework; | 40 private CronetTestFramework mCronetTestFramework; |
41 // {@code true} when test is being run against system HttpURLConnection impl
ementation. | 41 // {@code true} when test is being run against system HttpURLConnection impl
ementation. |
42 private boolean mTestingSystemHttpURLConnection; | 42 private boolean mTestingSystemHttpURLConnection; |
43 private boolean mTestingJavaImpl = false; | 43 private boolean mTestingJavaImpl = false; |
44 | 44 |
45 @Override | 45 @Override |
46 protected void setUp() throws Exception { | 46 protected void setUp() throws Exception { |
47 super.setUp(); | 47 super.setUp(); |
48 System.loadLibrary("cronet_tests"); | 48 System.loadLibrary("cronet_tests"); |
49 ContextUtils.initApplicationContext(getContext().getApplicationContext()
); | 49 ContextUtils.initApplicationContext(getContext().getApplicationContext()
); |
50 ContextUtils.initApplicationContextForNative(); | |
51 PathUtils.setPrivateDataDirectorySuffix(PRIVATE_DATA_DIRECTORY_SUFFIX); | 50 PathUtils.setPrivateDataDirectorySuffix(PRIVATE_DATA_DIRECTORY_SUFFIX); |
52 CronetTestFramework.prepareTestStorage(getContext()); | 51 CronetTestFramework.prepareTestStorage(getContext()); |
53 } | 52 } |
54 | 53 |
55 /** | 54 /** |
56 * Starts the CronetTest framework. | 55 * Starts the CronetTest framework. |
57 */ | 56 */ |
58 protected CronetTestFramework startCronetTestFramework() { | 57 protected CronetTestFramework startCronetTestFramework() { |
59 return startCronetTestFrameworkWithUrlAndCronetEngineBuilder(null, null)
; | 58 return startCronetTestFrameworkWithUrlAndCronetEngineBuilder(null, null)
; |
60 } | 59 } |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
202 | 201 |
203 @Target(ElementType.METHOD) | 202 @Target(ElementType.METHOD) |
204 @Retention(RetentionPolicy.RUNTIME) | 203 @Retention(RetentionPolicy.RUNTIME) |
205 public @interface OnlyRunCronetHttpURLConnection { | 204 public @interface OnlyRunCronetHttpURLConnection { |
206 } | 205 } |
207 | 206 |
208 @Target(ElementType.METHOD) | 207 @Target(ElementType.METHOD) |
209 @Retention(RetentionPolicy.RUNTIME) | 208 @Retention(RetentionPolicy.RUNTIME) |
210 public @interface OnlyRunNativeCronet {} | 209 public @interface OnlyRunNativeCronet {} |
211 } | 210 } |
OLD | NEW |