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

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

Issue 2805053005: [Cronet] Enable Brotli (Closed)
Patch Set: restore 0x03 in test Created 3 years, 8 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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.ConditionVariable; 8 import android.os.ConditionVariable;
9 9
10 import org.chromium.base.Log; 10 import org.chromium.base.Log;
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 return getServerUrl() + Http2TestHandler.ECHO_STREAM_PATH; 86 return getServerUrl() + Http2TestHandler.ECHO_STREAM_PATH;
87 } 87 }
88 88
89 /** 89 /**
90 * @return url of the server resource which will echo request headers as res ponse trailers. 90 * @return url of the server resource which will echo request headers as res ponse trailers.
91 */ 91 */
92 public static String getEchoTrailersUrl() { 92 public static String getEchoTrailersUrl() {
93 return getServerUrl() + Http2TestHandler.ECHO_TRAILERS_PATH; 93 return getServerUrl() + Http2TestHandler.ECHO_TRAILERS_PATH;
94 } 94 }
95 95
96 /**
97 * @return url of a brotli-encoded server resource.
98 */
99 public static String getServeSimpleBrotliResponse() {
100 return getServerUrl() + Http2TestHandler.SERVE_SIMPLE_BROTLI_RESPONSE;
101 }
102
96 public static boolean startHttp2TestServer( 103 public static boolean startHttp2TestServer(
97 Context context, String certFileName, String keyFileName) throws Exc eption { 104 Context context, String certFileName, String keyFileName) throws Exc eption {
98 new Thread( 105 new Thread(
99 new Http2TestServerRunnable(new File(CertTestUtil.CERTS_DIRECTOR Y + certFileName), 106 new Http2TestServerRunnable(new File(CertTestUtil.CERTS_DIRECTOR Y + certFileName),
100 new File(CertTestUtil.CERTS_DIRECTORY + keyFileName))) 107 new File(CertTestUtil.CERTS_DIRECTORY + keyFileName)))
101 .start(); 108 .start();
102 sBlock.block(); 109 sBlock.block();
103 return true; 110 return true;
104 } 111 }
105 112
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
170 throws Exception { 177 throws Exception {
171 if (ApplicationProtocolNames.HTTP_2.equals(protocol)) { 178 if (ApplicationProtocolNames.HTTP_2.equals(protocol)) {
172 ctx.pipeline().addLast(new Http2TestHandler.Builder().build()); 179 ctx.pipeline().addLast(new Http2TestHandler.Builder().build());
173 return; 180 return;
174 } 181 }
175 182
176 throw new IllegalStateException("unknown protocol: " + protocol); 183 throw new IllegalStateException("unknown protocol: " + protocol);
177 } 184 }
178 } 185 }
179 } 186 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698