| Index: third_party/WebKit/Source/platform/testing/weburl_loader_mock.cc
|
| diff --git a/third_party/WebKit/Source/platform/testing/weburl_loader_mock.cc b/third_party/WebKit/Source/platform/testing/weburl_loader_mock.cc
|
| index 3f00d667e931e1d8619c36bbeb2b11a2a85a4ffe..8e55250c55b8ec9a95cc202b4d49337bcfb2178c 100644
|
| --- a/third_party/WebKit/Source/platform/testing/weburl_loader_mock.cc
|
| +++ b/third_party/WebKit/Source/platform/testing/weburl_loader_mock.cc
|
| @@ -82,19 +82,16 @@ WebURLRequest WebURLLoaderMock::ServeRedirect(
|
|
|
| WeakPtr<WebURLLoaderMock> self = weak_factory_.createWeakPtr();
|
|
|
| - client_->willFollowRedirect(this, newRequest, redirectResponse);
|
| + bool follow = client_->willFollowRedirect(this, newRequest, redirectResponse);
|
| + if (!follow)
|
| + newRequest = WebURLRequest();
|
|
|
| // |this| might be deleted in willFollowRedirect().
|
| if (!self)
|
| return newRequest;
|
|
|
| - if (redirectURL != KURL(newRequest.url())) {
|
| - // Only follow the redirect if WebKit left the URL unmodified.
|
| - // We assume that WebKit only changes the URL to suppress a redirect, and we
|
| - // assume that it does so by setting it to be invalid.
|
| - DCHECK(!newRequest.url().isValid());
|
| + if (!follow)
|
| cancel();
|
| - }
|
|
|
| return newRequest;
|
| }
|
|
|