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

Unified Diff: Source/web/tests/DocumentLoadingRenderingTest.cpp

Issue 1343493002: Fix progressive rendering of image documents (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 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
« no previous file with comments | « Source/core/html/ImageDocument.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/web/tests/DocumentLoadingRenderingTest.cpp
diff --git a/Source/web/tests/DocumentLoadingRenderingTest.cpp b/Source/web/tests/DocumentLoadingRenderingTest.cpp
index 408bd097b56a3c8c6c4a1b3d203b68a9f08b5ffa..252642f7f9a4410c70b94849f9cea805cc52826c 100644
--- a/Source/web/tests/DocumentLoadingRenderingTest.cpp
+++ b/Source/web/tests/DocumentLoadingRenderingTest.cpp
@@ -176,6 +176,24 @@ TEST_F(DocumentLoadingRenderingTest, ShouldResumeCommitsAfterParsingSvg)
EXPECT_FALSE(m_layerTreeView.deferCommits());
}
+TEST_F(DocumentLoadingRenderingTest, ShouldResumeImmediatelyForImageDocuments)
+{
+ SimRequest mainResource("https://example.com/test.png", "image/png");
+
+ loadURL("https://example.com/test.png");
+
+ mainResource.start();
+ EXPECT_TRUE(m_layerTreeView.deferCommits());
+
+ // Not really a valid image but enough for the test. ImageDocuments should
+ // resume painting as soon as the first bytes arrive.
+ mainResource.write("image data");
+ EXPECT_FALSE(m_layerTreeView.deferCommits());
+
+ mainResource.finish();
+ EXPECT_FALSE(m_layerTreeView.deferCommits());
+}
+
TEST_F(DocumentLoadingRenderingTest, ShouldScheduleFrameAfterSheetsLoaded)
{
SimRequest mainResource("https://example.com/test.html", "text/html");
« no previous file with comments | « Source/core/html/ImageDocument.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698