Chromium Code Reviews| Index: third_party/WebKit/Source/web/tests/WebMeaningfulLayoutsTest.cpp |
| diff --git a/third_party/WebKit/Source/web/tests/WebMeaningfulLayoutsTest.cpp b/third_party/WebKit/Source/web/tests/WebMeaningfulLayoutsTest.cpp |
| index 513438d4376163fbd4290aaa59f93b23d1ae0677..91581fc20c8552fa4149d59a3794ba48e7e290e5 100644 |
| --- a/third_party/WebKit/Source/web/tests/WebMeaningfulLayoutsTest.cpp |
| +++ b/third_party/WebKit/Source/web/tests/WebMeaningfulLayoutsTest.cpp |
| @@ -174,4 +174,32 @@ TEST_F(WebMeaningfulLayoutsTest, WithIFrames) |
| EXPECT_EQ(1, webViewClient().finishedLoadingLayoutCount()); |
| } |
| +// NoOverflowInIncrementVisuallyNonEmptyPixelCount tests fail if the number of |
| +// pixels is calculated in 32-bit integer, because 65536 * 65536 would become 0 |
| +// if it was calculated in 32-bit and thus it would be considered as empty. |
| +TEST_F(WebMeaningfulLayoutsTest, NoOverflowInIncrementVisuallyNonEmptyPixelCount) |
| +{ |
| + SimRequest mainResource("https://example.com/test.html", "text/html"); |
| + SimRequest svgResource("https://example.com/test.svg", "image/svg+xml"); |
| + |
| + loadURL("https://example.com/test.html"); |
| + |
| + mainResource.start(); |
| + mainResource.write("<DOCTYPE html><body><img src=\"test.svg\">"); |
| + testing::runPendingTasks(); |
|
esprehn
2016/08/15 15:59:39
What task are you trying to run here?
hiroshige
2016/09/29 08:25:55
Added a comment.
|
| + EXPECT_EQ(0, webViewClient().visuallyNonEmptyLayoutCount()); |
| + |
| + // We serve the SVG file and check visuallyNonEmptyLayoutCount() before |
| + // mainResource.finish() because finishing the main resource causes |
| + // |FrameView::m_isVisuallyNonEmpty| to be true and |
| + // visuallyNonEmptyLayoutCount() to be 1 irrespective of the SVG sizes. |
| + svgResource.start(); |
| + svgResource.write("<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"65536\" width=\"65536\"></svg>"); |
| + svgResource.finish(); |
| + webView().updateAllLifecyclePhases(); |
|
esprehn
2016/08/15 15:59:39
compositor().beginFrame() ?
hiroshige
2016/09/29 08:25:55
Done.
|
| + EXPECT_EQ(1, webViewClient().visuallyNonEmptyLayoutCount()); |
| + |
| + mainResource.finish(); |
| +} |
| + |
| } // namespace blink |