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

Side by Side Diff: components/cronet/android/test/javatests/src/org/chromium/net/CronetTestBase.java

Issue 2847523002: Android: Remove GetApplicationContext part 4 (Closed)
Patch Set: Rebase and fix build Created 3 years, 7 months 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.test.AndroidTestCase; 7 import android.test.AndroidTestCase;
8 8
9 import org.chromium.base.ContextUtils; 9 import org.chromium.base.ContextUtils;
10 import org.chromium.base.PathUtils; 10 import org.chromium.base.PathUtils;
(...skipping 29 matching lines...) Expand all
40 private CronetTestFramework mCronetTestFramework; 40 private CronetTestFramework mCronetTestFramework;
41 // {@code true} when test is being run against system HttpURLConnection impl ementation. 41 // {@code true} when test is being run against system HttpURLConnection impl ementation.
42 private boolean mTestingSystemHttpURLConnection; 42 private boolean mTestingSystemHttpURLConnection;
43 private boolean mTestingJavaImpl = false; 43 private boolean mTestingJavaImpl = false;
44 44
45 @Override 45 @Override
46 protected void setUp() throws Exception { 46 protected void setUp() throws Exception {
47 super.setUp(); 47 super.setUp();
48 System.loadLibrary("cronet_tests"); 48 System.loadLibrary("cronet_tests");
49 ContextUtils.initApplicationContext(getContext().getApplicationContext() ); 49 ContextUtils.initApplicationContext(getContext().getApplicationContext() );
50 ContextUtils.initApplicationContextForNative();
51 PathUtils.setPrivateDataDirectorySuffix(PRIVATE_DATA_DIRECTORY_SUFFIX); 50 PathUtils.setPrivateDataDirectorySuffix(PRIVATE_DATA_DIRECTORY_SUFFIX);
52 CronetTestFramework.prepareTestStorage(getContext()); 51 CronetTestFramework.prepareTestStorage(getContext());
53 } 52 }
54 53
55 /** 54 /**
56 * Starts the CronetTest framework. 55 * Starts the CronetTest framework.
57 */ 56 */
58 protected CronetTestFramework startCronetTestFramework() { 57 protected CronetTestFramework startCronetTestFramework() {
59 return startCronetTestFrameworkWithUrlAndCronetEngineBuilder(null, null) ; 58 return startCronetTestFrameworkWithUrlAndCronetEngineBuilder(null, null) ;
60 } 59 }
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
202 201
203 @Target(ElementType.METHOD) 202 @Target(ElementType.METHOD)
204 @Retention(RetentionPolicy.RUNTIME) 203 @Retention(RetentionPolicy.RUNTIME)
205 public @interface OnlyRunCronetHttpURLConnection { 204 public @interface OnlyRunCronetHttpURLConnection {
206 } 205 }
207 206
208 @Target(ElementType.METHOD) 207 @Target(ElementType.METHOD)
209 @Retention(RetentionPolicy.RUNTIME) 208 @Retention(RetentionPolicy.RUNTIME)
210 public @interface OnlyRunNativeCronet {} 209 public @interface OnlyRunNativeCronet {}
211 } 210 }
OLDNEW
« no previous file with comments | « components/cronet/android/test/cronet_test_jni.cc ('k') | content/browser/service_manager/service_manager_context.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698