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.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.Log; | 10 import org.chromium.base.Log; |
(...skipping 25 matching lines...) Expand all Loading... |
36 | 36 |
37 mBuilder = new CronetEngine.Builder(getContext()); | 37 mBuilder = new CronetEngine.Builder(getContext()); |
38 mBuilder.enableQUIC(true); | 38 mBuilder.enableQUIC(true); |
39 mBuilder.addQuicHint(QuicTestServer.getServerHost(), QuicTestServer.getS
erverPort(), | 39 mBuilder.addQuicHint(QuicTestServer.getServerHost(), QuicTestServer.getS
erverPort(), |
40 QuicTestServer.getServerPort()); | 40 QuicTestServer.getServerPort()); |
41 | 41 |
42 JSONObject quicParams = new JSONObject() | 42 JSONObject quicParams = new JSONObject() |
43 .put("connection_options", "PACE,IW10,FO
O,DEADBEEF") | 43 .put("connection_options", "PACE,IW10,FO
O,DEADBEEF") |
44 .put("host_whitelist", "test.example.com
") | 44 .put("host_whitelist", "test.example.com
") |
45 .put("max_server_configs_stored_in_prope
rties", 2) | 45 .put("max_server_configs_stored_in_prope
rties", 2) |
| 46 .put("delay_tcp_race", true) |
46 .put("max_number_of_lossy_connections",
10) | 47 .put("max_number_of_lossy_connections",
10) |
47 .put("packet_loss_threshold", 0.5) | 48 .put("packet_loss_threshold", 0.5) |
48 .put("idle_connection_timeout_seconds",
300) | 49 .put("idle_connection_timeout_seconds",
300) |
49 .put("close_sessions_on_ip_change", fals
e) | 50 .put("close_sessions_on_ip_change", fals
e) |
50 .put("migrate_sessions_on_network_change
", true) | 51 .put("migrate_sessions_on_network_change
", true) |
51 .put("migrate_sessions_early", true); | 52 .put("migrate_sessions_early", true); |
52 JSONObject experimentalOptions = new JSONObject().put("QUIC", quicParams
); | 53 JSONObject experimentalOptions = new JSONObject().put("QUIC", quicParams
); |
53 mBuilder.setExperimentalOptions(experimentalOptions.toString()); | 54 mBuilder.setExperimentalOptions(experimentalOptions.toString()); |
54 | 55 |
55 mBuilder.setMockCertVerifierForTesting(QuicTestServer.createMockCertVeri
fier()); | 56 mBuilder.setMockCertVerifierForTesting(QuicTestServer.createMockCertVeri
fier()); |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
163 private boolean fileContainsString(String filename, String content) throws I
OException { | 164 private boolean fileContainsString(String filename, String content) throws I
OException { |
164 File file = | 165 File file = |
165 new File(CronetTestFramework.getTestStorage(getContext()) + "/pr
efs/" + filename); | 166 new File(CronetTestFramework.getTestStorage(getContext()) + "/pr
efs/" + filename); |
166 FileInputStream fileInputStream = new FileInputStream(file); | 167 FileInputStream fileInputStream = new FileInputStream(file); |
167 byte[] data = new byte[(int) file.length()]; | 168 byte[] data = new byte[(int) file.length()]; |
168 fileInputStream.read(data); | 169 fileInputStream.read(data); |
169 fileInputStream.close(); | 170 fileInputStream.close(); |
170 return new String(data, "UTF-8").contains(content); | 171 return new String(data, "UTF-8").contains(content); |
171 } | 172 } |
172 } | 173 } |
OLD | NEW |