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

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

Issue 1363723002: [Cronet] Create Builders, rename UrlRequestContext to CronetEngine (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: update Ben's tests Created 5 years, 2 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.content.ContextWrapper; 7 import android.content.ContextWrapper;
8 import android.test.suitebuilder.annotation.SmallTest; 8 import android.test.suitebuilder.annotation.SmallTest;
9 9
10 import org.chromium.base.test.util.Feature; 10 import org.chromium.base.test.util.Feature;
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 } 131 }
132 132
133 @SmallTest 133 @SmallTest
134 @Feature({"Cronet"}) 134 @Feature({"Cronet"})
135 public void testInitDifferentContexts() throws Exception { 135 public void testInitDifferentContexts() throws Exception {
136 // Test that concurrently instantiating ChromiumUrlRequestContext's upon 136 // Test that concurrently instantiating ChromiumUrlRequestContext's upon
137 // various different versions of the same Android Context does not cause 137 // various different versions of the same Android Context does not cause
138 // crashes like crbug.com/453845 138 // crashes like crbug.com/453845
139 final CronetTestActivity activity = launchCronetTestApp(); 139 final CronetTestActivity activity = launchCronetTestApp();
140 HttpUrlRequestFactory firstFactory = 140 HttpUrlRequestFactory firstFactory =
141 HttpUrlRequestFactory.createFactory(activity, activity.getContex tConfig()); 141 HttpUrlRequestFactory.createFactory(activity, activity.getCronet EngineBuilder());
142 HttpUrlRequestFactory secondFactory = HttpUrlRequestFactory.createFactor y( 142 HttpUrlRequestFactory secondFactory = HttpUrlRequestFactory.createFactor y(
143 activity.getApplicationContext(), activity.getContextConfig()); 143 activity.getApplicationContext(), activity.getCronetEngineBuilde r());
144 HttpUrlRequestFactory thirdFactory = HttpUrlRequestFactory.createFactory ( 144 HttpUrlRequestFactory thirdFactory = HttpUrlRequestFactory.createFactory (
145 new ContextWrapper(activity), activity.getContextConfig()); 145 new ContextWrapper(activity), activity.getCronetEngineBuilder()) ;
146 // Meager attempt to extend lifetimes to ensure they're concurrently 146 // Meager attempt to extend lifetimes to ensure they're concurrently
147 // alive. 147 // alive.
148 firstFactory.getName(); 148 firstFactory.getName();
149 secondFactory.getName(); 149 secondFactory.getName();
150 thirdFactory.getName(); 150 thirdFactory.getName();
151 } 151 }
152 } 152 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698