OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 } | 113 } |
114 | 114 |
115 std::unique_ptr<WebURLLoader> createAssociatedURLLoader( | 115 std::unique_ptr<WebURLLoader> createAssociatedURLLoader( |
116 const WebURLLoaderOptions options = WebURLLoaderOptions()) { | 116 const WebURLLoaderOptions options = WebURLLoaderOptions()) { |
117 return wrapUnique(mainFrame()->createAssociatedURLLoader(options)); | 117 return wrapUnique(mainFrame()->createAssociatedURLLoader(options)); |
118 } | 118 } |
119 | 119 |
120 // WebURLLoaderClient implementation. | 120 // WebURLLoaderClient implementation. |
121 void willFollowRedirect(WebURLLoader* loader, | 121 void willFollowRedirect(WebURLLoader* loader, |
122 WebURLRequest& newRequest, | 122 WebURLRequest& newRequest, |
123 const WebURLResponse& redirectResponse, | 123 const WebURLResponse& redirectResponse) override { |
124 int64_t encodedDataLength) override { | |
125 m_willFollowRedirect = true; | 124 m_willFollowRedirect = true; |
126 EXPECT_EQ(m_expectedLoader.get(), loader); | 125 EXPECT_EQ(m_expectedLoader.get(), loader); |
127 EXPECT_EQ(m_expectedNewRequest.url(), newRequest.url()); | 126 EXPECT_EQ(m_expectedNewRequest.url(), newRequest.url()); |
128 // Check that CORS simple headers are transferred to the new request. | 127 // Check that CORS simple headers are transferred to the new request. |
129 EXPECT_EQ(m_expectedNewRequest.httpHeaderField("accept"), | 128 EXPECT_EQ(m_expectedNewRequest.httpHeaderField("accept"), |
130 newRequest.httpHeaderField("accept")); | 129 newRequest.httpHeaderField("accept")); |
131 EXPECT_EQ(m_expectedRedirectResponse.url(), redirectResponse.url()); | 130 EXPECT_EQ(m_expectedRedirectResponse.url(), redirectResponse.url()); |
132 EXPECT_EQ(m_expectedRedirectResponse.httpStatusCode(), | 131 EXPECT_EQ(m_expectedRedirectResponse.httpStatusCode(), |
133 redirectResponse.httpStatusCode()); | 132 redirectResponse.httpStatusCode()); |
134 EXPECT_EQ(m_expectedRedirectResponse.mimeType(), | 133 EXPECT_EQ(m_expectedRedirectResponse.mimeType(), |
(...skipping 578 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
713 m_expectedLoader->loadAsynchronously(request, this); | 712 m_expectedLoader->loadAsynchronously(request, this); |
714 serveRequests(); | 713 serveRequests(); |
715 EXPECT_TRUE(m_didReceiveResponse); | 714 EXPECT_TRUE(m_didReceiveResponse); |
716 EXPECT_TRUE(m_didReceiveData); | 715 EXPECT_TRUE(m_didReceiveData); |
717 EXPECT_TRUE(m_didFinishLoading); | 716 EXPECT_TRUE(m_didFinishLoading); |
718 | 717 |
719 EXPECT_FALSE(m_actualResponse.httpHeaderField(headerNameString).isEmpty()); | 718 EXPECT_FALSE(m_actualResponse.httpHeaderField(headerNameString).isEmpty()); |
720 } | 719 } |
721 | 720 |
722 } // namespace blink | 721 } // namespace blink |
OLD | NEW |