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

Side by Side Diff: third_party/WebKit/Source/platform/scroll/ScrollbarThemeOverlayTest.cpp

Issue 2588403002: TestingPlatformSupport: register Platform instance correctly (Closed)
Patch Set: review #32 Created 3 years, 11 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
OLDNEW
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 8
9 namespace blink { 9 namespace blink {
10 10
11 using testing::NiceMock; 11 using testing::NiceMock;
12 using testing::Return; 12 using testing::Return;
13 13
14 class ScrollbarThemeOverlayTest : public ScrollbarTestSuite {}; 14 class ScrollbarThemeOverlayTest : public ScrollbarTestSuite {};
15 15
16 TEST_F(ScrollbarThemeOverlayTest, PaintInvalidation) { 16 TEST_F(ScrollbarThemeOverlayTest, PaintInvalidation) {
17 ScopedTestingPlatformSupport<TestingPlatformSupportWithMockScheduler,
18 const TestingPlatformSupport::Config&>
19 platform(m_config);
20
17 NiceMock<MockScrollableArea>* mockScrollableArea = 21 NiceMock<MockScrollableArea>* mockScrollableArea =
18 new NiceMock<MockScrollableArea>(ScrollOffset(100, 100)); 22 new NiceMock<MockScrollableArea>(ScrollOffset(100, 100));
19 ScrollbarThemeOverlay theme(14, 0, ScrollbarThemeOverlay::AllowHitTest); 23 ScrollbarThemeOverlay theme(14, 0, ScrollbarThemeOverlay::AllowHitTest);
20 24
21 Scrollbar* verticalScrollbar = Scrollbar::createForTesting( 25 Scrollbar* verticalScrollbar = Scrollbar::createForTesting(
22 mockScrollableArea, VerticalScrollbar, RegularScrollbar, &theme); 26 mockScrollableArea, VerticalScrollbar, RegularScrollbar, &theme);
23 Scrollbar* horizontalScrollbar = Scrollbar::createForTesting( 27 Scrollbar* horizontalScrollbar = Scrollbar::createForTesting(
24 mockScrollableArea, HorizontalScrollbar, RegularScrollbar, &theme); 28 mockScrollableArea, HorizontalScrollbar, RegularScrollbar, &theme);
25 ON_CALL(*mockScrollableArea, verticalScrollbar()) 29 ON_CALL(*mockScrollableArea, verticalScrollbar())
26 .WillByDefault(Return(verticalScrollbar)); 30 .WillByDefault(Return(verticalScrollbar));
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 mockScrollableArea->clearNeedsPaintInvalidationForScrollControls(); 122 mockScrollableArea->clearNeedsPaintInvalidationForScrollControls();
119 123
120 verticalScrollbar->setEnabled(true); 124 verticalScrollbar->setEnabled(true);
121 EXPECT_FALSE(verticalScrollbar->thumbNeedsRepaint()); 125 EXPECT_FALSE(verticalScrollbar->thumbNeedsRepaint());
122 EXPECT_TRUE(mockScrollableArea->verticalScrollbarNeedsPaintInvalidation()); 126 EXPECT_TRUE(mockScrollableArea->verticalScrollbarNeedsPaintInvalidation());
123 127
124 ThreadState::current()->collectAllGarbage(); 128 ThreadState::current()->collectAllGarbage();
125 } 129 }
126 130
127 } // namespace blink 131 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698