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

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

Issue 2229753002: Test that FrameView::incrementVisuallyNonEmptyPixelCount() doesn't overflow (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add SimTest Created 4 years, 4 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 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
160 // performance. See crbug.com/586852 for details. 160 // performance. See crbug.com/586852 for details.
161 TEST_P(FrameViewTest, HideTooltipWhenScrollPositionChanges) 161 TEST_P(FrameViewTest, HideTooltipWhenScrollPositionChanges)
162 { 162 {
163 document().body()->setInnerHTML("<div style='width:1000px;height:1000px'></d iv>", ASSERT_NO_EXCEPTION); 163 document().body()->setInnerHTML("<div style='width:1000px;height:1000px'></d iv>", ASSERT_NO_EXCEPTION);
164 document().view()->updateAllLifecyclePhases(); 164 document().view()->updateAllLifecyclePhases();
165 165
166 EXPECT_CALL(chromeClient(), setToolTip(String(), _)); 166 EXPECT_CALL(chromeClient(), setToolTip(String(), _));
167 document().view()->layoutViewportScrollableArea()->setScrollPosition(DoubleP oint(1, 1), UserScroll); 167 document().view()->layoutViewportScrollableArea()->setScrollPosition(DoubleP oint(1, 1), UserScroll);
168 } 168 }
169 169
170 // NoOverflowInIncrementVisuallyNonEmptyPixelCount tests fail if the number of
171 // pixels is calculated in 32-bit integer, because 65536 * 65536 would become 0
172 // if it was calculated in 32-bit and thus it would be considered as empty.
173 TEST_P(FrameViewTest, NoOverflowInIncrementVisuallyNonEmptyPixelCount)
174 {
175 EXPECT_FALSE(document().view()->isVisuallyNonEmpty());
176 document().view()->incrementVisuallyNonEmptyPixelCount(IntSize(65536, 65536) );
177 EXPECT_TRUE(document().view()->isVisuallyNonEmpty());
178 }
179
170 } // namespace 180 } // namespace
171 } // namespace blink 181 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698