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

Unified Diff: third_party/WebKit/Source/web/tests/WebFrameTest.cpp

Issue 2264333002: Revert of ImageDocumentParser should stop sending data to ImageResource once decoding fails. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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/web/tests/WebFrameTest.cpp
diff --git a/third_party/WebKit/Source/web/tests/WebFrameTest.cpp b/third_party/WebKit/Source/web/tests/WebFrameTest.cpp
index fe3274bb8283e1f7b96108a99cc9754e018a6401..400a8897e4ed2bca521e4078f730ebcc41937a0b 100644
--- a/third_party/WebKit/Source/web/tests/WebFrameTest.cpp
+++ b/third_party/WebKit/Source/web/tests/WebFrameTest.cpp
@@ -8831,29 +8831,4 @@
EXPECT_EQ("", toLocalFrame(helper.webView()->page()->mainFrame())->document()->documentElement()->innerText());
}
-class MultipleDataChunkDelegate : public WebURLLoaderTestDelegate {
-public:
- void didReceiveData(WebURLLoaderClient* originalClient, WebURLLoader* loader, const char* data, int dataLength, int encodedDataLength) override
- {
- EXPECT_GT(dataLength, 16);
- originalClient->didReceiveData(loader, data, 16, 16, 16);
- // This didReceiveData call shouldn't crash due to a failed assertion.
- originalClient->didReceiveData(loader, data + 16, dataLength - 16, encodedDataLength - 16, dataLength - 16);
- }
-};
-
-TEST_F(WebFrameTest, ImageDocumentDecodeError)
-{
- std::string url = m_baseURL + "not_an_image.ico";
- URLTestHelpers::registerMockedURLLoad(toKURL(url), "not_an_image.ico", "image/x-icon");
- MultipleDataChunkDelegate delegate;
- Platform::current()->getURLLoaderMockFactory()->setLoaderDelegate(&delegate);
-
- FrameTestHelpers::WebViewHelper helper;
- helper.initializeAndLoad(url, true);
- Document* document = toLocalFrame(helper.webView()->page()->mainFrame())->document();
- EXPECT_TRUE(document->isImageDocument());
- EXPECT_EQ(Resource::DecodeError, toImageDocument(document)->cachedImage()->getStatus());
-}
-
} // namespace blink
« no previous file with comments | « third_party/WebKit/Source/core/html/ImageDocument.cpp ('k') | third_party/WebKit/Source/web/tests/data/not_an_image.ico » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698