Skip to content

Commit 7098038

Browse files
Jesse WilsonAndroid (Google) Code Review
authored andcommitted
Merge "Test to demonstrate NPE in DefaultRequestDirector"
2 parents 05aa1fe + de5d7d2 commit 7098038

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

core/tests/coretests/src/android/net/http/AbstractProxyTest.java

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,23 @@ public void testExplicitNoProxyCancelsSystemProperty() throws Exception {
219219
assertEquals("GET /bar HTTP/1.1", recordedRequest.getRequestLine());
220220
}
221221

222+
// http://b/5372438
223+
public void testRetryWithProxy() throws Exception {
224+
server.enqueue(new MockResponse()
225+
.setSocketPolicy(SocketPolicy.DISCONNECT_AT_START));
226+
server.play();
227+
228+
HttpClient httpProxyClient = newHttpClient();
229+
HttpGet request = new HttpGet("http://android.com/foo");
230+
ProxyConfig.REQUEST_PARAMETER.configure(server, httpProxyClient, request);
231+
232+
try {
233+
httpProxyClient.execute(request);
234+
fail();
235+
} catch (IOException expected) {
236+
}
237+
}
238+
222239
enum ProxyConfig {
223240
PROXY_SYSTEM_PROPERTY() {
224241
@Override void configure(MockWebServer server, HttpClient client, HttpRequest request) {

0 commit comments

Comments
 (0)