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

Unified Diff: cc/tiles/picture_layer_tiling_unittest.cc

Issue 2816943004: cc: Fix bugs found by fuzzer due to floating point imprecision. (Closed)
Patch Set: Created 3 years, 8 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
« cc/tiles/picture_layer_tiling.cc ('K') | « cc/tiles/picture_layer_tiling.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/tiles/picture_layer_tiling_unittest.cc
diff --git a/cc/tiles/picture_layer_tiling_unittest.cc b/cc/tiles/picture_layer_tiling_unittest.cc
index d8afa1638972eab6b43e78b58cdc6af452a592f2..5d5709a21e569505a52fc3ab3ac0aac3f64f8848 100644
--- a/cc/tiles/picture_layer_tiling_unittest.cc
+++ b/cc/tiles/picture_layer_tiling_unittest.cc
@@ -1256,5 +1256,33 @@ TEST_F(PictureLayerTilingIteratorTest, FractionalTranslatedTilingOverflow) {
EXPECT_FALSE(++iter);
}
+TEST_F(PictureLayerTilingIteratorTest, EdgeCaseLargeIntBounds) {
+ gfx::Size tile_size(256, 256);
+ float scale = 7352.331055f;
+ gfx::Size layer_bounds(292082, 26910);
+ gfx::Rect coverage_rect(2104641536, 522015, 29440, 66172);
+ Initialize(tile_size, scale, layer_bounds);
+ int count = 0;
+ for (PictureLayerTiling::CoverageIterator
+ iter(tiling_.get(), scale, coverage_rect);
+ iter && count < 200; ++count, ++iter) {
+ EXPECT_FALSE(iter.geometry_rect().IsEmpty());
+ }
+}
+
+TEST_F(PictureLayerTilingIteratorTest, EdgeCaseLargeIntBounds2) {
+ gfx::RectF rect(2104670720.f, 522014.5f, 192.f, 1.f);
+ gfx::Size tile_size(256, 256);
+ float scale = 7352.331055f;
+ gfx::Size layer_bounds(292082, 26910);
+ gfx::Rect coverage_rect(2104670720, 522015, 192, 1);
+ Initialize(tile_size, scale, layer_bounds);
+ for (PictureLayerTiling::CoverageIterator iter(tiling_.get(), scale,
+ coverage_rect);
+ iter; ++iter) {
+ EXPECT_FALSE(iter.geometry_rect().IsEmpty());
+ }
+}
+
} // namespace
} // namespace cc
« cc/tiles/picture_layer_tiling.cc ('K') | « cc/tiles/picture_layer_tiling.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698