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 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
109 WebCache::clear(); | 109 WebCache::clear(); |
110 } | 110 } |
111 | 111 |
112 void serveRequests() { | 112 void serveRequests() { |
113 Platform::current()->getURLLoaderMockFactory()->serveAsynchronousRequests(); | 113 Platform::current()->getURLLoaderMockFactory()->serveAsynchronousRequests(); |
114 } | 114 } |
115 | 115 |
116 std::unique_ptr<WebAssociatedURLLoader> createAssociatedURLLoader( | 116 std::unique_ptr<WebAssociatedURLLoader> createAssociatedURLLoader( |
117 const WebAssociatedURLLoaderOptions options = | 117 const WebAssociatedURLLoaderOptions options = |
118 WebAssociatedURLLoaderOptions()) { | 118 WebAssociatedURLLoaderOptions()) { |
119 return wrapUnique(mainFrame()->createAssociatedURLLoader(options)); | 119 return WTF::wrapUnique(mainFrame()->createAssociatedURLLoader(options)); |
120 } | 120 } |
121 | 121 |
122 // WebAssociatedURLLoaderClient implementation. | 122 // WebAssociatedURLLoaderClient implementation. |
123 bool willFollowRedirect(const WebURLRequest& newRequest, | 123 bool willFollowRedirect(const WebURLRequest& newRequest, |
124 const WebURLResponse& redirectResponse) override { | 124 const WebURLResponse& redirectResponse) override { |
125 m_willFollowRedirect = true; | 125 m_willFollowRedirect = true; |
126 EXPECT_EQ(m_expectedNewRequest.url(), newRequest.url()); | 126 EXPECT_EQ(m_expectedNewRequest.url(), newRequest.url()); |
127 // Check that CORS simple headers are transferred to the new request. | 127 // Check that CORS simple headers are transferred to the new request. |
128 EXPECT_EQ(m_expectedNewRequest.httpHeaderField("accept"), | 128 EXPECT_EQ(m_expectedNewRequest.httpHeaderField("accept"), |
129 newRequest.httpHeaderField("accept")); | 129 newRequest.httpHeaderField("accept")); |
(...skipping 547 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
677 m_expectedLoader->loadAsynchronously(request, this); | 677 m_expectedLoader->loadAsynchronously(request, this); |
678 serveRequests(); | 678 serveRequests(); |
679 EXPECT_TRUE(m_didReceiveResponse); | 679 EXPECT_TRUE(m_didReceiveResponse); |
680 EXPECT_TRUE(m_didReceiveData); | 680 EXPECT_TRUE(m_didReceiveData); |
681 EXPECT_TRUE(m_didFinishLoading); | 681 EXPECT_TRUE(m_didFinishLoading); |
682 | 682 |
683 EXPECT_FALSE(m_actualResponse.httpHeaderField(headerNameString).isEmpty()); | 683 EXPECT_FALSE(m_actualResponse.httpHeaderField(headerNameString).isEmpty()); |
684 } | 684 } |
685 | 685 |
686 } // namespace blink | 686 } // namespace blink |
OLD | NEW |