OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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.suitebuilder.annotation.SmallTest; | 7 import android.test.suitebuilder.annotation.SmallTest; |
8 | 8 |
9 import org.chromium.base.test.util.Feature; | 9 import org.chromium.base.test.util.Feature; |
10 | 10 |
11 import java.util.HashMap; | 11 import java.util.HashMap; |
12 | 12 |
13 /** | 13 /** |
14 * Tests making requests using QUIC. | 14 * Tests making requests using QUIC. |
15 */ | 15 */ |
16 public class QuicTest extends CronetTestBase { | 16 public class QuicTest extends CronetTestBase { |
17 | 17 |
18 @Override | 18 @Override |
19 protected void setUp() throws Exception { | 19 protected void setUp() throws Exception { |
20 super.setUp(); | 20 super.setUp(); |
21 // Loads library first since native functions are used to retrieve | 21 // Loads library first since native functions are used to retrieve |
22 // QuicTestServer info before config is constructed. | 22 // QuicTestServer info before config is constructed. |
23 System.loadLibrary("cronet_tests"); | 23 System.loadLibrary("cronet_tests"); |
24 } | 24 } |
25 | 25 |
26 @SmallTest | 26 @SmallTest |
27 @Feature({"Cronet"}) | 27 @Feature({"Cronet"}) |
28 public void testQuicLoadUrl() throws Exception { | 28 public void disabled_testQuicLoadUrl() throws Exception { |
29 HttpUrlRequestFactoryConfig config = new HttpUrlRequestFactoryConfig(); | 29 HttpUrlRequestFactoryConfig config = new HttpUrlRequestFactoryConfig(); |
30 String quicURL = QuicTestServer.getServerURL() + "/simple.txt"; | 30 String quicURL = QuicTestServer.getServerURL() + "/simple.txt"; |
31 config.enableQUIC(true); | 31 config.enableQUIC(true); |
32 config.setLibraryName("cronet_tests"); | 32 config.setLibraryName("cronet_tests"); |
33 config.addQuicHint(QuicTestServer.getServerHost(), | 33 config.addQuicHint(QuicTestServer.getServerHost(), |
34 QuicTestServer.getServerPort(), QuicTestServer.getServerPort()); | 34 QuicTestServer.getServerPort(), QuicTestServer.getServerPort()); |
35 config.setExperimentalQuicConnectionOptions("PACE,IW10,FOO,DEADBEEF"); | 35 config.setExperimentalQuicConnectionOptions("PACE,IW10,FOO,DEADBEEF"); |
36 | 36 |
37 String[] commandLineArgs = { | 37 String[] commandLineArgs = { |
38 CronetTestActivity.CONFIG_KEY, config.toString() }; | 38 CronetTestActivity.CONFIG_KEY, config.toString() }; |
(...skipping 15 matching lines...) Expand all Loading... |
54 request.start(); | 54 request.start(); |
55 listener.blockForComplete(); | 55 listener.blockForComplete(); |
56 assertEquals(200, listener.mHttpStatusCode); | 56 assertEquals(200, listener.mHttpStatusCode); |
57 assertEquals( | 57 assertEquals( |
58 "This is a simple text file served by QUIC.\n", listener.mRespon
seAsString); | 58 "This is a simple text file served by QUIC.\n", listener.mRespon
seAsString); |
59 assertEquals("quic/1+spdy/3", listener.mNegotiatedProtocol); | 59 assertEquals("quic/1+spdy/3", listener.mNegotiatedProtocol); |
60 activity.stopNetLog(); | 60 activity.stopNetLog(); |
61 QuicTestServer.shutdownQuicTestServer(); | 61 QuicTestServer.shutdownQuicTestServer(); |
62 } | 62 } |
63 } | 63 } |
OLD | NEW |