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

Unified Diff: cc/layers/scrollbar_layer_unittest.cc

Issue 1402653002: cc: Fix ScrollbarLayer overflow (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: test Created 5 years, 2 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 | « cc/layers/painted_scrollbar_layer.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/layers/scrollbar_layer_unittest.cc
diff --git a/cc/layers/scrollbar_layer_unittest.cc b/cc/layers/scrollbar_layer_unittest.cc
index eb857c2f86b6a27becb5493243aa15f38bfa7fd3..14c14496f9405c248df6116923c5f27cd5729b5e 100644
--- a/cc/layers/scrollbar_layer_unittest.cc
+++ b/cc/layers/scrollbar_layer_unittest.cc
@@ -905,6 +905,14 @@ class ScaledScrollbarLayerTestResourceCreation : public ScrollbarLayerTest {
scrollbar_layer->internal_content_bounds().width());
EXPECT_LE(thumb_size.height(),
scrollbar_layer->internal_content_bounds().height());
+ EXPECT_LE(track_size.width(),
+ layer_tree_host_->GetRendererCapabilities().max_texture_size);
+ EXPECT_LE(track_size.height(),
+ layer_tree_host_->GetRendererCapabilities().max_texture_size);
+ EXPECT_LE(thumb_size.width(),
+ layer_tree_host_->GetRendererCapabilities().max_texture_size);
+ EXPECT_LE(thumb_size.height(),
+ layer_tree_host_->GetRendererCapabilities().max_texture_size);
testing::Mock::VerifyAndClearExpectations(layer_tree_host_.get());
}
@@ -916,6 +924,9 @@ TEST_F(ScaledScrollbarLayerTestResourceCreation, ScaledResourceUpload) {
TestResourceUpload(.041f);
TestResourceUpload(1.41f);
TestResourceUpload(4.1f);
+
+ // Try something extreme to make sure it gets clamped.
+ TestResourceUpload(2147483647.0f);
}
class ScaledScrollbarLayerTestScaledRasterization : public ScrollbarLayerTest {
« no previous file with comments | « cc/layers/painted_scrollbar_layer.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698