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

Unified Diff: third_party/WebKit/Source/platform/scroll/ScrollbarThemeOverlayTest.cpp

Issue 2835403002: Call ScrollableArea::ShowOverlayScrollbars for explicit scrolls only. (Closed)
Patch Set: fix VisualViewport 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
Index: third_party/WebKit/Source/platform/scroll/ScrollbarThemeOverlayTest.cpp
diff --git a/third_party/WebKit/Source/platform/scroll/ScrollbarThemeOverlayTest.cpp b/third_party/WebKit/Source/platform/scroll/ScrollbarThemeOverlayTest.cpp
index e52e70a5fd2784ae7c22fa5cfe4d8bd0282fe0c0..7beab66518a8aff6130f2ab9c29a706d2082d7c3 100644
--- a/third_party/WebKit/Source/platform/scroll/ScrollbarThemeOverlayTest.cpp
+++ b/third_party/WebKit/Source/platform/scroll/ScrollbarThemeOverlayTest.cpp
@@ -115,17 +115,23 @@ TEST_F(ScrollbarThemeOverlayTest, PaintInvalidation) {
vertical_scrollbar->ClearThumbNeedsRepaint();
mock_scrollable_area->ClearNeedsPaintInvalidationForScrollControls();
- // Disabling the scrollbar is used to hide it so it should cause invalidation
- // but only in the general sense since the compositor will have hidden it
- // without a repaint.
+ // Hiding the scrollbar should invalidate the layer (SetNeedsDisplay) but not
+ // trigger repaint of the thumb resouce, since the compositor will give the
+ // entire layer opacity 0.
+ EXPECT_CALL(*mock_scrollable_area, ScrollbarsHidden()).WillOnce(Return(true));
vertical_scrollbar->SetEnabled(false);
EXPECT_FALSE(vertical_scrollbar->ThumbNeedsRepaint());
EXPECT_TRUE(mock_scrollable_area->VerticalScrollbarNeedsPaintInvalidation());
mock_scrollable_area->ClearNeedsPaintInvalidationForScrollControls();
+ // Showing the scrollbar needs to repaint the thumb resource, since it may
+ // have been repainted in the disabled state while hidden (e.g. from
+ // SetProportion on bounds changes).
+ EXPECT_CALL(*mock_scrollable_area, ScrollbarsHidden())
+ .WillOnce(Return(false));
vertical_scrollbar->SetEnabled(true);
- EXPECT_FALSE(vertical_scrollbar->ThumbNeedsRepaint());
+ EXPECT_TRUE(vertical_scrollbar->ThumbNeedsRepaint());
EXPECT_TRUE(mock_scrollable_area->VerticalScrollbarNeedsPaintInvalidation());
ThreadState::Current()->CollectAllGarbage();

Powered by Google App Engine
This is Rietveld 408576698