Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(56)

Side by Side Diff: components/cronet/android/test/javatests/src/org/chromium/net/QuicTest.java

Issue 1572753003: QUIC - Allow cronet apps to specify how many server configs are to be (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix comments in Patch set 4 Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | components/cronet/url_request_context_config.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
36 QuicTestServer.startQuicTestServer(getContext()); 36 QuicTestServer.startQuicTestServer(getContext());
37 37
38 mBuilder = new CronetEngine.Builder(getContext()); 38 mBuilder = new CronetEngine.Builder(getContext());
39 mBuilder.enableQUIC(true); 39 mBuilder.enableQUIC(true);
40 mBuilder.addQuicHint(QuicTestServer.getServerHost(), QuicTestServer.getS erverPort(), 40 mBuilder.addQuicHint(QuicTestServer.getServerHost(), QuicTestServer.getS erverPort(),
41 QuicTestServer.getServerPort()); 41 QuicTestServer.getServerPort());
42 42
43 JSONObject quicParams = new JSONObject() 43 JSONObject quicParams = new JSONObject()
44 .put("connection_options", "PACE,IW10,FO O,DEADBEEF") 44 .put("connection_options", "PACE,IW10,FO O,DEADBEEF")
45 .put("host_whitelist", "test.example.com ") 45 .put("host_whitelist", "test.example.com ")
46 .put("store_server_configs_in_properties ", true) 46 .put("max_server_configs_stored_in_prope rties", 2)
47 .put("delay_tcp_race", true) 47 .put("delay_tcp_race", true)
48 .put("max_number_of_lossy_connections", 10) 48 .put("max_number_of_lossy_connections", 10)
49 .put("packet_loss_threshold", 0.5) 49 .put("packet_loss_threshold", 0.5)
50 .put("idle_connection_timeout_seconds", 300); 50 .put("idle_connection_timeout_seconds", 300);
51 JSONObject experimentalOptions = new JSONObject().put("QUIC", quicParams ); 51 JSONObject experimentalOptions = new JSONObject().put("QUIC", quicParams );
52 mBuilder.setExperimentalOptions(experimentalOptions.toString()); 52 mBuilder.setExperimentalOptions(experimentalOptions.toString());
53 53
54 mBuilder.setMockCertVerifierForTesting(MockCertVerifier.createMockCertVe rifier(CERTS_USED)); 54 mBuilder.setMockCertVerifierForTesting(MockCertVerifier.createMockCertVe rifier(CERTS_USED));
55 mBuilder.setStoragePath(CronetTestFramework.getTestStorage(getContext()) ); 55 mBuilder.setStoragePath(CronetTestFramework.getTestStorage(getContext()) );
56 mBuilder.enableHttpCache(CronetEngine.Builder.HTTP_CACHE_DISK_NO_HTTP, 1 000 * 1024); 56 mBuilder.enableHttpCache(CronetEngine.Builder.HTTP_CACHE_DISK_NO_HTTP, 1 000 * 1024);
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 @SuppressFBWarnings("OBL_UNSATISFIED_OBLIGATION_EXCEPTION_EDGE") 161 @SuppressFBWarnings("OBL_UNSATISFIED_OBLIGATION_EXCEPTION_EDGE")
162 private boolean fileContainsString(String filename, String content) throws I OException { 162 private boolean fileContainsString(String filename, String content) throws I OException {
163 File file = new File(CronetTestFramework.getTestStorage(getContext()) + "/" + filename); 163 File file = new File(CronetTestFramework.getTestStorage(getContext()) + "/" + filename);
164 FileInputStream fileInputStream = new FileInputStream(file); 164 FileInputStream fileInputStream = new FileInputStream(file);
165 byte[] data = new byte[(int) file.length()]; 165 byte[] data = new byte[(int) file.length()];
166 fileInputStream.read(data); 166 fileInputStream.read(data);
167 fileInputStream.close(); 167 fileInputStream.close();
168 return new String(data, "UTF-8").contains(content); 168 return new String(data, "UTF-8").contains(content);
169 } 169 }
170 } 170 }
OLDNEW
« no previous file with comments | « no previous file | components/cronet/url_request_context_config.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698