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

Side by Side 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 test after rebase Created 4 years, 9 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 unified diff | Download patch
« no previous file with comments | « third_party/WebKit/Source/platform/scroll/ScrollableArea.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "platform/scroll/ScrollableArea.h" 5 #include "platform/scroll/ScrollableArea.h"
6 6
7 #include "platform/graphics/Color.h"
7 #include "platform/graphics/GraphicsLayer.h" 8 #include "platform/graphics/GraphicsLayer.h"
8 #include "platform/scroll/ScrollbarTheme.h" 9 #include "platform/scroll/ScrollbarTheme.h"
9 #include "platform/scroll/ScrollbarThemeMock.h" 10 #include "platform/scroll/ScrollbarThemeMock.h"
10 #include "platform/testing/TestingPlatformSupport.h" 11 #include "platform/testing/TestingPlatformSupport.h"
11 #include "public/platform/Platform.h" 12 #include "public/platform/Platform.h"
12 #include "testing/gmock/include/gmock/gmock.h" 13 #include "testing/gmock/include/gmock/gmock.h"
13 #include "testing/gtest/include/gtest/gtest.h" 14 #include "testing/gtest/include/gtest/gtest.h"
14 15
15 namespace blink { 16 namespace blink {
16 17
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after
273 EXPECT_TRUE(layerForVerticalScrollbar.hasTrackedPaintInvalidations()); 274 EXPECT_TRUE(layerForVerticalScrollbar.hasTrackedPaintInvalidations());
274 EXPECT_FALSE(horizontalScrollbar->trackNeedsRepaint()); 275 EXPECT_FALSE(horizontalScrollbar->trackNeedsRepaint());
275 EXPECT_FALSE(horizontalScrollbar->thumbNeedsRepaint()); 276 EXPECT_FALSE(horizontalScrollbar->thumbNeedsRepaint());
276 EXPECT_FALSE(verticalScrollbar->trackNeedsRepaint()); 277 EXPECT_FALSE(verticalScrollbar->trackNeedsRepaint());
277 EXPECT_FALSE(verticalScrollbar->thumbNeedsRepaint()); 278 EXPECT_FALSE(verticalScrollbar->thumbNeedsRepaint());
278 279
279 // Forced GC in order to finalize objects depending on the mock object. 280 // Forced GC in order to finalize objects depending on the mock object.
280 Heap::collectAllGarbage(); 281 Heap::collectAllGarbage();
281 } 282 }
282 283
284 TEST_F(ScrollableAreaTest, RecalculatesScrollbarOverlayIfBackgroundChanges)
285 {
286 OwnPtrWillBeRawPtr<MockScrollableArea> scrollableArea = MockScrollableArea:: create(IntPoint(0, 100));
287
288 EXPECT_EQ(ScrollbarOverlayStyleDefault, scrollableArea->getScrollbarOverlayS tyle());
289 scrollableArea->recalculateScrollbarOverlayStyle(Color(34, 85, 51));
290 EXPECT_EQ(ScrollbarOverlayStyleLight, scrollableArea->getScrollbarOverlaySty le());
291 scrollableArea->recalculateScrollbarOverlayStyle(Color(236, 143, 185));
292 EXPECT_EQ(ScrollbarOverlayStyleDefault, scrollableArea->getScrollbarOverlayS tyle());
293 }
294
283 } // namespace blink 295 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/platform/scroll/ScrollableArea.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698