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

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: Reflect comments 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/web/tests/WebMeaningfulLayoutsTest.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 // performance. See crbug.com/586852 for details. 105 // performance. See crbug.com/586852 for details.
106 TEST_P(FrameViewTest, HideTooltipWhenScrollPositionChanges) 106 TEST_P(FrameViewTest, HideTooltipWhenScrollPositionChanges)
107 { 107 {
108 document().body()->setInnerHTML("<div style='width:1000px;height:1000px'></d iv>", ASSERT_NO_EXCEPTION); 108 document().body()->setInnerHTML("<div style='width:1000px;height:1000px'></d iv>", ASSERT_NO_EXCEPTION);
109 document().view()->updateAllLifecyclePhases(); 109 document().view()->updateAllLifecyclePhases();
110 110
111 EXPECT_CALL(chromeClient(), mockSetToolTip(document().frame(), String(), _)) ; 111 EXPECT_CALL(chromeClient(), mockSetToolTip(document().frame(), String(), _)) ;
112 document().view()->layoutViewportScrollableArea()->setScrollPosition(DoubleP oint(1, 1), UserScroll); 112 document().view()->layoutViewportScrollableArea()->setScrollPosition(DoubleP oint(1, 1), UserScroll);
113 } 113 }
114 114
115 // NoOverflowInIncrementVisuallyNonEmptyPixelCount tests fail if the number of
116 // pixels is calculated in 32-bit integer, because 65536 * 65536 would become 0
117 // if it was calculated in 32-bit and thus it would be considered as empty.
118 TEST_P(FrameViewTest, NoOverflowInIncrementVisuallyNonEmptyPixelCount)
119 {
120 EXPECT_FALSE(document().view()->isVisuallyNonEmpty());
121 document().view()->incrementVisuallyNonEmptyPixelCount(IntSize(65536, 65536) );
122 EXPECT_TRUE(document().view()->isVisuallyNonEmpty());
123 }
124
115 } // namespace 125 } // namespace
116 } // namespace blink 126 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/web/tests/WebMeaningfulLayoutsTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698