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

Unified Diff: third_party/WebKit/Source/core/frame/FrameViewTest.cpp

Issue 2229753002: Test that FrameView::incrementVisuallyNonEmptyPixelCount() doesn't overflow (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Reflect comments Created 4 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 | « no previous file | third_party/WebKit/Source/web/tests/WebMeaningfulLayoutsTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/frame/FrameViewTest.cpp
diff --git a/third_party/WebKit/Source/core/frame/FrameViewTest.cpp b/third_party/WebKit/Source/core/frame/FrameViewTest.cpp
index d3a18c05ee938e801b856b1a6f3aee3773f5beba..d543bba702f7ba5033253f3ff506837cd837dafe 100644
--- a/third_party/WebKit/Source/core/frame/FrameViewTest.cpp
+++ b/third_party/WebKit/Source/core/frame/FrameViewTest.cpp
@@ -112,5 +112,15 @@ TEST_P(FrameViewTest, HideTooltipWhenScrollPositionChanges)
document().view()->layoutViewportScrollableArea()->setScrollPosition(DoublePoint(1, 1), UserScroll);
}
+// 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_P(FrameViewTest, NoOverflowInIncrementVisuallyNonEmptyPixelCount)
+{
+ EXPECT_FALSE(document().view()->isVisuallyNonEmpty());
+ document().view()->incrementVisuallyNonEmptyPixelCount(IntSize(65536, 65536));
+ EXPECT_TRUE(document().view()->isVisuallyNonEmpty());
+}
+
} // namespace
} // namespace blink
« no previous file with comments | « no previous file | third_party/WebKit/Source/web/tests/WebMeaningfulLayoutsTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698