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

Unified Diff: third_party/WebKit/Source/core/testing/Internals.cpp

Issue 1840933002: Do not rely on broken images in http/tests/multipart/ tests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 1 month 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/testing/Internals.cpp
diff --git a/third_party/WebKit/Source/core/testing/Internals.cpp b/third_party/WebKit/Source/core/testing/Internals.cpp
index 7a98145fd3d3cbda7665c517c36f27556b823832..5eba578bebcde92df245a3fc0252fcd5409723aa 100644
--- a/third_party/WebKit/Source/core/testing/Internals.cpp
+++ b/third_party/WebKit/Source/core/testing/Internals.cpp
@@ -407,6 +407,18 @@ bool Internals::isPreloadedBy(const String& url, Document* document) {
return document->fetcher()->isPreloadedForTest(document->completeURL(url));
}
+bool Internals::isLoading(const String& url) {
+ if (!contextDocument())
+ return false;
+ const String cacheIdentifier =
+ contextDocument()->fetcher()->getCacheIdentifier();
+ Resource* resource = memoryCache()->resourceForURL(
+ contextDocument()->completeURL(url), cacheIdentifier);
+ // We check loader() here instead of isLoading(), because a multipart
+ // ImageResource lies isLoading() == false after the first part is loaded.
+ return resource && resource->loader();
+}
+
bool Internals::isLoadingFromMemoryCache(const String& url) {
if (!contextDocument())
return false;
« no previous file with comments | « third_party/WebKit/Source/core/testing/Internals.h ('k') | third_party/WebKit/Source/core/testing/Internals.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698