| Index: third_party/WebKit/Source/core/fetch/ResourceFetcherTest.cpp
|
| diff --git a/third_party/WebKit/Source/core/fetch/ResourceFetcherTest.cpp b/third_party/WebKit/Source/core/fetch/ResourceFetcherTest.cpp
|
| index 8f0084cc9974b7945f23fbd28f3634a819a86e54..beeb97664f63235f391c3a4fd83f703d934364b1 100644
|
| --- a/third_party/WebKit/Source/core/fetch/ResourceFetcherTest.cpp
|
| +++ b/third_party/WebKit/Source/core/fetch/ResourceFetcherTest.cpp
|
| @@ -35,7 +35,6 @@
|
| #include "core/fetch/FetchRequest.h"
|
| #include "core/fetch/MemoryCache.h"
|
| #include "core/fetch/RawResource.h"
|
| -#include "core/fetch/ResourceLoader.h"
|
| #include "platform/exported/WrappedResourceResponse.h"
|
| #include "platform/heap/Handle.h"
|
| #include "platform/heap/HeapAllocator.h"
|
| @@ -168,7 +167,7 @@ TEST_F(ResourceFetcherTest, Vary)
|
| Platform::current()->getURLLoaderMockFactory()->registerURL(url, WebURLResponse(), "");
|
| Resource* newResource = fetcher->requestResource(fetchRequest, TestResourceFactory());
|
| EXPECT_NE(resource, newResource);
|
| - newResource->loader()->cancel();
|
| + fetcher->didFail(fetcher->loaderForResource(newResource), ResourceError::cancelledError(url));
|
| memoryCache()->remove(newResource);
|
| Platform::current()->getURLLoaderMockFactory()->unregisterURL(url);
|
|
|
| @@ -362,7 +361,7 @@ public:
|
| }
|
|
|
| // No callbacks should be received except for the notifyFinished()
|
| - // triggered by ResourceLoader::cancel().
|
| + // triggered by ResourceFetcher::cancelResourceLoad().
|
| void dataSent(Resource*, unsigned long long, unsigned long long) override { ASSERT_TRUE(false); }
|
| void responseReceived(Resource*, const ResourceResponse&, std::unique_ptr<WebDataConsumerHandle>) override { ASSERT_TRUE(false); }
|
| void setSerializedCachedMetadata(Resource*, const char*, size_t) override { ASSERT_TRUE(false); }
|
| @@ -381,9 +380,9 @@ public:
|
|
|
| // Regression test for http://crbug.com/594072.
|
| // This emulates a modal dialog triggering a nested run loop inside
|
| -// ResourceLoader::cancel(). If the ResourceLoader doesn't promptly cancel its
|
| -// WebURLLoader before notifying its clients, a nested run loop may send a
|
| -// network response, leading to an invalid state transition in ResourceLoader.
|
| +// ResourceFetcher::cancelResourceLoad(). If the WebURLLoader isn't promptly
|
| +// cancelled before notifying its clients, a nested run loop may send a
|
| +// network response, leading to an invalid state transition.
|
| TEST_F(ResourceFetcherTest, ResponseOnCancel)
|
| {
|
| KURL url(ParsedURLString, "http://127.0.0.1:8000/foo.html");
|
| @@ -397,7 +396,7 @@ TEST_F(ResourceFetcherTest, ResponseOnCancel)
|
| Resource* resource = fetcher->requestResource(fetchRequest, TestResourceFactory(Resource::Raw));
|
| Persistent<ServeRequestsOnCompleteClient> client = new ServeRequestsOnCompleteClient();
|
| resource->addClient(client);
|
| - resource->loader()->cancel();
|
| + fetcher->didFail(fetcher->loaderForResource(resource), ResourceError::cancelledError(url));
|
| resource->removeClient(client);
|
| Platform::current()->getURLLoaderMockFactory()->unregisterURL(url);
|
| }
|
|
|