Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(401)

Unified Diff: third_party/WebKit/Source/core/fetch/ResourceFetcherTest.cpp

Issue 2051243002: Drop ResourceLoader (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@startLoad
Patch Set: Rebase Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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);
}
« no previous file with comments | « third_party/WebKit/Source/core/fetch/ResourceFetcher.cpp ('k') | third_party/WebKit/Source/core/fetch/ResourceLoader.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698