void didReceiveResponse(WebURLLoader* loader, const WebURLResponse& response) override
 {
     m_didReceiveResponse = true;
     m_actualResponse = WebURLResponse(response);
     EXPECT_EQ(m_expectedLoader, loader);
     EXPECT_EQ(m_expectedResponse.url(), response.url());
     EXPECT_EQ(m_expectedResponse.httpStatusCode(), response.httpStatusCode());
 }
 // WebURLLoaderClient implementation.
 void willSendRequest(WebURLLoader* loader, WebURLRequest& newRequest, const WebURLResponse& redirectResponse) override
 {
     m_willSendRequest = true;
     EXPECT_EQ(m_expectedLoader, loader);
     EXPECT_EQ(m_expectedNewRequest.url(), newRequest.url());
     // Check that CORS simple headers are transferred to the new request.
     EXPECT_EQ(m_expectedNewRequest.httpHeaderField("accept"), newRequest.httpHeaderField("accept"));
     EXPECT_EQ(m_expectedRedirectResponse.url(), redirectResponse.url());
     EXPECT_EQ(m_expectedRedirectResponse.httpStatusCode(), redirectResponse.httpStatusCode());
     EXPECT_EQ(m_expectedRedirectResponse.mimeType(), redirectResponse.mimeType());
 }
Exemple #3
0
static void printResponseDescription(const WebURLResponse& response)
{
    if (response.isNull()) {
        fputs("(null)", stdout);
        return;
    }
    string url = response.url().spec();
    printf("<NSURLResponse %s, http status code %d>",
           descriptionSuitableForTestResult(url).c_str(),
           response.httpStatusCode());
}