Index: third_party/WebKit/Source/web/tests/DocumentLoadingRenderingTest.cpp |
diff --git a/third_party/WebKit/Source/web/tests/DocumentLoadingRenderingTest.cpp b/third_party/WebKit/Source/web/tests/DocumentLoadingRenderingTest.cpp |
index db54b4ac706c7fb35be0bdb33f05bf7093fa3e6c..fe6eec937e1d50eed2e5a547ff502e4eb1f8a141 100644 |
--- a/third_party/WebKit/Source/web/tests/DocumentLoadingRenderingTest.cpp |
+++ b/third_party/WebKit/Source/web/tests/DocumentLoadingRenderingTest.cpp |
@@ -4,6 +4,7 @@ |
#include "core/dom/Document.h" |
#include "core/html/HTMLIFrameElement.h" |
+#include "platform/testing/UnitTestHelpers.h" |
#include "testing/gtest/include/gtest/gtest.h" |
#include "web/tests/sim/SimCompositor.h" |
#include "web/tests/sim/SimDisplayItemList.h" |
@@ -96,6 +97,7 @@ TEST_F(DocumentLoadingRenderingTest, ShouldResumeCommitsAfterSheetsLoaded) |
// Sheet finished and there's a body so resume. |
cssResource.finish(); |
+ testing::runPendingTasks(); |
EXPECT_FALSE(compositor().deferCommits()); |
// Finish the load, should stay resumed. |
@@ -157,6 +159,7 @@ TEST_F(DocumentLoadingRenderingTest, ShouldResumeCommitsAfterSheetsLoadForXml) |
// Sheet finished, so resume commits. |
cssResource.finish(); |
+ testing::runPendingTasks(); |
EXPECT_FALSE(compositor().deferCommits()); |
} |
@@ -209,6 +212,7 @@ TEST_F(DocumentLoadingRenderingTest, ShouldScheduleFrameAfterSheetsLoaded) |
firstCssResource.write("body { color: red; }"); |
mainResource.write("<body>"); |
firstCssResource.finish(); |
+ testing::runPendingTasks(); |
// Sheet finished and there's a body so resume. |
EXPECT_FALSE(compositor().deferCommits()); |
@@ -272,23 +276,15 @@ TEST_F(DocumentLoadingRenderingTest, ShouldNotPaintIframeContentWithPendingSheet |
// 1 for the main frame background (white), |
// 1 for the iframe background (pink) |
- // 1 for the composited transform layer in the iframe (green). |
// TODO(esprehn): Why FOUC the background (borders, etc.) of iframes and |
// composited layers? Seems like a bug. |
- EXPECT_EQ(3, frame2.drawCount()); |
+ EXPECT_EQ(2, frame2.drawCount()); |
EXPECT_TRUE(frame2.contains(SimCanvas::Rect, "white")); |
EXPECT_TRUE(frame2.contains(SimCanvas::Rect, "pink")); |
- EXPECT_TRUE(frame2.contains(SimCanvas::Rect, "green")); |
+ EXPECT_FALSE(frame2.contains(SimCanvas::Rect, "green")); |
- // Finish loading the sheets in the child frame. After it should issue a |
- // paint invalidation for every layer since frame2 painted them but skipped |
- // painting the real content to avoid FOUC. |
cssResource.complete(); |
- |
- // First frame where all frames are loaded, should paint the text in the |
- // child frame. |
- auto frame3 = compositor().beginFrame(); |
- EXPECT_TRUE(frame3.containsText()); |
+ testing::runPendingTasks(); |
} |
} // namespace blink |