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

Side by Side Diff: components/cronet/android/test/src/org/chromium/net/CronetTestFramework.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 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
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
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698