| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "core/loader/ThreadableLoader.h" | 5 #include "core/loader/ThreadableLoader.h" |
| 6 | 6 |
| 7 #include "core/dom/CrossThreadTask.h" | 7 #include "core/dom/CrossThreadTask.h" |
| 8 #include "core/fetch/MemoryCache.h" | 8 #include "core/fetch/MemoryCache.h" |
| 9 #include "core/fetch/ResourceLoaderOptions.h" | 9 #include "core/fetch/ResourceLoaderOptions.h" |
| 10 #include "core/loader/DocumentThreadableLoader.h" | 10 #include "core/loader/DocumentThreadableLoader.h" |
| (...skipping 378 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 389 } | 389 } |
| 390 | 390 |
| 391 void setUpRedirectURL() | 391 void setUpRedirectURL() |
| 392 { | 392 { |
| 393 KURL url = redirectURL(); | 393 KURL url = redirectURL(); |
| 394 | 394 |
| 395 WebURLLoadTiming timing; | 395 WebURLLoadTiming timing; |
| 396 timing.initialize(); | 396 timing.initialize(); |
| 397 | 397 |
| 398 WebURLResponse response; | 398 WebURLResponse response; |
| 399 response.initialize(); | |
| 400 response.setURL(url); | 399 response.setURL(url); |
| 401 response.setHTTPStatusCode(301); | 400 response.setHTTPStatusCode(301); |
| 402 response.setLoadTiming(timing); | 401 response.setLoadTiming(timing); |
| 403 response.addHTTPHeaderField("Location", successURL().getString()); | 402 response.addHTTPHeaderField("Location", successURL().getString()); |
| 404 response.addHTTPHeaderField("Access-Control-Allow-Origin", "null"); | 403 response.addHTTPHeaderField("Access-Control-Allow-Origin", "null"); |
| 405 | 404 |
| 406 URLTestHelpers::registerMockedURLLoadWithCustomResponse(url, "fox-null-t
erminated.html", "", response); | 405 URLTestHelpers::registerMockedURLLoadWithCustomResponse(url, "fox-null-t
erminated.html", "", response); |
| 407 } | 406 } |
| 408 | 407 |
| 409 void setUpRedirectLoopURL() | 408 void setUpRedirectLoopURL() |
| 410 { | 409 { |
| 411 KURL url = redirectLoopURL(); | 410 KURL url = redirectLoopURL(); |
| 412 | 411 |
| 413 WebURLLoadTiming timing; | 412 WebURLLoadTiming timing; |
| 414 timing.initialize(); | 413 timing.initialize(); |
| 415 | 414 |
| 416 WebURLResponse response; | 415 WebURLResponse response; |
| 417 response.initialize(); | |
| 418 response.setURL(url); | 416 response.setURL(url); |
| 419 response.setHTTPStatusCode(301); | 417 response.setHTTPStatusCode(301); |
| 420 response.setLoadTiming(timing); | 418 response.setLoadTiming(timing); |
| 421 response.addHTTPHeaderField("Location", redirectLoopURL().getString()); | 419 response.addHTTPHeaderField("Location", redirectLoopURL().getString()); |
| 422 response.addHTTPHeaderField("Access-Control-Allow-Origin", "null"); | 420 response.addHTTPHeaderField("Access-Control-Allow-Origin", "null"); |
| 423 | 421 |
| 424 URLTestHelpers::registerMockedURLLoadWithCustomResponse(url, "fox-null-t
erminated.html", "", response); | 422 URLTestHelpers::registerMockedURLLoadWithCustomResponse(url, "fox-null-t
erminated.html", "", response); |
| 425 } | 423 } |
| 426 | 424 |
| 427 std::unique_ptr<MockThreadableLoaderClient> m_client; | 425 std::unique_ptr<MockThreadableLoaderClient> m_client; |
| (...skipping 405 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 833 EXPECT_CALL(*client(), didFailRedirectCheck()).WillOnce(InvokeWithoutArgs(th
is, &ThreadableLoaderTest::clearLoader)); | 831 EXPECT_CALL(*client(), didFailRedirectCheck()).WillOnce(InvokeWithoutArgs(th
is, &ThreadableLoaderTest::clearLoader)); |
| 834 | 832 |
| 835 startLoader(redirectLoopURL()); | 833 startLoader(redirectLoopURL()); |
| 836 callCheckpoint(2); | 834 callCheckpoint(2); |
| 837 serveRequests(); | 835 serveRequests(); |
| 838 } | 836 } |
| 839 | 837 |
| 840 } // namespace | 838 } // namespace |
| 841 | 839 |
| 842 } // namespace blink | 840 } // namespace blink |
| OLD | NEW |