| 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.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 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 187 "Bad URL: " + host + ":" + port + "/" + resource); | 187 "Bad URL: " + host + ":" + port + "/" + resource); |
| 188 } | 188 } |
| 189 final CronetEngine.Builder cronetEngineBuilder = | 189 final CronetEngine.Builder cronetEngineBuilder = |
| 190 new CronetEngine.Builder(CronetPerfTestActivity.this); | 190 new CronetEngine.Builder(CronetPerfTestActivity.this); |
| 191 cronetEngineBuilder.setLibraryName("cronet_tests"); | 191 cronetEngineBuilder.setLibraryName("cronet_tests"); |
| 192 if (mProtocol == Protocol.QUIC) { | 192 if (mProtocol == Protocol.QUIC) { |
| 193 cronetEngineBuilder.enableQUIC(true); | 193 cronetEngineBuilder.enableQUIC(true); |
| 194 cronetEngineBuilder.addQuicHint(host, port, port); | 194 cronetEngineBuilder.addQuicHint(host, port, port); |
| 195 cronetEngineBuilder.setMockCertVerifierForTesting( | 195 cronetEngineBuilder.setMockCertVerifierForTesting( |
| 196 MockCertVerifier.createMockCertVerifier( | 196 MockCertVerifier.createMockCertVerifier( |
| 197 new String[] {getConfigString("QUIC_CERT_FILE")}
)); | 197 new String[] {getConfigString("QUIC_CERT_FILE")}
, true)); |
| 198 } | 198 } |
| 199 | 199 |
| 200 try { | 200 try { |
| 201 JSONObject quicParams = new JSONObject().put("host_whitelist", h
ost); | 201 JSONObject quicParams = new JSONObject().put("host_whitelist", h
ost); |
| 202 JSONObject experimentalOptions = new JSONObject().put("QUIC", qu
icParams); | 202 JSONObject experimentalOptions = new JSONObject().put("QUIC", qu
icParams); |
| 203 cronetEngineBuilder.setExperimentalOptions(experimentalOptions.t
oString()); | 203 cronetEngineBuilder.setExperimentalOptions(experimentalOptions.t
oString()); |
| 204 } catch (JSONException e) { | 204 } catch (JSONException e) { |
| 205 throw new IllegalStateException("JSON failed: " + e); | 205 throw new IllegalStateException("JSON failed: " + e); |
| 206 } | 206 } |
| 207 mCronetEngine = cronetEngineBuilder.build(); | 207 mCronetEngine = cronetEngineBuilder.build(); |
| (...skipping 401 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 609 | 609 |
| 610 @Override | 610 @Override |
| 611 public void onCreate(Bundle savedInstanceState) { | 611 public void onCreate(Bundle savedInstanceState) { |
| 612 super.onCreate(savedInstanceState); | 612 super.onCreate(savedInstanceState); |
| 613 PathUtils.setPrivateDataDirectorySuffix(PRIVATE_DATA_DIRECTORY_SUFFIX, t
his); | 613 PathUtils.setPrivateDataDirectorySuffix(PRIVATE_DATA_DIRECTORY_SUFFIX, t
his); |
| 614 mConfig = getIntent().getData(); | 614 mConfig = getIntent().getData(); |
| 615 // Execute benchmarks on another thread to avoid networking on main thre
ad. | 615 // Execute benchmarks on another thread to avoid networking on main thre
ad. |
| 616 new BenchmarkTask().execute(); | 616 new BenchmarkTask().execute(); |
| 617 } | 617 } |
| 618 } | 618 } |
| OLD | NEW |