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

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

Issue 2231523002: Make ResourceFetcher return Resources with LoadError instead of nullptrs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed webkit_unit_tests. Fixed most layout tests, rebaselineing rest. 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 25a9180e2096cb173e249c04d8b5aa4cc4dd3198..d8c7695c2616c9f95305e75fb7c1534f631c527b 100644
--- a/third_party/WebKit/Source/core/fetch/ResourceFetcherTest.cpp
+++ b/third_party/WebKit/Source/core/fetch/ResourceFetcherTest.cpp
@@ -117,12 +117,14 @@ public:
TEST_F(ResourceFetcherTest, StartLoadAfterFrameDetach)
{
KURL secureURL(ParsedURLString, "https://secureorigin.test/image.png");
- // Try to request a url. The request should fail, no resource should be returned,
- // and no resource should be present in the cache.
+ // Try to request a url. The request should fail, and a resource in an error state
+ // should be returned, and no resource should be present in the cache.
ResourceFetcher* fetcher = ResourceFetcher::create(nullptr);
FetchRequest fetchRequest = FetchRequest(ResourceRequest(secureURL), FetchInitiatorInfo());
Resource* resource = fetcher->requestResource(fetchRequest, TestResourceFactory());
- EXPECT_FALSE(resource);
+ ASSERT_TRUE(resource);
+ EXPECT_TRUE(resource->errorOccurred());
+ EXPECT_TRUE(resource->resourceError().isAccessCheck());
EXPECT_FALSE(memoryCache()->resourceForURL(secureURL));
// Start by calling startLoad() directly, rather than via requestResource().

Powered by Google App Engine
This is Rietveld 408576698