| OLD | NEW |
| 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 Loading... |
| 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 |
| OLD | NEW |