OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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.content.Context; | 7 import android.content.Context; |
8 import android.os.Environment; | 8 import android.os.Environment; |
9 | 9 |
10 import static junit.framework.Assert.assertEquals; | 10 import static junit.framework.Assert.assertEquals; |
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
188 } else if (CACHE_IN_MEMORY.equals(cacheString)) { | 188 } else if (CACHE_IN_MEMORY.equals(cacheString)) { |
189 cronetEngineBuilder.enableHttpCache( | 189 cronetEngineBuilder.enableHttpCache( |
190 CronetEngine.Builder.HTTP_CACHE_IN_MEMORY, 100 * 1024); | 190 CronetEngine.Builder.HTTP_CACHE_IN_MEMORY, 100 * 1024); |
191 } | 191 } |
192 | 192 |
193 String sdchString = getCommandLineArg(SDCH_KEY); | 193 String sdchString = getCommandLineArg(SDCH_KEY); |
194 if (SDCH_ENABLE.equals(sdchString)) { | 194 if (SDCH_ENABLE.equals(sdchString)) { |
195 cronetEngineBuilder.enableSdch(true); | 195 cronetEngineBuilder.enableSdch(true); |
196 } | 196 } |
197 | 197 |
198 // Setting this here so it isn't overridden on the command line | |
199 CronetTestUtil.setLibraryName(cronetEngineBuilder, "cronet_tests"); | |
200 return cronetEngineBuilder; | 198 return cronetEngineBuilder; |
201 } | 199 } |
202 | 200 |
203 // Helper function to initialize Cronet engine. Also used in testing. | 201 // Helper function to initialize Cronet engine. Also used in testing. |
204 public CronetEngineBase initCronetEngine() { | 202 public CronetEngineBase initCronetEngine() { |
205 return (CronetEngineBase) mCronetEngineBuilder.build(); | 203 return (CronetEngineBase) mCronetEngineBuilder.build(); |
206 } | 204 } |
207 | 205 |
208 private String getCommandLineArg(String key) { | 206 private String getCommandLineArg(String key) { |
209 if (mCommandLine != null) { | 207 if (mCommandLine != null) { |
(...skipping 13 matching lines...) Expand all Loading... |
223 false); | 221 false); |
224 } | 222 } |
225 } | 223 } |
226 | 224 |
227 public void stopNetLog() { | 225 public void stopNetLog() { |
228 if (mCronetEngine != null) { | 226 if (mCronetEngine != null) { |
229 mCronetEngine.stopNetLog(); | 227 mCronetEngine.stopNetLog(); |
230 } | 228 } |
231 } | 229 } |
232 } | 230 } |
OLD | NEW |