| 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 "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 Loading... |
| 112 // If we don't hide the tooltip on scroll, it can negatively impact scrolling | 112 // If we don't hide the tooltip on scroll, it can negatively impact scrolling |
| 113 // performance. See crbug.com/586852 for details. | 113 // performance. See crbug.com/586852 for details. |
| 114 TEST_P(FrameViewTest, HideTooltipWhenScrollPositionChanges) { | 114 TEST_P(FrameViewTest, HideTooltipWhenScrollPositionChanges) { |
| 115 document().body()->setInnerHTML( | 115 document().body()->setInnerHTML( |
| 116 "<div style='width:1000px;height:1000px'></div>"); | 116 "<div style='width:1000px;height:1000px'></div>"); |
| 117 document().view()->updateAllLifecyclePhases(); | 117 document().view()->updateAllLifecyclePhases(); |
| 118 | 118 |
| 119 EXPECT_CALL(chromeClient(), mockSetToolTip(document().frame(), String(), _)); | 119 EXPECT_CALL(chromeClient(), mockSetToolTip(document().frame(), String(), _)); |
| 120 document().view()->layoutViewportScrollableArea()->setScrollOffset( | 120 document().view()->layoutViewportScrollableArea()->setScrollOffset( |
| 121 ScrollOffset(1, 1), UserScroll); | 121 ScrollOffset(1, 1), UserScroll); |
| 122 |
| 123 // Programmatic scrolling should not dismiss the tooltip, so setToolTip |
| 124 // should not be called for this invocation. |
| 125 EXPECT_CALL(chromeClient(), mockSetToolTip(document().frame(), String(), _)) |
| 126 .Times(0); |
| 127 document().view()->layoutViewportScrollableArea()->setScrollOffset( |
| 128 ScrollOffset(2, 2), ProgrammaticScroll); |
| 122 } | 129 } |
| 123 | 130 |
| 124 // NoOverflowInIncrementVisuallyNonEmptyPixelCount tests fail if the number of | 131 // NoOverflowInIncrementVisuallyNonEmptyPixelCount tests fail if the number of |
| 125 // pixels is calculated in 32-bit integer, because 65536 * 65536 would become 0 | 132 // pixels is calculated in 32-bit integer, because 65536 * 65536 would become 0 |
| 126 // if it was calculated in 32-bit and thus it would be considered as empty. | 133 // if it was calculated in 32-bit and thus it would be considered as empty. |
| 127 TEST_P(FrameViewTest, NoOverflowInIncrementVisuallyNonEmptyPixelCount) { | 134 TEST_P(FrameViewTest, NoOverflowInIncrementVisuallyNonEmptyPixelCount) { |
| 128 EXPECT_FALSE(document().view()->isVisuallyNonEmpty()); | 135 EXPECT_FALSE(document().view()->isVisuallyNonEmpty()); |
| 129 document().view()->incrementVisuallyNonEmptyPixelCount(IntSize(65536, 65536)); | 136 document().view()->incrementVisuallyNonEmptyPixelCount(IntSize(65536, 65536)); |
| 130 EXPECT_TRUE(document().view()->isVisuallyNonEmpty()); | 137 EXPECT_TRUE(document().view()->isVisuallyNonEmpty()); |
| 131 } | 138 } |
| 132 | 139 |
| 133 } // namespace | 140 } // namespace |
| 134 } // namespace blink | 141 } // namespace blink |
| OLD | NEW |