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

Side by Side Diff: components/cronet/android/test/javaperftests/src/org/chromium/net/CronetPerfTestActivity.java

Issue 2406273002: [Cronet] Test the libcronet that's shipped, not libcronet_test (Closed)
Patch Set: fix shutdown race Created 4 years, 1 month 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
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.annotation.SuppressLint; 7 import android.annotation.SuppressLint;
8 import android.app.Activity; 8 import android.app.Activity;
9 import android.net.Uri; 9 import android.net.Uri;
10 import android.os.AsyncTask; 10 import android.os.AsyncTask;
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
182 throw new IllegalArgumentException("Unknown protocol: " + pr otocol); 182 throw new IllegalArgumentException("Unknown protocol: " + pr otocol);
183 } 183 }
184 try { 184 try {
185 mUrl = new URL(scheme, host, port, resource); 185 mUrl = new URL(scheme, host, port, resource);
186 } catch (MalformedURLException e) { 186 } catch (MalformedURLException e) {
187 throw new IllegalArgumentException( 187 throw new IllegalArgumentException(
188 "Bad URL: " + host + ":" + port + "/" + resource); 188 "Bad URL: " + host + ":" + port + "/" + resource);
189 } 189 }
190 final ExperimentalCronetEngine.Builder cronetEngineBuilder = 190 final ExperimentalCronetEngine.Builder cronetEngineBuilder =
191 new ExperimentalCronetEngine.Builder(CronetPerfTestActivity. this); 191 new ExperimentalCronetEngine.Builder(CronetPerfTestActivity. this);
192 CronetTestUtil.setLibraryName(cronetEngineBuilder, "cronet_tests"); 192 System.loadLibrary("cronet_tests");
193 if (mProtocol == Protocol.QUIC) { 193 if (mProtocol == Protocol.QUIC) {
194 cronetEngineBuilder.enableQuic(true); 194 cronetEngineBuilder.enableQuic(true);
195 cronetEngineBuilder.addQuicHint(host, port, port); 195 cronetEngineBuilder.addQuicHint(host, port, port);
196 CronetTestUtil.setMockCertVerifierForTesting(cronetEngineBuilder , 196 CronetTestUtil.setMockCertVerifierForTesting(cronetEngineBuilder ,
197 MockCertVerifier.createMockCertVerifier( 197 MockCertVerifier.createMockCertVerifier(
198 new String[] {getConfigString("QUIC_CERT_FILE")} , true)); 198 new String[] {getConfigString("QUIC_CERT_FILE")} , true));
199 } 199 }
200 200
201 try { 201 try {
202 JSONObject quicParams = new JSONObject().put("host_whitelist", h ost); 202 JSONObject quicParams = new JSONObject().put("host_whitelist", h ost);
(...skipping 417 matching lines...) Expand 10 before | Expand all | Expand 10 after
620 public void onCreate(Bundle savedInstanceState) { 620 public void onCreate(Bundle savedInstanceState) {
621 super.onCreate(savedInstanceState); 621 super.onCreate(savedInstanceState);
622 // Initializing application context here due to lack of custom CronetPer fTestApplication. 622 // Initializing application context here due to lack of custom CronetPer fTestApplication.
623 ContextUtils.initApplicationContext(getApplicationContext()); 623 ContextUtils.initApplicationContext(getApplicationContext());
624 PathUtils.setPrivateDataDirectorySuffix(PRIVATE_DATA_DIRECTORY_SUFFIX); 624 PathUtils.setPrivateDataDirectorySuffix(PRIVATE_DATA_DIRECTORY_SUFFIX);
625 mConfig = getIntent().getData(); 625 mConfig = getIntent().getData();
626 // Execute benchmarks on another thread to avoid networking on main thre ad. 626 // Execute benchmarks on another thread to avoid networking on main thre ad.
627 new BenchmarkTask().execute(); 627 new BenchmarkTask().execute();
628 } 628 }
629 } 629 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698