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.cronet_test_apk; | 5 package org.chromium.net; |
6 | 6 |
7 import android.test.suitebuilder.annotation.SmallTest; | 7 import android.test.suitebuilder.annotation.SmallTest; |
8 | 8 |
9 import org.chromium.base.PathUtils; | 9 import org.chromium.base.PathUtils; |
10 import org.chromium.base.test.util.Feature; | 10 import org.chromium.base.test.util.Feature; |
11 import org.chromium.net.HttpUrlRequest; | |
12 import org.chromium.net.HttpUrlRequestFactoryConfig; | |
13 | 11 |
14 import java.io.File; | 12 import java.io.File; |
15 import java.util.HashMap; | 13 import java.util.HashMap; |
16 | 14 |
17 /** | 15 /** |
18 * Example test that just starts the cronet sample. | 16 * Example test that just starts the cronet sample. |
19 */ | 17 */ |
20 public class CronetUrlTest extends CronetTestBase { | 18 public class CronetUrlTest extends CronetTestBase { |
21 // URL used for base tests. | 19 // URL used for base tests. |
22 private static final String URL = "http://127.0.0.1:8000"; | 20 private static final String URL = "http://127.0.0.1:8000"; |
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
200 URL, HttpUrlRequest.REQUEST_PRIORITY_MEDIUM, headers, listener); | 198 URL, HttpUrlRequest.REQUEST_PRIORITY_MEDIUM, headers, listener); |
201 request.setHttpMethod("HEAD"); | 199 request.setHttpMethod("HEAD"); |
202 request.start(); | 200 request.start(); |
203 listener.blockForComplete(); | 201 listener.blockForComplete(); |
204 assertEquals(200, listener.mHttpStatusCode); | 202 assertEquals(200, listener.mHttpStatusCode); |
205 // HEAD requests do not get any response data and Content-Length must be | 203 // HEAD requests do not get any response data and Content-Length must be |
206 // ignored. | 204 // ignored. |
207 assertEquals(0, listener.mResponseAsBytes.length); | 205 assertEquals(0, listener.mResponseAsBytes.length); |
208 } | 206 } |
209 } | 207 } |
OLD | NEW |