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

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

Issue 1738503003: Fix overlay scroll bar color on elements with dark background (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix issue with custom scroll bar style Created 4 years, 10 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/ScrollableAreaTest.cpp
diff --git a/third_party/WebKit/Source/platform/scroll/ScrollableAreaTest.cpp b/third_party/WebKit/Source/platform/scroll/ScrollableAreaTest.cpp
index 11d2da155aa43835d8a50695a46132714e28d7aa..a12ccb88eea6ebaa1d1e10ed474dd8d075621d90 100644
--- a/third_party/WebKit/Source/platform/scroll/ScrollableAreaTest.cpp
+++ b/third_party/WebKit/Source/platform/scroll/ScrollableAreaTest.cpp
@@ -4,6 +4,7 @@
#include "platform/scroll/ScrollableArea.h"
+#include "platform/graphics/Color.h"
#include "platform/graphics/GraphicsLayer.h"
#include "platform/scroll/ScrollbarTheme.h"
#include "platform/scroll/ScrollbarThemeMock.h"
@@ -280,4 +281,15 @@ TEST_F(ScrollableAreaTest, InvalidatesCompositedScrollbarsIfPartsNeedRepaint)
Heap::collectAllGarbage();
}
+TEST_F(ScrollableAreaTest, RecalculatesScrollbarOverlayIfBackgroundChanges)
+{
+ OwnPtrWillBeRawPtr<MockScrollableArea> scrollableArea = MockScrollableArea::create(IntPoint(0, 100));
+
+ EXPECT_EQ(ScrollbarOverlayStyleDefault, scrollableArea->scrollbarOverlayStyle());
+ scrollableArea->recalculateScrollbarOverlayStyle(Color(34, 85, 51));
+ EXPECT_EQ(ScrollbarOverlayStyleLight, scrollableArea->scrollbarOverlayStyle());
+ scrollableArea->recalculateScrollbarOverlayStyle(Color(236, 143, 185));
+ EXPECT_EQ(ScrollbarOverlayStyleDefault, scrollableArea->scrollbarOverlayStyle());
+}
+
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698