| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/ScrollbarThemeOverlay.h" | 5 #include "platform/scroll/ScrollbarThemeOverlay.h" |
| 6 | 6 |
| 7 #include "platform/scroll/ScrollbarTestSuite.h" | 7 #include "platform/scroll/ScrollbarTestSuite.h" |
| 8 #include "platform/testing/TestingPlatformSupport.h" |
| 8 | 9 |
| 9 namespace blink { | 10 namespace blink { |
| 10 | 11 |
| 11 using testing::NiceMock; | 12 using testing::NiceMock; |
| 12 using testing::Return; | 13 using testing::Return; |
| 13 | 14 |
| 14 class ScrollbarThemeOverlayTest : public ScrollbarTestSuite {}; | 15 using ScrollbarThemeOverlayTest = testing::Test; |
| 15 | 16 |
| 16 TEST_F(ScrollbarThemeOverlayTest, PaintInvalidation) { | 17 TEST_F(ScrollbarThemeOverlayTest, PaintInvalidation) { |
| 17 ScopedTestingPlatformSupport<TestingPlatformSupportWithMockScheduler, | 18 ScopedTestingPlatformSupport<TestingPlatformSupportWithMockScheduler> |
| 18 const TestingPlatformSupport::Config&> | 19 platform; |
| 19 platform(m_config); | |
| 20 | 20 |
| 21 NiceMock<MockScrollableArea>* mockScrollableArea = | 21 NiceMock<MockScrollableArea>* mockScrollableArea = |
| 22 new NiceMock<MockScrollableArea>(ScrollOffset(100, 100)); | 22 new NiceMock<MockScrollableArea>(ScrollOffset(100, 100)); |
| 23 ScrollbarThemeOverlay theme(14, 0, ScrollbarThemeOverlay::AllowHitTest); | 23 ScrollbarThemeOverlay theme(14, 0, ScrollbarThemeOverlay::AllowHitTest); |
| 24 | 24 |
| 25 Scrollbar* verticalScrollbar = Scrollbar::createForTesting( | 25 Scrollbar* verticalScrollbar = Scrollbar::createForTesting( |
| 26 mockScrollableArea, VerticalScrollbar, RegularScrollbar, &theme); | 26 mockScrollableArea, VerticalScrollbar, RegularScrollbar, &theme); |
| 27 Scrollbar* horizontalScrollbar = Scrollbar::createForTesting( | 27 Scrollbar* horizontalScrollbar = Scrollbar::createForTesting( |
| 28 mockScrollableArea, HorizontalScrollbar, RegularScrollbar, &theme); | 28 mockScrollableArea, HorizontalScrollbar, RegularScrollbar, &theme); |
| 29 ON_CALL(*mockScrollableArea, verticalScrollbar()) | 29 ON_CALL(*mockScrollableArea, verticalScrollbar()) |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 mockScrollableArea->clearNeedsPaintInvalidationForScrollControls(); | 122 mockScrollableArea->clearNeedsPaintInvalidationForScrollControls(); |
| 123 | 123 |
| 124 verticalScrollbar->setEnabled(true); | 124 verticalScrollbar->setEnabled(true); |
| 125 EXPECT_FALSE(verticalScrollbar->thumbNeedsRepaint()); | 125 EXPECT_FALSE(verticalScrollbar->thumbNeedsRepaint()); |
| 126 EXPECT_TRUE(mockScrollableArea->verticalScrollbarNeedsPaintInvalidation()); | 126 EXPECT_TRUE(mockScrollableArea->verticalScrollbarNeedsPaintInvalidation()); |
| 127 | 127 |
| 128 ThreadState::current()->collectAllGarbage(); | 128 ThreadState::current()->collectAllGarbage(); |
| 129 } | 129 } |
| 130 | 130 |
| 131 } // namespace blink | 131 } // namespace blink |
| OLD | NEW |