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.LargeTest; | 7 import android.test.suitebuilder.annotation.LargeTest; |
8 import android.test.suitebuilder.annotation.SmallTest; | 8 import android.test.suitebuilder.annotation.SmallTest; |
9 | 9 |
10 import org.chromium.base.test.util.Feature; | 10 import org.chromium.base.test.util.Feature; |
11 import org.chromium.net.ChunkedWritableByteChannel; | |
12 import org.chromium.net.HttpUrlRequest; | |
13 | 11 |
14 import java.io.IOException; | 12 import java.io.IOException; |
15 import java.nio.ByteBuffer; | 13 import java.nio.ByteBuffer; |
16 import java.util.HashMap; | 14 import java.util.HashMap; |
17 import java.util.List; | 15 import java.util.List; |
18 import java.util.concurrent.Executors; | 16 import java.util.concurrent.Executors; |
19 | 17 |
20 /** | 18 /** |
21 * Tests that use mock URLRequestJobs to simulate URL requests. | 19 * Tests that use mock URLRequestJobs to simulate URL requests. |
22 */ | 20 */ |
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
234 TestHttpUrlRequestListener listener = createRequestAndWaitForComplete( | 232 TestHttpUrlRequestListener listener = createRequestAndWaitForComplete( |
235 mockUrl, false); | 233 mockUrl, false); |
236 assertEquals(mockUrl, listener.mUrl); | 234 assertEquals(mockUrl, listener.mUrl); |
237 String responseData = new String(listener.mResponseAsBytes); | 235 String responseData = new String(listener.mResponseAsBytes); |
238 for (int i = 0; i < repeatCount; ++i) { | 236 for (int i = 0; i < repeatCount; ++i) { |
239 assertEquals(data, responseData.substring(dataLength * i, | 237 assertEquals(data, responseData.substring(dataLength * i, |
240 dataLength * (i + 1))); | 238 dataLength * (i + 1))); |
241 } | 239 } |
242 } | 240 } |
243 } | 241 } |
OLD | NEW |