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

Unified Diff: Source/web/PopupContainerTest.cpp

Issue 879913003: Use IntRect instead of FloatRect for window positions and sizes (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: added FIXME comments Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/web/PopupContainer.cpp ('k') | Source/web/WebPagePopupImpl.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/web/PopupContainerTest.cpp
diff --git a/Source/web/PopupContainerTest.cpp b/Source/web/PopupContainerTest.cpp
index 36dbdb058f1b5aae53da961e3159a89711f38a33..8b93d6bab9d5d74c968ade46761296296b8ebea0 100644
--- a/Source/web/PopupContainerTest.cpp
+++ b/Source/web/PopupContainerTest.cpp
@@ -76,17 +76,17 @@ static IntRect calculatePositionWithTransformAndRTL(const IntRect& initialRect,
{
const bool isRTL = true;
const int targetControlHeight = 20;
- const FloatRect screenRect(0, 0, screenMaxX, screenMaxY);
- const FloatRect windowRect(0, 0, 512, 512);
+ const IntRect screenRect(0, 0, screenMaxX, screenMaxY);
+ const IntRect windowRect(0, 0, 512, 512);
int rtlOffset = targetControlWidth - initialRect.width();
bool needToResizeView = false;
return PopupContainer::layoutAndCalculateWidgetRectInternal(initialRect, targetControlHeight, windowRect, screenRect, !isRTL, rtlOffset, verticalOffset, transformOffset, content, needToResizeView);
}
-static IntRect calculatePosition(const IntRect& initialRect, PopupContent* content, FloatRect windowRect = FloatRect(0, 0, 512, 512), bool isRTL = true)
+static IntRect calculatePosition(const IntRect& initialRect, PopupContent* content, IntRect windowRect = IntRect(0, 0, 512, 512), bool isRTL = true)
{
const int targetControlHeight = 20;
- const FloatRect screenRect(0, 0, screenMaxX, screenMaxY);
+ const IntRect screenRect(0, 0, screenMaxX, screenMaxY);
int rtlOffset = (targetControlWidth - initialRect.width()) * (isRTL ? 1 : -1);
bool needToResizeView = false;
return PopupContainer::layoutAndCalculateWidgetRectInternal(initialRect, targetControlHeight, windowRect, screenRect, !isRTL, rtlOffset, 0, IntSize(), content, needToResizeView);
@@ -170,7 +170,7 @@ TEST(PopupContainerTest, PopupPosition)
// There is not enough room to the right, so open the popup menu to the left.
IntRect initialRect(screenMaxX - targetControlWidth - 6, 100, targetControlWidth * 2, 100);
MockPopupContent content(initialRect.size());
- IntRect resultRect = calculatePosition(initialRect, &content, FloatRect(0, 0, screenMaxX, screenMaxY), false);
+ IntRect resultRect = calculatePosition(initialRect, &content, IntRect(0, 0, screenMaxX, screenMaxY), false);
EXPECT_EQ(IntRect(758, 100, 260, 100), resultRect);
}
« no previous file with comments | « Source/web/PopupContainer.cpp ('k') | Source/web/WebPagePopupImpl.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698