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

Unified Diff: third_party/WebKit/Source/web/tests/WebFrameTest.cpp

Issue 2701993002: DO NOT COMMIT: Results of running new (proposed) clang-format on Blink (Closed)
Patch Set: Created 3 years, 10 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
Index: third_party/WebKit/Source/web/tests/WebFrameTest.cpp
diff --git a/third_party/WebKit/Source/web/tests/WebFrameTest.cpp b/third_party/WebKit/Source/web/tests/WebFrameTest.cpp
index 565f2952e63e7414b4b8d2f7d2e7c7f11d92eeeb..c54cdcddf0d5325c02ca34219f8d3a7b9efed47e 100644
--- a/third_party/WebKit/Source/web/tests/WebFrameTest.cpp
+++ b/third_party/WebKit/Source/web/tests/WebFrameTest.cpp
@@ -1189,16 +1189,18 @@ TEST_P(ParameterizedWebFrameTest, ZeroHeightPositiveWidthNotIgnored) {
enableViewportSettings);
webViewHelper.resize(WebSize(viewportWidth, viewportHeight));
- EXPECT_EQ(viewportWidth, webViewHelper.webView()
- ->mainFrameImpl()
- ->frameView()
- ->layoutSize()
- .width());
- EXPECT_EQ(viewportHeight, webViewHelper.webView()
- ->mainFrameImpl()
- ->frameView()
- ->layoutSize()
- .height());
+ EXPECT_EQ(viewportWidth,
+ webViewHelper.webView()
+ ->mainFrameImpl()
+ ->frameView()
+ ->layoutSize()
+ .width());
+ EXPECT_EQ(viewportHeight,
+ webViewHelper.webView()
+ ->mainFrameImpl()
+ ->frameView()
+ ->layoutSize()
+ .height());
}
TEST_P(ParameterizedWebFrameTest,
@@ -1397,16 +1399,18 @@ TEST_P(ParameterizedWebFrameTest, NoWideViewportIgnoresPageViewportWidth) {
// The page sets viewport width to 3000, but with UseWideViewport == false is
// must be ignored.
- EXPECT_EQ(viewportWidth, webViewHelper.webView()
- ->mainFrameImpl()
- ->frameView()
- ->contentsSize()
- .width());
- EXPECT_EQ(viewportHeight, webViewHelper.webView()
- ->mainFrameImpl()
- ->frameView()
- ->contentsSize()
- .height());
+ EXPECT_EQ(viewportWidth,
+ webViewHelper.webView()
+ ->mainFrameImpl()
+ ->frameView()
+ ->contentsSize()
+ .width());
+ EXPECT_EQ(viewportHeight,
+ webViewHelper.webView()
+ ->mainFrameImpl()
+ ->frameView()
+ ->contentsSize()
+ .height());
}
TEST_P(ParameterizedWebFrameTest,
@@ -1429,16 +1433,18 @@ TEST_P(ParameterizedWebFrameTest,
// The page sets viewport width to 3000, but with UseWideViewport == false it
// must be ignored while the initial scale specified by the page must be
// accounted.
- EXPECT_EQ(viewportWidth / 2, webViewHelper.webView()
- ->mainFrameImpl()
- ->frameView()
- ->contentsSize()
- .width());
- EXPECT_EQ(viewportHeight / 2, webViewHelper.webView()
- ->mainFrameImpl()
- ->frameView()
- ->contentsSize()
- .height());
+ EXPECT_EQ(viewportWidth / 2,
+ webViewHelper.webView()
+ ->mainFrameImpl()
+ ->frameView()
+ ->contentsSize()
+ .width());
+ EXPECT_EQ(viewportHeight / 2,
+ webViewHelper.webView()
+ ->mainFrameImpl()
+ ->frameView()
+ ->contentsSize()
+ .height());
}
TEST_P(ParameterizedWebFrameTest, WideViewportSetsTo980WithoutViewportTag) {
@@ -1458,16 +1464,18 @@ TEST_P(ParameterizedWebFrameTest, WideViewportSetsTo980WithoutViewportTag) {
webViewHelper.webView()->settings()->setUseWideViewport(true);
webViewHelper.resize(WebSize(viewportWidth, viewportHeight));
- EXPECT_EQ(980, webViewHelper.webView()
- ->mainFrameImpl()
- ->frameView()
- ->contentsSize()
- .width());
- EXPECT_EQ(980.0 / viewportWidth * viewportHeight, webViewHelper.webView()
- ->mainFrameImpl()
- ->frameView()
- ->contentsSize()
- .height());
+ EXPECT_EQ(980,
+ webViewHelper.webView()
+ ->mainFrameImpl()
+ ->frameView()
+ ->contentsSize()
+ .width());
+ EXPECT_EQ(980.0 / viewportWidth * viewportHeight,
+ webViewHelper.webView()
+ ->mainFrameImpl()
+ ->frameView()
+ ->contentsSize()
+ .height());
}
TEST_P(ParameterizedWebFrameTest, WideViewportSetsTo980WithXhtmlMp) {
@@ -1489,16 +1497,18 @@ TEST_P(ParameterizedWebFrameTest, WideViewportSetsTo980WithXhtmlMp) {
m_baseURL + "viewport/viewport-legacy-xhtmlmp.html");
webViewHelper.resize(WebSize(viewportWidth, viewportHeight));
- EXPECT_EQ(viewportWidth, webViewHelper.webView()
- ->mainFrameImpl()
- ->frameView()
- ->contentsSize()
- .width());
- EXPECT_EQ(viewportHeight, webViewHelper.webView()
- ->mainFrameImpl()
- ->frameView()
- ->contentsSize()
- .height());
+ EXPECT_EQ(viewportWidth,
+ webViewHelper.webView()
+ ->mainFrameImpl()
+ ->frameView()
+ ->contentsSize()
+ .width());
+ EXPECT_EQ(viewportHeight,
+ webViewHelper.webView()
+ ->mainFrameImpl()
+ ->frameView()
+ ->contentsSize()
+ .height());
}
TEST_P(ParameterizedWebFrameTest, NoWideViewportAndHeightInMeta) {
@@ -1517,11 +1527,12 @@ TEST_P(ParameterizedWebFrameTest, NoWideViewportAndHeightInMeta) {
webViewHelper.webView()->settings()->setUseWideViewport(false);
webViewHelper.resize(WebSize(viewportWidth, viewportHeight));
- EXPECT_EQ(viewportWidth, webViewHelper.webView()
- ->mainFrameImpl()
- ->frameView()
- ->contentsSize()
- .width());
+ EXPECT_EQ(viewportWidth,
+ webViewHelper.webView()
+ ->mainFrameImpl()
+ ->frameView()
+ ->contentsSize()
+ .width());
}
TEST_P(ParameterizedWebFrameTest, WideViewportSetsTo980WithAutoWidth) {
@@ -1541,16 +1552,18 @@ TEST_P(ParameterizedWebFrameTest, WideViewportSetsTo980WithAutoWidth) {
webViewHelper.webView()->settings()->setUseWideViewport(true);
webViewHelper.resize(WebSize(viewportWidth, viewportHeight));
- EXPECT_EQ(980, webViewHelper.webView()
- ->mainFrameImpl()
- ->frameView()
- ->contentsSize()
- .width());
- EXPECT_EQ(980.0 / viewportWidth * viewportHeight, webViewHelper.webView()
- ->mainFrameImpl()
- ->frameView()
- ->contentsSize()
- .height());
+ EXPECT_EQ(980,
+ webViewHelper.webView()
+ ->mainFrameImpl()
+ ->frameView()
+ ->contentsSize()
+ .width());
+ EXPECT_EQ(980.0 / viewportWidth * viewportHeight,
+ webViewHelper.webView()
+ ->mainFrameImpl()
+ ->frameView()
+ ->contentsSize()
+ .height());
}
TEST_P(ParameterizedWebFrameTest,
@@ -1708,11 +1721,12 @@ TEST_P(ParameterizedWebFrameTest,
webViewHelper.webView()->setInitialPageScaleOverride(enforcedPageScaleFactor);
webViewHelper.resize(WebSize(viewportWidth, viewportHeight));
- EXPECT_EQ(viewportWidth / enforcedPageScaleFactor, webViewHelper.webView()
- ->mainFrameImpl()
- ->frameView()
- ->contentsSize()
- .width());
+ EXPECT_EQ(viewportWidth / enforcedPageScaleFactor,
+ webViewHelper.webView()
+ ->mainFrameImpl()
+ ->frameView()
+ ->contentsSize()
+ .width());
EXPECT_EQ(enforcedPageScaleFactor,
webViewHelper.webView()->pageScaleFactor());
}
@@ -1754,30 +1768,34 @@ TEST_P(ParameterizedWebFrameTest,
&client, nullptr, configureAndroid);
webViewHelper.webView()->settings()->setForceZeroLayoutHeight(true);
PaintLayerCompositor* compositor = webViewHelper.webView()->compositor();
- EXPECT_EQ(0, webViewHelper.webView()
- ->mainFrameImpl()
- ->frameView()
- ->layoutSize()
- .width());
- EXPECT_EQ(0, webViewHelper.webView()
- ->mainFrameImpl()
- ->frameView()
- ->layoutSize()
- .height());
+ EXPECT_EQ(0,
+ webViewHelper.webView()
+ ->mainFrameImpl()
+ ->frameView()
+ ->layoutSize()
+ .width());
+ EXPECT_EQ(0,
+ webViewHelper.webView()
+ ->mainFrameImpl()
+ ->frameView()
+ ->layoutSize()
+ .height());
EXPECT_EQ(0.0, compositor->containerLayer()->size().width());
EXPECT_EQ(0.0, compositor->containerLayer()->size().height());
webViewHelper.resize(WebSize(viewportWidth, 0));
- EXPECT_EQ(viewportWidth, webViewHelper.webView()
- ->mainFrameImpl()
- ->frameView()
- ->layoutSize()
- .width());
- EXPECT_EQ(0, webViewHelper.webView()
- ->mainFrameImpl()
- ->frameView()
- ->layoutSize()
- .height());
+ EXPECT_EQ(viewportWidth,
+ webViewHelper.webView()
+ ->mainFrameImpl()
+ ->frameView()
+ ->layoutSize()
+ .width());
+ EXPECT_EQ(0,
+ webViewHelper.webView()
+ ->mainFrameImpl()
+ ->frameView()
+ ->layoutSize()
+ .height());
EXPECT_EQ(viewportWidth, compositor->containerLayer()->size().width());
EXPECT_EQ(0.0, compositor->containerLayer()->size().height());
@@ -1788,16 +1806,18 @@ TEST_P(ParameterizedWebFrameTest,
webViewHelper.resize(WebSize(viewportWidth, viewportHeight));
EXPECT_FALSE(
webViewHelper.webView()->mainFrameImpl()->frameView()->needsLayout());
- EXPECT_EQ(viewportWidth, webViewHelper.webView()
- ->mainFrameImpl()
- ->frameView()
- ->layoutSize()
- .width());
- EXPECT_EQ(0, webViewHelper.webView()
- ->mainFrameImpl()
- ->frameView()
- ->layoutSize()
- .height());
+ EXPECT_EQ(viewportWidth,
+ webViewHelper.webView()
+ ->mainFrameImpl()
+ ->frameView()
+ ->layoutSize()
+ .width());
+ EXPECT_EQ(0,
+ webViewHelper.webView()
+ ->mainFrameImpl()
+ ->frameView()
+ ->layoutSize()
+ .height());
EXPECT_EQ(viewportWidth, compositor->containerLayer()->size().width());
EXPECT_EQ(viewportHeight, compositor->containerLayer()->size().height());
@@ -1823,43 +1843,48 @@ TEST_P(ParameterizedWebFrameTest, SetForceZeroLayoutHeight) {
&client, nullptr, enableViewportSettings);
webViewHelper.resize(WebSize(viewportWidth, viewportHeight));
- EXPECT_LE(viewportHeight, webViewHelper.webView()
- ->mainFrameImpl()
- ->frameView()
- ->layoutSize()
- .height());
+ EXPECT_LE(viewportHeight,
+ webViewHelper.webView()
+ ->mainFrameImpl()
+ ->frameView()
+ ->layoutSize()
+ .height());
webViewHelper.webView()->settings()->setForceZeroLayoutHeight(true);
EXPECT_TRUE(
webViewHelper.webView()->mainFrameImpl()->frameView()->needsLayout());
- EXPECT_EQ(0, webViewHelper.webView()
- ->mainFrameImpl()
- ->frameView()
- ->layoutSize()
- .height());
+ EXPECT_EQ(0,
+ webViewHelper.webView()
+ ->mainFrameImpl()
+ ->frameView()
+ ->layoutSize()
+ .height());
webViewHelper.resize(WebSize(viewportWidth, viewportHeight * 2));
EXPECT_FALSE(
webViewHelper.webView()->mainFrameImpl()->frameView()->needsLayout());
- EXPECT_EQ(0, webViewHelper.webView()
- ->mainFrameImpl()
- ->frameView()
- ->layoutSize()
- .height());
+ EXPECT_EQ(0,
+ webViewHelper.webView()
+ ->mainFrameImpl()
+ ->frameView()
+ ->layoutSize()
+ .height());
webViewHelper.resize(WebSize(viewportWidth * 2, viewportHeight));
- EXPECT_EQ(0, webViewHelper.webView()
- ->mainFrameImpl()
- ->frameView()
- ->layoutSize()
- .height());
+ EXPECT_EQ(0,
+ webViewHelper.webView()
+ ->mainFrameImpl()
+ ->frameView()
+ ->layoutSize()
+ .height());
webViewHelper.webView()->settings()->setForceZeroLayoutHeight(false);
- EXPECT_LE(viewportHeight, webViewHelper.webView()
- ->mainFrameImpl()
- ->frameView()
- ->layoutSize()
- .height());
+ EXPECT_LE(viewportHeight,
+ webViewHelper.webView()
+ ->mainFrameImpl()
+ ->frameView()
+ ->layoutSize()
+ .height());
}
TEST_F(WebFrameTest, ToggleViewportMetaOnOff) {
@@ -1965,10 +1990,12 @@ TEST_F(WebFrameTest, FrameOwnerPropertiesMargin) {
// Check if the LocalFrame has seen the marginwidth and marginheight
// properties.
Document* childDocument = localFrame->frame()->document();
- EXPECT_EQ(11, childDocument->firstBodyElement()->getIntegralAttribute(
- HTMLNames::marginwidthAttr));
- EXPECT_EQ(22, childDocument->firstBodyElement()->getIntegralAttribute(
- HTMLNames::marginheightAttr));
+ EXPECT_EQ(11,
+ childDocument->firstBodyElement()->getIntegralAttribute(
+ HTMLNames::marginwidthAttr));
+ EXPECT_EQ(22,
+ childDocument->firstBodyElement()->getIntegralAttribute(
+ HTMLNames::marginheightAttr));
FrameView* frameView = localFrame->frameView();
// Expect scrollbars to be enabled by default.
@@ -1998,10 +2025,12 @@ TEST_F(WebFrameTest, FrameOwnerPropertiesScrolling) {
m_baseURL + "frame_owner_properties.html");
Document* childDocument = localFrame->frame()->document();
- EXPECT_EQ(0, childDocument->firstBodyElement()->getIntegralAttribute(
- HTMLNames::marginwidthAttr));
- EXPECT_EQ(0, childDocument->firstBodyElement()->getIntegralAttribute(
- HTMLNames::marginheightAttr));
+ EXPECT_EQ(0,
+ childDocument->firstBodyElement()->getIntegralAttribute(
+ HTMLNames::marginwidthAttr));
+ EXPECT_EQ(0,
+ childDocument->firstBodyElement()->getIntegralAttribute(
+ HTMLNames::marginheightAttr));
FrameView* frameView =
static_cast<WebLocalFrameImpl*>(localFrame)->frameView();
@@ -2032,11 +2061,12 @@ TEST_P(ParameterizedWebFrameTest,
m_baseURL + "large-div.html");
webViewHelper.webView()->updateAllLifecyclePhases();
- EXPECT_EQ(0, webViewHelper.webView()
- ->mainFrameImpl()
- ->frameView()
- ->layoutSize()
- .height());
+ EXPECT_EQ(0,
+ webViewHelper.webView()
+ ->mainFrameImpl()
+ ->frameView()
+ ->layoutSize()
+ .height());
}
TEST_P(ParameterizedWebFrameTest,
@@ -2057,11 +2087,12 @@ TEST_P(ParameterizedWebFrameTest,
webViewHelper.webView()->settings()->setForceZeroLayoutHeight(true);
webViewHelper.resize(WebSize(viewportWidth, viewportHeight));
- EXPECT_EQ(0, webViewHelper.webView()
- ->mainFrameImpl()
- ->frameView()
- ->layoutSize()
- .height());
+ EXPECT_EQ(0,
+ webViewHelper.webView()
+ ->mainFrameImpl()
+ ->frameView()
+ ->layoutSize()
+ .height());
}
TEST_P(ParameterizedWebFrameTest, WideViewportAndWideContentWithInitialScale) {
@@ -2112,11 +2143,12 @@ TEST_P(ParameterizedWebFrameTest, WideViewportQuirkClobbersHeight) {
m_baseURL + "viewport-height-1000.html");
webViewHelper.resize(WebSize(viewportWidth, viewportHeight));
- EXPECT_EQ(800, webViewHelper.webView()
- ->mainFrameImpl()
- ->frameView()
- ->layoutSize()
- .height());
+ EXPECT_EQ(800,
+ webViewHelper.webView()
+ ->mainFrameImpl()
+ ->frameView()
+ ->layoutSize()
+ .height());
EXPECT_EQ(1, webViewHelper.webView()->pageScaleFactor());
}
@@ -2140,16 +2172,18 @@ TEST_P(ParameterizedWebFrameTest, LayoutSize320Quirk) {
m_baseURL + "viewport/viewport-30.html");
webViewHelper.resize(WebSize(viewportWidth, viewportHeight));
- EXPECT_EQ(600, webViewHelper.webView()
- ->mainFrameImpl()
- ->frameView()
- ->layoutSize()
- .width());
- EXPECT_EQ(800, webViewHelper.webView()
- ->mainFrameImpl()
- ->frameView()
- ->layoutSize()
- .height());
+ EXPECT_EQ(600,
+ webViewHelper.webView()
+ ->mainFrameImpl()
+ ->frameView()
+ ->layoutSize()
+ .width());
+ EXPECT_EQ(800,
+ webViewHelper.webView()
+ ->mainFrameImpl()
+ ->frameView()
+ ->layoutSize()
+ .height());
EXPECT_EQ(1, webViewHelper.webView()->pageScaleFactor());
// The magic number to snap to device-width is 320, so test that 321 is
@@ -2161,40 +2195,44 @@ TEST_P(ParameterizedWebFrameTest, LayoutSize320Quirk) {
description.maxWidth = Length(321, blink::Fixed);
document->setViewportDescription(description);
webViewHelper.webView()->updateAllLifecyclePhases();
- EXPECT_EQ(321, webViewHelper.webView()
- ->mainFrameImpl()
- ->frameView()
- ->layoutSize()
- .width());
+ EXPECT_EQ(321,
+ webViewHelper.webView()
+ ->mainFrameImpl()
+ ->frameView()
+ ->layoutSize()
+ .width());
description.minWidth = Length(320, blink::Fixed);
description.maxWidth = Length(320, blink::Fixed);
document->setViewportDescription(description);
webViewHelper.webView()->updateAllLifecyclePhases();
- EXPECT_EQ(600, webViewHelper.webView()
- ->mainFrameImpl()
- ->frameView()
- ->layoutSize()
- .width());
+ EXPECT_EQ(600,
+ webViewHelper.webView()
+ ->mainFrameImpl()
+ ->frameView()
+ ->layoutSize()
+ .width());
description = document->viewportDescription();
description.maxHeight = Length(1000, blink::Fixed);
document->setViewportDescription(description);
webViewHelper.webView()->updateAllLifecyclePhases();
- EXPECT_EQ(1000, webViewHelper.webView()
- ->mainFrameImpl()
- ->frameView()
- ->layoutSize()
- .height());
+ EXPECT_EQ(1000,
+ webViewHelper.webView()
+ ->mainFrameImpl()
+ ->frameView()
+ ->layoutSize()
+ .height());
description.maxHeight = Length(320, blink::Fixed);
document->setViewportDescription(description);
webViewHelper.webView()->updateAllLifecyclePhases();
- EXPECT_EQ(800, webViewHelper.webView()
- ->mainFrameImpl()
- ->frameView()
- ->layoutSize()
- .height());
+ EXPECT_EQ(800,
+ webViewHelper.webView()
+ ->mainFrameImpl()
+ ->frameView()
+ ->layoutSize()
+ .height());
}
TEST_P(ParameterizedWebFrameTest, ZeroValuesQuirk) {
@@ -2215,20 +2253,22 @@ TEST_P(ParameterizedWebFrameTest, ZeroValuesQuirk) {
m_baseURL + "viewport-zero-values.html");
webViewHelper.resize(WebSize(viewportWidth, viewportHeight));
- EXPECT_EQ(viewportWidth, webViewHelper.webView()
- ->mainFrameImpl()
- ->frameView()
- ->layoutSize()
- .width());
+ EXPECT_EQ(viewportWidth,
+ webViewHelper.webView()
+ ->mainFrameImpl()
+ ->frameView()
+ ->layoutSize()
+ .width());
EXPECT_EQ(1.0f, webViewHelper.webView()->pageScaleFactor());
webViewHelper.webView()->settings()->setUseWideViewport(true);
webViewHelper.webView()->updateAllLifecyclePhases();
- EXPECT_EQ(viewportWidth, webViewHelper.webView()
- ->mainFrameImpl()
- ->frameView()
- ->layoutSize()
- .width());
+ EXPECT_EQ(viewportWidth,
+ webViewHelper.webView()
+ ->mainFrameImpl()
+ ->frameView()
+ ->layoutSize()
+ .width());
EXPECT_EQ(1.0f, webViewHelper.webView()->pageScaleFactor());
}
@@ -2313,21 +2353,23 @@ TEST_P(ParameterizedWebFrameTest, NonZeroValuesNoQuirk) {
m_baseURL + "viewport-nonzero-values.html");
webViewHelper.resize(WebSize(viewportWidth, viewportHeight));
- EXPECT_EQ(viewportWidth / expectedPageScaleFactor, webViewHelper.webView()
- ->mainFrameImpl()
- ->frameView()
- ->layoutSize()
- .width());
+ EXPECT_EQ(viewportWidth / expectedPageScaleFactor,
+ webViewHelper.webView()
+ ->mainFrameImpl()
+ ->frameView()
+ ->layoutSize()
+ .width());
EXPECT_EQ(expectedPageScaleFactor,
webViewHelper.webView()->pageScaleFactor());
webViewHelper.webView()->settings()->setUseWideViewport(true);
webViewHelper.webView()->updateAllLifecyclePhases();
- EXPECT_EQ(viewportWidth / expectedPageScaleFactor, webViewHelper.webView()
- ->mainFrameImpl()
- ->frameView()
- ->layoutSize()
- .width());
+ EXPECT_EQ(viewportWidth / expectedPageScaleFactor,
+ webViewHelper.webView()
+ ->mainFrameImpl()
+ ->frameView()
+ ->layoutSize()
+ .width());
EXPECT_EQ(expectedPageScaleFactor,
webViewHelper.webView()->pageScaleFactor());
}
@@ -2397,10 +2439,11 @@ TEST_P(ParameterizedWebFrameTest, pageScaleFactorWrittenToHistoryItem) {
webViewHelper.resize(WebSize(viewportWidth, viewportHeight));
webViewHelper.webView()->setPageScaleFactor(3);
- EXPECT_EQ(3, toLocalFrame(webViewHelper.webView()->page()->mainFrame())
- ->loader()
- .currentItem()
- ->pageScaleFactor());
+ EXPECT_EQ(3,
+ toLocalFrame(webViewHelper.webView()->page()->mainFrame())
+ ->loader()
+ .currentItem()
+ ->pageScaleFactor());
}
TEST_P(ParameterizedWebFrameTest, initialScaleWrittenToHistoryItem) {
@@ -2486,15 +2529,17 @@ TEST_P(ParameterizedWebFrameTest, pageScaleFactorDoesNotApplyCssTransform) {
webViewHelper.webView()->setPageScaleFactor(2);
- EXPECT_EQ(980, toLocalFrame(webViewHelper.webView()->page()->mainFrame())
- ->contentLayoutItem()
- .documentRect()
- .width());
- EXPECT_EQ(980, webViewHelper.webView()
- ->mainFrameImpl()
- ->frameView()
- ->contentsSize()
- .width());
+ EXPECT_EQ(980,
+ toLocalFrame(webViewHelper.webView()->page()->mainFrame())
+ ->contentLayoutItem()
+ .documentRect()
+ .width());
+ EXPECT_EQ(980,
+ webViewHelper.webView()
+ ->mainFrameImpl()
+ ->frameView()
+ ->contentsSize()
+ .width());
}
TEST_P(ParameterizedWebFrameTest, targetDensityDpiHigh) {
@@ -2524,17 +2569,19 @@ TEST_P(ParameterizedWebFrameTest, targetDensityDpiHigh) {
// We need to account for the fact that logical pixels are unconditionally
// multiplied by deviceScaleFactor to produce physical pixels.
float densityDpiScaleRatio = deviceScaleFactor * targetDpi / deviceDpi;
- EXPECT_NEAR(viewportWidth * densityDpiScaleRatio, webViewHelper.webView()
- ->mainFrameImpl()
- ->frameView()
- ->layoutSize()
- .width(),
+ EXPECT_NEAR(viewportWidth * densityDpiScaleRatio,
+ webViewHelper.webView()
+ ->mainFrameImpl()
+ ->frameView()
+ ->layoutSize()
+ .width(),
1.0f);
- EXPECT_NEAR(viewportHeight * densityDpiScaleRatio, webViewHelper.webView()
- ->mainFrameImpl()
- ->frameView()
- ->layoutSize()
- .height(),
+ EXPECT_NEAR(viewportHeight * densityDpiScaleRatio,
+ webViewHelper.webView()
+ ->mainFrameImpl()
+ ->frameView()
+ ->layoutSize()
+ .height(),
1.0f);
EXPECT_NEAR(1.0f / densityDpiScaleRatio,
webViewHelper.webView()->pageScaleFactor(), 0.01f);
@@ -2604,17 +2651,19 @@ TEST_P(ParameterizedWebFrameTest, targetDensityDpiDeviceAndFixedWidth) {
webViewHelper.webView()->settings()->setUseWideViewport(true);
webViewHelper.resize(WebSize(viewportWidth, viewportHeight));
- EXPECT_NEAR(viewportWidth, webViewHelper.webView()
- ->mainFrameImpl()
- ->frameView()
- ->layoutSize()
- .width(),
+ EXPECT_NEAR(viewportWidth,
+ webViewHelper.webView()
+ ->mainFrameImpl()
+ ->frameView()
+ ->layoutSize()
+ .width(),
1.0f);
- EXPECT_NEAR(viewportHeight, webViewHelper.webView()
- ->mainFrameImpl()
- ->frameView()
- ->layoutSize()
- .height(),
+ EXPECT_NEAR(viewportHeight,
+ webViewHelper.webView()
+ ->mainFrameImpl()
+ ->frameView()
+ ->layoutSize()
+ .height(),
1.0f);
EXPECT_NEAR(1.0f, webViewHelper.webView()->pageScaleFactor(), 0.01f);
}
@@ -2713,17 +2762,19 @@ TEST_P(ParameterizedWebFrameTest,
webViewHelper.webView()->setInitialPageScaleOverride(enforcedPageScaleFactor);
webViewHelper.resize(WebSize(viewportWidth, viewportHeight));
- EXPECT_NEAR(viewportWidth / enforcedPageScaleFactor, webViewHelper.webView()
- ->mainFrameImpl()
- ->frameView()
- ->layoutSize()
- .width(),
+ EXPECT_NEAR(viewportWidth / enforcedPageScaleFactor,
+ webViewHelper.webView()
+ ->mainFrameImpl()
+ ->frameView()
+ ->layoutSize()
+ .width(),
1.0f);
- EXPECT_NEAR(viewportHeight / enforcedPageScaleFactor, webViewHelper.webView()
- ->mainFrameImpl()
- ->frameView()
- ->layoutSize()
- .height(),
+ EXPECT_NEAR(viewportHeight / enforcedPageScaleFactor,
+ webViewHelper.webView()
+ ->mainFrameImpl()
+ ->frameView()
+ ->layoutSize()
+ .height(),
1.0f);
EXPECT_NEAR(enforcedPageScaleFactor,
webViewHelper.webView()->pageScaleFactor(), 0.01f);
@@ -2744,17 +2795,19 @@ TEST_P(ParameterizedWebFrameTest, NoUserScalableQuirkIgnoresViewportScale) {
true);
webViewHelper.resize(WebSize(viewportWidth, viewportHeight));
- EXPECT_NEAR(viewportWidth, webViewHelper.webView()
- ->mainFrameImpl()
- ->frameView()
- ->layoutSize()
- .width(),
+ EXPECT_NEAR(viewportWidth,
+ webViewHelper.webView()
+ ->mainFrameImpl()
+ ->frameView()
+ ->layoutSize()
+ .width(),
1.0f);
- EXPECT_NEAR(viewportHeight, webViewHelper.webView()
- ->mainFrameImpl()
- ->frameView()
- ->layoutSize()
- .height(),
+ EXPECT_NEAR(viewportHeight,
+ webViewHelper.webView()
+ ->mainFrameImpl()
+ ->frameView()
+ ->layoutSize()
+ .height(),
1.0f);
EXPECT_NEAR(1.0f, webViewHelper.webView()->pageScaleFactor(), 0.01f);
}
@@ -2816,17 +2869,19 @@ TEST_P(ParameterizedWebFrameTest,
webViewHelper.webView()->settings()->setUseWideViewport(true);
webViewHelper.resize(WebSize(viewportWidth, viewportHeight));
- EXPECT_NEAR(viewportWidth, webViewHelper.webView()
- ->mainFrameImpl()
- ->frameView()
- ->layoutSize()
- .width(),
+ EXPECT_NEAR(viewportWidth,
+ webViewHelper.webView()
+ ->mainFrameImpl()
+ ->frameView()
+ ->layoutSize()
+ .width(),
1.0f);
- EXPECT_NEAR(viewportHeight, webViewHelper.webView()
- ->mainFrameImpl()
- ->frameView()
- ->layoutSize()
- .height(),
+ EXPECT_NEAR(viewportHeight,
+ webViewHelper.webView()
+ ->mainFrameImpl()
+ ->frameView()
+ ->layoutSize()
+ .height(),
1.0f);
EXPECT_NEAR(1.0f, webViewHelper.webView()->pageScaleFactor(), 0.01f);
}
@@ -2863,19 +2918,21 @@ TEST_P(ParameterizedWebFrameTest, AtViewportInsideAtMediaInitialViewport) {
enableViewportSettings);
webViewHelper.resize(WebSize(640, 480));
- EXPECT_EQ(2000, webViewHelper.webView()
- ->mainFrameImpl()
- ->frameView()
- ->layoutSize()
- .width());
+ EXPECT_EQ(2000,
+ webViewHelper.webView()
+ ->mainFrameImpl()
+ ->frameView()
+ ->layoutSize()
+ .width());
webViewHelper.resize(WebSize(1200, 480));
- EXPECT_EQ(1200, webViewHelper.webView()
- ->mainFrameImpl()
- ->frameView()
- ->layoutSize()
- .width());
+ EXPECT_EQ(1200,
+ webViewHelper.webView()
+ ->mainFrameImpl()
+ ->frameView()
+ ->layoutSize()
+ .width());
}
TEST_P(ParameterizedWebFrameTest, AtViewportAffectingAtMediaRecalcCount) {
@@ -2891,11 +2948,12 @@ TEST_P(ParameterizedWebFrameTest, AtViewportAffectingAtMediaRecalcCount) {
Document* document =
webViewHelper.webView()->mainFrameImpl()->frame()->document();
- EXPECT_EQ(2000, webViewHelper.webView()
- ->mainFrameImpl()
- ->frameView()
- ->layoutSize()
- .width());
+ EXPECT_EQ(2000,
+ webViewHelper.webView()
+ ->mainFrameImpl()
+ ->frameView()
+ ->layoutSize()
+ .width());
// The styleForElementCount() should match the number of elements for a single
// pass of computed styles construction for the document.
@@ -6300,9 +6358,10 @@ TEST_P(ParameterizedWebFrameTest, ReplaceMisspelledRange) {
frame->frame()->selection().selection().toNormalizedEphemeralRange();
EXPECT_EQ(1, spellcheck.numberOfTimesChecked());
- EXPECT_EQ(1U, document->markers()
- .markersInRange(selectionRange, DocumentMarker::Spelling)
- .size());
+ EXPECT_EQ(1U,
+ document->markers()
+ .markersInRange(selectionRange, DocumentMarker::Spelling)
+ .size());
frame->replaceMisspelledRange("welcome");
EXPECT_EQ("_welcome_.",
@@ -6338,9 +6397,10 @@ TEST_P(ParameterizedWebFrameTest, RemoveSpellingMarkers) {
EphemeralRange selectionRange =
frame->frame()->selection().selection().toNormalizedEphemeralRange();
- EXPECT_EQ(0U, document->markers()
- .markersInRange(selectionRange, DocumentMarker::Spelling)
- .size());
+ EXPECT_EQ(0U,
+ document->markers()
+ .markersInRange(selectionRange, DocumentMarker::Spelling)
+ .size());
}
TEST_P(ParameterizedWebFrameTest, RemoveSpellingMarkersUnderWords) {
@@ -7347,11 +7407,11 @@ TEST_P(ParameterizedWebFrameTest, SameDocumentHistoryNavigationCommitType) {
toLocalFrame(webViewImpl->page()->mainFrame())
->loader()
- .load(
- FrameLoadRequest(
- nullptr, FrameLoader::resourceRequestFromHistoryItem(
- item.get(), WebCachePolicy::UseProtocolCachePolicy)),
- FrameLoadTypeBackForward, item.get(), HistorySameDocumentLoad);
+ .load(FrameLoadRequest(
+ nullptr,
+ FrameLoader::resourceRequestFromHistoryItem(
+ item.get(), WebCachePolicy::UseProtocolCachePolicy)),
+ FrameLoadTypeBackForward, item.get(), HistorySameDocumentLoad);
EXPECT_EQ(WebBackForwardCommit, client.lastCommitType());
}
@@ -9105,12 +9165,13 @@ TEST_F(WebFrameSwapTest, UniqueNameAfterRemoteToLocalSwap) {
&client, nullptr, nullptr, remoteFrame, WebSandboxFlags::None);
FrameTestHelpers::loadFrame(localFrame, m_baseURL + "subframe-hello.html");
EXPECT_EQ(uniqueName.utf8(), localFrame->uniqueName().utf8());
- EXPECT_EQ(uniqueName.utf8(), WebString(toWebLocalFrameImpl(localFrame)
- ->frame()
- ->loader()
- .currentItem()
- ->target())
- .utf8());
+ EXPECT_EQ(uniqueName.utf8(),
+ WebString(toWebLocalFrameImpl(localFrame)
+ ->frame()
+ ->loader()
+ .currentItem()
+ ->target())
+ .utf8());
// Repeat with no name on the frame.
// (note that uniqueName is immutable after first real commit).
@@ -9132,12 +9193,13 @@ TEST_F(WebFrameSwapTest, UniqueNameAfterRemoteToLocalSwap) {
&client2, nullptr, nullptr, remoteFrame2, WebSandboxFlags::None);
FrameTestHelpers::loadFrame(localFrame2, m_baseURL + "subframe-hello.html");
EXPECT_EQ(uniqueName2.utf8(), localFrame2->uniqueName().utf8());
- EXPECT_EQ(uniqueName2.utf8(), WebString(toWebLocalFrameImpl(localFrame2)
- ->frame()
- ->loader()
- .currentItem()
- ->target())
- .utf8());
+ EXPECT_EQ(uniqueName2.utf8(),
+ WebString(toWebLocalFrameImpl(localFrame2)
+ ->frame()
+ ->loader()
+ .currentItem()
+ ->target())
+ .utf8());
// Manually reset to break WebViewHelper's dependency on the stack allocated
// TestWebFrameClient.
@@ -9824,18 +9886,21 @@ TEST_P(WebFrameOverscrollTest,
// Calculation of accumulatedRootOverscroll and unusedDelta on multiple
// scrollUpdate.
ScrollBegin(&webViewHelper);
- EXPECT_CALL(client, didOverscroll(WebFloatSize(8, 16), WebFloatSize(8, 16),
- WebFloatPoint(100, 100), WebFloatSize()));
+ EXPECT_CALL(client,
+ didOverscroll(WebFloatSize(8, 16), WebFloatSize(8, 16),
+ WebFloatPoint(100, 100), WebFloatSize()));
ScrollUpdate(&webViewHelper, -308, -316);
Mock::VerifyAndClearExpectations(&client);
- EXPECT_CALL(client, didOverscroll(WebFloatSize(0, 13), WebFloatSize(8, 29),
- WebFloatPoint(100, 100), WebFloatSize()));
+ EXPECT_CALL(client,
+ didOverscroll(WebFloatSize(0, 13), WebFloatSize(8, 29),
+ WebFloatPoint(100, 100), WebFloatSize()));
ScrollUpdate(&webViewHelper, 0, -13);
Mock::VerifyAndClearExpectations(&client);
- EXPECT_CALL(client, didOverscroll(WebFloatSize(20, 13), WebFloatSize(28, 42),
- WebFloatPoint(100, 100), WebFloatSize()));
+ EXPECT_CALL(client,
+ didOverscroll(WebFloatSize(20, 13), WebFloatSize(28, 42),
+ WebFloatPoint(100, 100), WebFloatSize()));
ScrollUpdate(&webViewHelper, -20, -13);
Mock::VerifyAndClearExpectations(&client);
@@ -9882,8 +9947,9 @@ TEST_P(WebFrameOverscrollTest,
ScrollBegin(&webViewHelper);
// Now On Scrolling DIV, scroll is bubbled and root layer is over-scrolled.
- EXPECT_CALL(client, didOverscroll(WebFloatSize(0, 100), WebFloatSize(0, 100),
- WebFloatPoint(100, 100), WebFloatSize()));
+ EXPECT_CALL(client,
+ didOverscroll(WebFloatSize(0, 100), WebFloatSize(0, 100),
+ WebFloatPoint(100, 100), WebFloatSize()));
ScrollUpdate(&webViewHelper, 0, -100);
ScrollUpdate(&webViewHelper, 0, -100);
Mock::VerifyAndClearExpectations(&client);
@@ -9929,8 +9995,9 @@ TEST_P(WebFrameOverscrollTest, RootLayerOverscrolledOnInnerDivOverScroll) {
ScrollBegin(&webViewHelper);
// Now On Scrolling DIV, scroll is bubbled and root layer is over-scrolled.
- EXPECT_CALL(client, didOverscroll(WebFloatSize(0, 50), WebFloatSize(0, 50),
- WebFloatPoint(100, 100), WebFloatSize()));
+ EXPECT_CALL(client,
+ didOverscroll(WebFloatSize(0, 50), WebFloatSize(0, 50),
+ WebFloatPoint(100, 100), WebFloatSize()));
ScrollUpdate(&webViewHelper, 0, -150);
Mock::VerifyAndClearExpectations(&client);
}
@@ -9962,8 +10029,9 @@ TEST_P(WebFrameOverscrollTest, RootLayerOverscrolledOnInnerIFrameOverScroll) {
ScrollBegin(&webViewHelper);
// Now On Scrolling IFrame, scroll is bubbled and root layer is over-scrolled.
- EXPECT_CALL(client, didOverscroll(WebFloatSize(0, 50), WebFloatSize(0, 50),
- WebFloatPoint(100, 100), WebFloatSize()));
+ EXPECT_CALL(client,
+ didOverscroll(WebFloatSize(0, 50), WebFloatSize(0, 50),
+ WebFloatPoint(100, 100), WebFloatSize()));
ScrollUpdate(&webViewHelper, 0, -150);
Mock::VerifyAndClearExpectations(&client);
@@ -9984,13 +10052,15 @@ TEST_P(WebFrameOverscrollTest, ScaledPageRootLayerOverscrolled) {
// The point is (99, 99) because we clamp in the division by 3 to 33 so when
// we go back to viewport coordinates it becomes (99, 99).
ScrollBegin(&webViewHelper);
- EXPECT_CALL(client, didOverscroll(WebFloatSize(0, -30), WebFloatSize(0, -30),
- WebFloatPoint(99, 99), WebFloatSize()));
+ EXPECT_CALL(client,
+ didOverscroll(WebFloatSize(0, -30), WebFloatSize(0, -30),
+ WebFloatPoint(99, 99), WebFloatSize()));
ScrollUpdate(&webViewHelper, 0, 30);
Mock::VerifyAndClearExpectations(&client);
- EXPECT_CALL(client, didOverscroll(WebFloatSize(0, -30), WebFloatSize(0, -60),
- WebFloatPoint(99, 99), WebFloatSize()));
+ EXPECT_CALL(client,
+ didOverscroll(WebFloatSize(0, -30), WebFloatSize(0, -60),
+ WebFloatPoint(99, 99), WebFloatSize()));
ScrollUpdate(&webViewHelper, 0, 30);
Mock::VerifyAndClearExpectations(&client);
@@ -10034,9 +10104,10 @@ TEST_P(WebFrameOverscrollTest, NoOverscrollForSmallvalues) {
ScrollUpdate(&webViewHelper, 0, 0.10);
Mock::VerifyAndClearExpectations(&client);
- EXPECT_CALL(client, didOverscroll(WebFloatSize(-0.10, 0),
- WebFloatSize(-10.10, -10.10),
- WebFloatPoint(100, 100), WebFloatSize()));
+ EXPECT_CALL(
+ client,
+ didOverscroll(WebFloatSize(-0.10, 0), WebFloatSize(-10.10, -10.10),
+ WebFloatPoint(100, 100), WebFloatSize()));
ScrollUpdate(&webViewHelper, 0.10, 0);
Mock::VerifyAndClearExpectations(&client);
@@ -10409,8 +10480,9 @@ TEST_F(WebFrameTest, CopyImageAt) {
WebLocalFrame* localFrame = webView->mainFrameImpl();
localFrame->copyImageAt(WebPoint(50, 50));
- EXPECT_NE(sequence, Platform::current()->clipboard()->sequenceNumber(
- WebClipboard::BufferStandard));
+ EXPECT_NE(sequence,
+ Platform::current()->clipboard()->sequenceNumber(
+ WebClipboard::BufferStandard));
WebImage image =
static_cast<WebMockClipboard*>(Platform::current()->clipboard())
@@ -10437,8 +10509,9 @@ TEST_F(WebFrameTest, CopyImageAtWithPinchZoom) {
WebLocalFrame* localFrame = webView->mainFrameImpl();
localFrame->copyImageAt(WebPoint(0, 0));
- EXPECT_NE(sequence, Platform::current()->clipboard()->sequenceNumber(
- WebClipboard::BufferStandard));
+ EXPECT_NE(sequence,
+ Platform::current()->clipboard()->sequenceNumber(
+ WebClipboard::BufferStandard));
WebImage image =
static_cast<WebMockClipboard*>(Platform::current()->clipboard())
@@ -10493,10 +10566,11 @@ TEST_F(WebFrameTest, LoadJavascriptURLInNewFrame) {
// Normally, the result of the JS url replaces the existing contents on the
// Document. However, if the JS triggers a navigation, the contents should
// not be replaced.
- EXPECT_EQ("", toLocalFrame(helper.webView()->page()->mainFrame())
- ->document()
- ->documentElement()
- ->innerText());
+ EXPECT_EQ("",
+ toLocalFrame(helper.webView()->page()->mainFrame())
+ ->document()
+ ->documentElement()
+ ->innerText());
}
class TestResourcePriorityWebFrameClient

Powered by Google App Engine
This is Rietveld 408576698