| 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 337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 348 ScopedMockRedirectRequester() : m_context(nullptr) {} | 348 ScopedMockRedirectRequester() : m_context(nullptr) {} |
| 349 | 349 |
| 350 ~ScopedMockRedirectRequester() { cleanUp(); } | 350 ~ScopedMockRedirectRequester() { cleanUp(); } |
| 351 | 351 |
| 352 void registerRedirect(const WebString& fromURL, const WebString& toURL) { | 352 void registerRedirect(const WebString& fromURL, const WebString& toURL) { |
| 353 KURL redirectURL(ParsedURLString, fromURL); | 353 KURL redirectURL(ParsedURLString, fromURL); |
| 354 WebURLResponse redirectResponse; | 354 WebURLResponse redirectResponse; |
| 355 redirectResponse.setURL(redirectURL); | 355 redirectResponse.setURL(redirectURL); |
| 356 redirectResponse.setHTTPStatusCode(301); | 356 redirectResponse.setHTTPStatusCode(301); |
| 357 redirectResponse.setHTTPHeaderField(HTTPNames::Location, toURL); | 357 redirectResponse.setHTTPHeaderField(HTTPNames::Location, toURL); |
| 358 redirectResponse.addToEncodedDataLength(kRedirectResponseOverheadBytes); | 358 redirectResponse.setEncodedDataLength(kRedirectResponseOverheadBytes); |
| 359 Platform::current()->getURLLoaderMockFactory()->registerURL( | 359 Platform::current()->getURLLoaderMockFactory()->registerURL( |
| 360 redirectURL, redirectResponse, ""); | 360 redirectURL, redirectResponse, ""); |
| 361 } | 361 } |
| 362 | 362 |
| 363 void registerFinalResource(const WebString& url) { | 363 void registerFinalResource(const WebString& url) { |
| 364 KURL finalURL(ParsedURLString, url); | 364 KURL finalURL(ParsedURLString, url); |
| 365 URLTestHelpers::registerMockedURLLoad(finalURL, testImageFilename); | 365 URLTestHelpers::registerMockedURLLoad(finalURL, testImageFilename); |
| 366 } | 366 } |
| 367 | 367 |
| 368 void request(const WebString& url) { | 368 void request(const WebString& url) { |
| (...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 608 Platform::current()->getURLLoaderMockFactory()->registerURL( | 608 Platform::current()->getURLLoaderMockFactory()->registerURL( |
| 609 url, WebURLResponse(), ""); | 609 url, WebURLResponse(), ""); |
| 610 Resource* newResource = RawResource::fetch(fetchRequest, fetcher); | 610 Resource* newResource = RawResource::fetch(fetchRequest, fetcher); |
| 611 fetcher->stopFetching(); | 611 fetcher->stopFetching(); |
| 612 Platform::current()->getURLLoaderMockFactory()->unregisterURL(url); | 612 Platform::current()->getURLLoaderMockFactory()->unregisterURL(url); |
| 613 | 613 |
| 614 EXPECT_NE(resource, newResource); | 614 EXPECT_NE(resource, newResource); |
| 615 } | 615 } |
| 616 | 616 |
| 617 } // namespace blink | 617 } // namespace blink |
| OLD | NEW |