Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 70980383 authored by Jesse Wilson's avatar Jesse Wilson Committed by Android (Google) Code Review
Browse files

Merge "Test to demonstrate NPE in DefaultRequestDirector"

parents 05aa1fef de5d7d25
Loading
Loading
Loading
Loading
+17 −0
Original line number Diff line number Diff line
@@ -219,6 +219,23 @@ public abstract class AbstractProxyTest extends TestCase {
        assertEquals("GET /bar HTTP/1.1", recordedRequest.getRequestLine());
    }

    // http://b/5372438
    public void testRetryWithProxy() throws Exception {
        server.enqueue(new MockResponse()
                .setSocketPolicy(SocketPolicy.DISCONNECT_AT_START));
        server.play();

        HttpClient httpProxyClient = newHttpClient();
        HttpGet request = new HttpGet("http://android.com/foo");
        ProxyConfig.REQUEST_PARAMETER.configure(server, httpProxyClient, request);

        try {
            httpProxyClient.execute(request);
            fail();
        } catch (IOException expected) {
        }
    }

    enum ProxyConfig {
        PROXY_SYSTEM_PROPERTY() {
            @Override void configure(MockWebServer server, HttpClient client, HttpRequest request) {