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

Side by Side Diff: third_party/WebKit/Source/core/frame/FrameViewTest.cpp

Issue 2387883002: Use float for scroll offset. (Closed)
Patch Set: Fix README.md Created 4 years, 2 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 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 "core/frame/FrameView.h" 5 #include "core/frame/FrameView.h"
6 6
7 #include "bindings/core/v8/ExceptionStatePlaceholder.h" 7 #include "bindings/core/v8/ExceptionStatePlaceholder.h"
8 #include "core/frame/Settings.h" 8 #include "core/frame/Settings.h"
9 #include "core/html/HTMLElement.h" 9 #include "core/html/HTMLElement.h"
10 #include "core/layout/LayoutObject.h" 10 #include "core/layout/LayoutObject.h"
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 } 112 }
113 113
114 // If we don't hide the tooltip on scroll, it can negatively impact scrolling 114 // If we don't hide the tooltip on scroll, it can negatively impact scrolling
115 // performance. See crbug.com/586852 for details. 115 // performance. See crbug.com/586852 for details.
116 TEST_P(FrameViewTest, HideTooltipWhenScrollPositionChanges) { 116 TEST_P(FrameViewTest, HideTooltipWhenScrollPositionChanges) {
117 document().body()->setInnerHTML( 117 document().body()->setInnerHTML(
118 "<div style='width:1000px;height:1000px'></div>", ASSERT_NO_EXCEPTION); 118 "<div style='width:1000px;height:1000px'></div>", ASSERT_NO_EXCEPTION);
119 document().view()->updateAllLifecyclePhases(); 119 document().view()->updateAllLifecyclePhases();
120 120
121 EXPECT_CALL(chromeClient(), mockSetToolTip(document().frame(), String(), _)); 121 EXPECT_CALL(chromeClient(), mockSetToolTip(document().frame(), String(), _));
122 document().view()->layoutViewportScrollableArea()->setScrollPosition( 122 document().view()->layoutViewportScrollableArea()->setScrollOffset(
123 DoublePoint(1, 1), UserScroll); 123 ScrollOffset(1, 1), UserScroll);
124 } 124 }
125 125
126 // NoOverflowInIncrementVisuallyNonEmptyPixelCount tests fail if the number of 126 // NoOverflowInIncrementVisuallyNonEmptyPixelCount tests fail if the number of
127 // pixels is calculated in 32-bit integer, because 65536 * 65536 would become 0 127 // pixels is calculated in 32-bit integer, because 65536 * 65536 would become 0
128 // if it was calculated in 32-bit and thus it would be considered as empty. 128 // if it was calculated in 32-bit and thus it would be considered as empty.
129 TEST_P(FrameViewTest, NoOverflowInIncrementVisuallyNonEmptyPixelCount) { 129 TEST_P(FrameViewTest, NoOverflowInIncrementVisuallyNonEmptyPixelCount) {
130 EXPECT_FALSE(document().view()->isVisuallyNonEmpty()); 130 EXPECT_FALSE(document().view()->isVisuallyNonEmpty());
131 document().view()->incrementVisuallyNonEmptyPixelCount(IntSize(65536, 65536)); 131 document().view()->incrementVisuallyNonEmptyPixelCount(IntSize(65536, 65536));
132 EXPECT_TRUE(document().view()->isVisuallyNonEmpty()); 132 EXPECT_TRUE(document().view()->isVisuallyNonEmpty());
133 } 133 }
134 134
135 } // namespace 135 } // namespace
136 } // namespace blink 136 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/frame/FrameView.cpp ('k') | third_party/WebKit/Source/core/frame/LocalDOMWindow.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698