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

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

Issue 1112513003: Put Data Reduction Proxy support in Cronet behind a gyp flag (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@cronet
Patch Set: Addressed comments Created 5 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.content.Context; 7 import android.content.Context;
8 import android.content.ContextWrapper; 8 import android.content.ContextWrapper;
9 import android.os.ConditionVariable; 9 import android.os.ConditionVariable;
10 import android.os.Handler; 10 import android.os.Handler;
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 mActivity = launchCronetTestAppAndSkipFactoryInit(); 109 mActivity = launchCronetTestAppAndSkipFactoryInit();
110 110
111 // Ensure native code is loaded before trying to start test server. 111 // Ensure native code is loaded before trying to start test server.
112 UrlRequestContext.createContext( 112 UrlRequestContext.createContext(
113 getInstrumentation().getTargetContext(), 113 getInstrumentation().getTargetContext(),
114 new UrlRequestContextConfig().setLibraryName("cronet_tests")) 114 new UrlRequestContextConfig().setLibraryName("cronet_tests"))
115 .shutdown(); 115 .shutdown();
116 116
117 assertTrue(NativeTestServer.startNativeTestServer( 117 assertTrue(NativeTestServer.startNativeTestServer(
118 getInstrumentation().getTargetContext())); 118 getInstrumentation().getTargetContext()));
119 119 if (!NativeTestServer.isDataReductionProxySupported()) {
120 return;
121 }
120 String serverHostPort = NativeTestServer.getHostPort(); 122 String serverHostPort = NativeTestServer.getHostPort();
121 123
122 // Enable the Data Reduction Proxy and configure it to use the test 124 // Enable the Data Reduction Proxy and configure it to use the test
123 // server as its primary proxy, and to check successfully that this 125 // server as its primary proxy, and to check successfully that this
124 // proxy is OK to use. 126 // proxy is OK to use.
125 UrlRequestContextConfig config = new UrlRequestContextConfig(); 127 UrlRequestContextConfig config = new UrlRequestContextConfig();
126 config.enableDataReductionProxy("test-key"); 128 config.enableDataReductionProxy("test-key");
127 config.setDataReductionProxyOptions( 129 config.setDataReductionProxyOptions(
128 serverHostPort, "unused.net:9999", 130 serverHostPort, "unused.net:9999",
129 NativeTestServer.getFileURL("/secureproxychecksuccess.txt")); 131 NativeTestServer.getFileURL("/secureproxychecksuccess.txt"));
(...skipping 537 matching lines...) Expand 10 before | Expand all | Expand 10 after
667 new CronetUrlRequestContext(mActivity, mActivity.getContextConfi g()); 669 new CronetUrlRequestContext(mActivity, mActivity.getContextConfi g());
668 CronetUrlRequestContext secondContext = new CronetUrlRequestContext( 670 CronetUrlRequestContext secondContext = new CronetUrlRequestContext(
669 mActivity.getApplicationContext(), mActivity.getContextConfig()) ; 671 mActivity.getApplicationContext(), mActivity.getContextConfig()) ;
670 CronetUrlRequestContext thirdContext = new CronetUrlRequestContext( 672 CronetUrlRequestContext thirdContext = new CronetUrlRequestContext(
671 new ContextWrapper(mActivity), mActivity.getContextConfig()); 673 new ContextWrapper(mActivity), mActivity.getContextConfig());
672 firstContext.shutdown(); 674 firstContext.shutdown();
673 secondContext.shutdown(); 675 secondContext.shutdown();
674 thirdContext.shutdown(); 676 thirdContext.shutdown();
675 } 677 }
676 } 678 }
OLDNEW
« no previous file with comments | « components/cronet/android/cronet_url_request_context_adapter.cc ('k') | components/cronet/android/test/native_test_server.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698