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

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

Issue 1448583003: [Cronet] Add QUIC experimental params (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@experiment_ops
Patch Set: Fix build 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 | « components/cronet.gypi ('k') | components/cronet/run_all_unittests.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 20 matching lines...) Expand all
31 super.setUp(); 31 super.setUp();
32 // Load library first, since we need the Quic test server's URL. 32 // Load library first, since we need the Quic test server's URL.
33 System.loadLibrary("cronet_tests"); 33 System.loadLibrary("cronet_tests");
34 QuicTestServer.startQuicTestServer(getContext()); 34 QuicTestServer.startQuicTestServer(getContext());
35 35
36 CronetEngine.Builder builder = new CronetEngine.Builder(getContext()); 36 CronetEngine.Builder builder = new CronetEngine.Builder(getContext());
37 builder.enableQUIC(true); 37 builder.enableQUIC(true);
38 builder.addQuicHint(QuicTestServer.getServerHost(), QuicTestServer.getSe rverPort(), 38 builder.addQuicHint(QuicTestServer.getServerHost(), QuicTestServer.getSe rverPort(),
39 QuicTestServer.getServerPort()); 39 QuicTestServer.getServerPort());
40 40
41 JSONObject quicParams = 41 JSONObject quicParams = new JSONObject()
42 new JSONObject().put("connection_options", "PACE,IW10,FOO,DEADBE EF"); 42 .put("connection_options", "PACE,IW10,FO O,DEADBEEF")
43 .put("store_server_configs_in_properties ", true)
44 .put("delay_tcp_race", true)
45 .put("max_number_of_lossy_connections", 10)
46 .put("packet_loss_threshold", 0.5);
43 JSONObject experimentalOptions = new JSONObject().put("QUIC", quicParams ); 47 JSONObject experimentalOptions = new JSONObject().put("QUIC", quicParams );
44 builder.setExperimentalOptions(experimentalOptions.toString()); 48 builder.setExperimentalOptions(experimentalOptions.toString());
45 49
46 builder.setMockCertVerifierForTesting(MockCertVerifier.createMockCertVer ifier(CERTS_USED)); 50 builder.setMockCertVerifierForTesting(MockCertVerifier.createMockCertVer ifier(CERTS_USED));
47 builder.setStoragePath(CronetTestFramework.getTestStorage(getContext())) ; 51 builder.setStoragePath(CronetTestFramework.getTestStorage(getContext())) ;
48 builder.enableHttpCache(CronetEngine.Builder.HTTP_CACHE_DISK_NO_HTTP, 10 00 * 1024); 52 builder.enableHttpCache(CronetEngine.Builder.HTTP_CACHE_DISK_NO_HTTP, 10 00 * 1024);
49 53
50 mTestFramework = startCronetTestFrameworkWithUrlAndCronetEngineBuilder(n ull, builder); 54 mTestFramework = startCronetTestFrameworkWithUrlAndCronetEngineBuilder(n ull, builder);
51 } 55 }
52 56
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 @SuppressFBWarnings("OBL_UNSATISFIED_OBLIGATION_EXCEPTION_EDGE") 159 @SuppressFBWarnings("OBL_UNSATISFIED_OBLIGATION_EXCEPTION_EDGE")
156 private boolean fileContainsString(String filename, String content) throws I OException { 160 private boolean fileContainsString(String filename, String content) throws I OException {
157 File file = new File(CronetTestFramework.getTestStorage(getContext()) + "/" + filename); 161 File file = new File(CronetTestFramework.getTestStorage(getContext()) + "/" + filename);
158 FileInputStream fileInputStream = new FileInputStream(file); 162 FileInputStream fileInputStream = new FileInputStream(file);
159 byte[] data = new byte[(int) file.length()]; 163 byte[] data = new byte[(int) file.length()];
160 fileInputStream.read(data); 164 fileInputStream.read(data);
161 fileInputStream.close(); 165 fileInputStream.close();
162 return new String(data, "UTF-8").contains(content); 166 return new String(data, "UTF-8").contains(content);
163 } 167 }
164 } 168 }
OLDNEW
« no previous file with comments | « components/cronet.gypi ('k') | components/cronet/run_all_unittests.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698