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

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

Issue 1505983003: QUIC - cronet - added idle_connection_timeout_seconds and disable experiments (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@enable_preconnect_exp
Patch Set: Deleted PreConnect option Created 5 years 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 26 matching lines...) Expand all
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("store_server_configs_in_properties ", true) 44 .put("store_server_configs_in_properties ", true)
45 .put("delay_tcp_race", true) 45 .put("delay_tcp_race", true)
46 .put("max_number_of_lossy_connections", 10) 46 .put("max_number_of_lossy_connections", 10)
47 .put("packet_loss_threshold", 0.5); 47 .put("packet_loss_threshold", 0.5)
48 .put("idle_connection_timeout_seconds", 300);
48 JSONObject experimentalOptions = new JSONObject().put("QUIC", quicParams ); 49 JSONObject experimentalOptions = new JSONObject().put("QUIC", quicParams );
49 mBuilder.setExperimentalOptions(experimentalOptions.toString()); 50 mBuilder.setExperimentalOptions(experimentalOptions.toString());
50 51
51 mBuilder.setMockCertVerifierForTesting(MockCertVerifier.createMockCertVe rifier(CERTS_USED)); 52 mBuilder.setMockCertVerifierForTesting(MockCertVerifier.createMockCertVe rifier(CERTS_USED));
52 mBuilder.setStoragePath(CronetTestFramework.getTestStorage(getContext()) ); 53 mBuilder.setStoragePath(CronetTestFramework.getTestStorage(getContext()) );
53 mBuilder.enableHttpCache(CronetEngine.Builder.HTTP_CACHE_DISK_NO_HTTP, 1 000 * 1024); 54 mBuilder.enableHttpCache(CronetEngine.Builder.HTTP_CACHE_DISK_NO_HTTP, 1 000 * 1024);
54 } 55 }
55 56
56 @Override 57 @Override
57 protected void tearDown() throws Exception { 58 protected void tearDown() throws Exception {
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 @SuppressFBWarnings("OBL_UNSATISFIED_OBLIGATION_EXCEPTION_EDGE") 155 @SuppressFBWarnings("OBL_UNSATISFIED_OBLIGATION_EXCEPTION_EDGE")
155 private boolean fileContainsString(String filename, String content) throws I OException { 156 private boolean fileContainsString(String filename, String content) throws I OException {
156 File file = new File(CronetTestFramework.getTestStorage(getContext()) + "/" + filename); 157 File file = new File(CronetTestFramework.getTestStorage(getContext()) + "/" + filename);
157 FileInputStream fileInputStream = new FileInputStream(file); 158 FileInputStream fileInputStream = new FileInputStream(file);
158 byte[] data = new byte[(int) file.length()]; 159 byte[] data = new byte[(int) file.length()];
159 fileInputStream.read(data); 160 fileInputStream.read(data);
160 fileInputStream.close(); 161 fileInputStream.close();
161 return new String(data, "UTF-8").contains(content); 162 return new String(data, "UTF-8").contains(content);
162 } 163 }
163 } 164 }
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