OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2013, Google Inc. All rights reserved. | 2 * Copyright (c) 2013, 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 407 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
418 cleanUp(); | 418 cleanUp(); |
419 } | 419 } |
420 | 420 |
421 void registerRedirect(const WebString& fromURL, const WebString& toURL) | 421 void registerRedirect(const WebString& fromURL, const WebString& toURL) |
422 { | 422 { |
423 KURL redirectURL(ParsedURLString, fromURL); | 423 KURL redirectURL(ParsedURLString, fromURL); |
424 WebURLResponse redirectResponse; | 424 WebURLResponse redirectResponse; |
425 redirectResponse.setURL(redirectURL); | 425 redirectResponse.setURL(redirectURL); |
426 redirectResponse.setHTTPStatusCode(301); | 426 redirectResponse.setHTTPStatusCode(301); |
427 redirectResponse.setHTTPHeaderField(HTTPNames::Location, toURL); | 427 redirectResponse.setHTTPHeaderField(HTTPNames::Location, toURL); |
| 428 redirectResponse.addToEncodedDataLength(kRedirectResponseOverheadBytes); |
428 Platform::current()->getURLLoaderMockFactory()->registerURL(redirectURL,
redirectResponse, ""); | 429 Platform::current()->getURLLoaderMockFactory()->registerURL(redirectURL,
redirectResponse, ""); |
429 } | 430 } |
430 | 431 |
431 void registerFinalResource(const WebString& url) | 432 void registerFinalResource(const WebString& url) |
432 { | 433 { |
433 KURL finalURL(ParsedURLString, url); | 434 KURL finalURL(ParsedURLString, url); |
434 WebURLResponse finalResponse; | 435 WebURLResponse finalResponse; |
435 finalResponse.setURL(finalURL); | 436 finalResponse.setURL(finalURL); |
436 finalResponse.setHTTPStatusCode(200); | 437 finalResponse.setHTTPStatusCode(200); |
437 URLTestHelpers::registerMockedURLLoadWithCustomResponse(finalURL, testIm
ageFilename, "", finalResponse); | 438 URLTestHelpers::registerMockedURLLoadWithCustomResponse(finalURL, testIm
ageFilename, "", finalResponse); |
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
634 EXPECT_TRUE(memoryCache()->contains(resource)); | 635 EXPECT_TRUE(memoryCache()->contains(resource)); |
635 EXPECT_TRUE(resource->isPreloaded()); | 636 EXPECT_TRUE(resource->isPreloaded()); |
636 | 637 |
637 // DCL reached on second fetcher | 638 // DCL reached on second fetcher |
638 fetcher2->clearPreloads(ResourceFetcher::ClearSpeculativeMarkupPreloads); | 639 fetcher2->clearPreloads(ResourceFetcher::ClearSpeculativeMarkupPreloads); |
639 EXPECT_TRUE(memoryCache()->contains(resource)); | 640 EXPECT_TRUE(memoryCache()->contains(resource)); |
640 EXPECT_FALSE(resource->isPreloaded()); | 641 EXPECT_FALSE(resource->isPreloaded()); |
641 } | 642 } |
642 | 643 |
643 } // namespace blink | 644 } // namespace blink |
OLD | NEW |