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