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.os.ConditionVariable; | 7 import android.os.ConditionVariable; |
8 import android.os.Handler; | 8 import android.os.Handler; |
9 import android.os.Looper; | 9 import android.os.Looper; |
10 import android.test.suitebuilder.annotation.SmallTest; | 10 import android.test.suitebuilder.annotation.SmallTest; |
11 | 11 |
12 import org.chromium.base.PathUtils; | 12 import org.chromium.base.PathUtils; |
13 import org.chromium.base.test.util.Feature; | 13 import org.chromium.base.test.util.Feature; |
14 import org.chromium.cronet_test_apk.TestUrlRequestListener.FailureType; | 14 import org.chromium.net.TestUrlRequestListener.FailureType; |
15 import org.chromium.cronet_test_apk.TestUrlRequestListener.ResponseStep; | 15 import org.chromium.net.TestUrlRequestListener.ResponseStep; |
16 import org.chromium.net.ExtendedResponseInfo; | |
17 import org.chromium.net.ResponseInfo; | |
18 import org.chromium.net.UrlRequest; | |
19 import org.chromium.net.UrlRequestContext; | |
20 import org.chromium.net.UrlRequestContextConfig; | |
21 import org.chromium.net.UrlRequestException; | |
22 | 16 |
23 import java.io.File; | 17 import java.io.File; |
24 import java.nio.ByteBuffer; | 18 import java.nio.ByteBuffer; |
25 import java.util.Arrays; | 19 import java.util.Arrays; |
26 | 20 |
27 /** | 21 /** |
28 * Test CronetUrlRequestContext. | 22 * Test CronetUrlRequestContext. |
29 */ | 23 */ |
30 public class CronetUrlRequestContextTest extends CronetTestBase { | 24 public class CronetUrlRequestContextTest extends CronetTestBase { |
31 // URLs used for tests. | 25 // URLs used for tests. |
(...skipping 562 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
594 RequestThread thread2 = new RequestThread(activity, URL_404, runBlocker)
; | 588 RequestThread thread2 = new RequestThread(activity, URL_404, runBlocker)
; |
595 | 589 |
596 thread1.start(); | 590 thread1.start(); |
597 thread1.join(); | 591 thread1.join(); |
598 thread2.start(); | 592 thread2.start(); |
599 thread2.join(); | 593 thread2.join(); |
600 assertEquals(200, thread1.mListener.mResponseInfo.getHttpStatusCode()); | 594 assertEquals(200, thread1.mListener.mResponseInfo.getHttpStatusCode()); |
601 assertEquals(404, thread2.mListener.mResponseInfo.getHttpStatusCode()); | 595 assertEquals(404, thread2.mListener.mResponseInfo.getHttpStatusCode()); |
602 } | 596 } |
603 } | 597 } |
OLD | NEW |