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 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 // Helper method to tell the framework to skip library init during construct
ion. | 72 // Helper method to tell the framework to skip library init during construct
ion. |
73 protected CronetTestFramework startCronetTestFrameworkAndSkipLibraryInit() { | 73 protected CronetTestFramework startCronetTestFrameworkAndSkipLibraryInit() { |
74 String[] commandLineArgs = { | 74 String[] commandLineArgs = { |
75 CronetTestFramework.LIBRARY_INIT_KEY, CronetTestFramework.Librar
yInitType.NONE}; | 75 CronetTestFramework.LIBRARY_INIT_KEY, CronetTestFramework.Librar
yInitType.NONE}; |
76 mCronetTestFramework = | 76 mCronetTestFramework = |
77 startCronetTestFrameworkWithUrlAndCommandLineArgs(null, commandL
ineArgs); | 77 startCronetTestFrameworkWithUrlAndCommandLineArgs(null, commandL
ineArgs); |
78 return mCronetTestFramework; | 78 return mCronetTestFramework; |
79 } | 79 } |
80 | 80 |
81 /** | 81 /** |
82 * Starts the CronetTest framework for the legacy API. | |
83 * @param url if non-null, a request will be made with that url. | |
84 */ | |
85 protected CronetTestFramework startCronetTestFrameworkForLegacyApi(String ur
l) { | |
86 String[] commandLineArgs = { | |
87 CronetTestFramework.LIBRARY_INIT_KEY, CronetTestFramework.Librar
yInitType.LEGACY}; | |
88 mCronetTestFramework = | |
89 startCronetTestFrameworkWithUrlAndCommandLineArgs(url, commandLi
neArgs); | |
90 return mCronetTestFramework; | |
91 } | |
92 | |
93 /** | |
94 * Returns {@code true} when test is being run against system HttpURLConnect
ion implementation. | 82 * Returns {@code true} when test is being run against system HttpURLConnect
ion implementation. |
95 */ | 83 */ |
96 protected boolean testingSystemHttpURLConnection() { | 84 protected boolean testingSystemHttpURLConnection() { |
97 return mTestingSystemHttpURLConnection; | 85 return mTestingSystemHttpURLConnection; |
98 } | 86 } |
99 | 87 |
100 /** | 88 /** |
101 * Returns {@code true} when test is being run against the java implementati
on of CronetEngine. | 89 * Returns {@code true} when test is being run against the java implementati
on of CronetEngine. |
102 */ | 90 */ |
103 protected boolean testingJavaImpl() { | 91 protected boolean testingJavaImpl() { |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
174 | 162 |
175 @Target(ElementType.METHOD) | 163 @Target(ElementType.METHOD) |
176 @Retention(RetentionPolicy.RUNTIME) | 164 @Retention(RetentionPolicy.RUNTIME) |
177 public @interface OnlyRunCronetHttpURLConnection { | 165 public @interface OnlyRunCronetHttpURLConnection { |
178 } | 166 } |
179 | 167 |
180 @Target(ElementType.METHOD) | 168 @Target(ElementType.METHOD) |
181 @Retention(RetentionPolicy.RUNTIME) | 169 @Retention(RetentionPolicy.RUNTIME) |
182 public @interface OnlyRunNativeCronet {} | 170 public @interface OnlyRunNativeCronet {} |
183 } | 171 } |
OLD | NEW |