| Index: third_party/WebKit/Source/platform/testing/URLTestHelpers.cpp
|
| diff --git a/third_party/WebKit/Source/platform/testing/URLTestHelpers.cpp b/third_party/WebKit/Source/platform/testing/URLTestHelpers.cpp
|
| index 686f769aa0730fda2d35a7e67bc2a5f061a12db0..b4b0a54137f55d4d449168dd335a561f35928691 100644
|
| --- a/third_party/WebKit/Source/platform/testing/URLTestHelpers.cpp
|
| +++ b/third_party/WebKit/Source/platform/testing/URLTestHelpers.cpp
|
| @@ -62,9 +62,9 @@ WebURL registerMockedURLLoadFromBase(const WebString& baseURL,
|
| return WebURL(url);
|
| }
|
|
|
| -void registerMockedURLLoad(const WebURL& fullURL,
|
| - const WebString& filePath,
|
| - const WebString& mimeType) {
|
| +WebURL registerMockedURLLoad(const WebURL& fullURL,
|
| + const WebString& filePath,
|
| + const WebString& mimeType) {
|
| WebURLLoadTiming timing;
|
| timing.initialize();
|
|
|
| @@ -74,9 +74,10 @@ void registerMockedURLLoad(const WebURL& fullURL,
|
| response.setLoadTiming(timing);
|
|
|
| registerMockedURLLoadWithCustomResponse(fullURL, filePath, response);
|
| + return fullURL;
|
| }
|
|
|
| -void registerMockedErrorURLLoad(const WebURL& fullURL) {
|
| +WebURL registerMockedErrorURLLoad(const WebURL& fullURL) {
|
| WebURLLoadTiming timing;
|
| timing.initialize();
|
|
|
| @@ -89,14 +90,23 @@ void registerMockedErrorURLLoad(const WebURL& fullURL) {
|
| error.reason = 404;
|
| Platform::current()->getURLLoaderMockFactory()->registerErrorURL(
|
| fullURL, response, error);
|
| + return fullURL;
|
| }
|
|
|
| -void registerMockedURLLoadWithCustomResponse(const WebURL& fullURL,
|
| - const WebString& filePath,
|
| - WebURLResponse response) {
|
| +WebURL registerMockedURLLoadWithCustomResponse(const WebURL& fullURL,
|
| + const WebString& filePath,
|
| + WebURLResponse response) {
|
| Platform::current()->getURLLoaderMockFactory()->registerURL(fullURL, response,
|
| filePath);
|
| + return fullURL;
|
| }
|
|
|
| } // namespace URLTestHelpers
|
| +
|
| +ScopedMockedURL::ScopedMockedURL(const WebURL& url) : m_url(url) {}
|
| +
|
| +ScopedMockedURL::~ScopedMockedURL() {
|
| + Platform::current()->getURLLoaderMockFactory()->unregisterURL(m_url);
|
| +}
|
| +
|
| } // namespace blink
|
|
|