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

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

Issue 2165573003: Simplify tests by using Web*Impl types directly. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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 fa57cdb1366ac9f494597105f1903cad659cf482..2d6f561d894c111c35095a14111df95a61f7e61e 100644
--- a/third_party/WebKit/Source/web/tests/WebFrameTest.cpp
+++ b/third_party/WebKit/Source/web/tests/WebFrameTest.cpp
@@ -224,7 +224,7 @@ protected:
RuleSet* ruleSet = RuleSet::create();
ruleSet->addRulesFromSheet(styleSheet, MediaQueryEvaluator("screen"));
- Document* document = toLocalFrame(webViewHelper->webViewImpl()->page()->mainFrame())->document();
+ Document* document = toLocalFrame(webViewHelper->webView()->page()->mainFrame())->document();
document->ensureStyleResolver().viewportStyleResolver()->collectViewportRules(ruleSet, ViewportStyleResolver::UserAgentOrigin);
document->ensureStyleResolver().viewportStyleResolver()->resolve();
}
@@ -260,7 +260,7 @@ protected:
registerMockedHttpURLLoad("nodeimage.html");
webViewHelper->initializeAndLoad(m_baseURL + "nodeimage.html");
webViewHelper->resize(WebSize(640, 480));
- LocalFrame* frame = toLocalFrame(webViewHelper->webViewImpl()->page()->mainFrame());
+ LocalFrame* frame = toLocalFrame(webViewHelper->webView()->page()->mainFrame());
DCHECK(frame);
Element* element = frame->document()->getElementById(testcase.c_str());
return frame->nodeImage(*element);
@@ -379,8 +379,8 @@ TEST_P(ParameterizedWebFrameTest, SuspendedRequestExecuteScript)
ScriptExecutionCallbackHelper callbackHelper(webViewHelper.webView()->mainFrame()->mainWorldScriptContext());
// Suspend scheduled tasks so the script doesn't run.
- toWebLocalFrameImpl(webViewHelper.webView()->mainFrame())->frame()->document()->suspendScheduledTasks();
- webViewHelper.webView()->mainFrame()->toWebLocalFrame()->requestExecuteScriptAndReturnValue(WebScriptSource(WebString("'hello';")), false, &callbackHelper);
+ webViewHelper.webView()->mainFrameImpl()->frame()->document()->suspendScheduledTasks();
+ webViewHelper.webView()->mainFrameImpl()->requestExecuteScriptAndReturnValue(WebScriptSource(WebString("'hello';")), false, &callbackHelper);
runPendingTasks();
EXPECT_FALSE(callbackHelper.didComplete());
@@ -818,7 +818,7 @@ TEST_P(ParameterizedWebFrameTest, PostMessageThenDetach)
FrameTestHelpers::WebViewHelper webViewHelper(this);
webViewHelper.initializeAndLoad("about:blank");
- LocalFrame* frame = toLocalFrame(webViewHelper.webViewImpl()->page()->mainFrame());
+ LocalFrame* frame = toLocalFrame(webViewHelper.webView()->page()->mainFrame());
NonThrowableExceptionState exceptionState;
MessagePortArray messagePorts;
frame->domWindow()->postMessage(SerializedScriptValue::serialize("message"), messagePorts, "*", frame->localDOMWindow(), exceptionState);
@@ -891,7 +891,7 @@ TEST_P(ParameterizedWebFrameTest, ChangeInFixedLayoutResetsTextAutosizingMultipl
FrameTestHelpers::WebViewHelper webViewHelper(this);
webViewHelper.initializeAndLoad(m_baseURL + "fixed_layout.html", true, nullptr, &client, nullptr, enableViewportSettings);
- Document* document = toLocalFrame(webViewHelper.webViewImpl()->page()->mainFrame())->document();
+ Document* document = toLocalFrame(webViewHelper.webView()->page()->mainFrame())->document();
document->settings()->setTextAutosizingEnabled(true);
EXPECT_TRUE(document->settings()->textAutosizingEnabled());
webViewHelper.resize(WebSize(viewportWidth, viewportHeight));
@@ -902,7 +902,7 @@ TEST_P(ParameterizedWebFrameTest, ChangeInFixedLayoutResetsTextAutosizingMultipl
// Choose a width that's not going match the viewport width of the loaded document.
description.minWidth = Length(100, blink::Fixed);
description.maxWidth = Length(100, blink::Fixed);
- webViewHelper.webViewImpl()->updatePageDefinedViewportConstraints(description);
+ webViewHelper.webView()->updatePageDefinedViewportConstraints(description);
EXPECT_TRUE(checkTextAutosizingMultiplier(document, 1));
}
@@ -917,7 +917,7 @@ TEST_P(ParameterizedWebFrameTest, WorkingTextAutosizingMultipliers_VirtualViewpo
FrameTestHelpers::WebViewHelper webViewHelper(this);
webViewHelper.initializeAndLoad(m_baseURL + htmlFile, true, nullptr, &client, nullptr, configureAndroid);
- Document* document = toLocalFrame(webViewHelper.webViewImpl()->page()->mainFrame())->document();
+ Document* document = toLocalFrame(webViewHelper.webView()->page()->mainFrame())->document();
document->settings()->setTextAutosizingEnabled(true);
EXPECT_TRUE(document->settings()->textAutosizingEnabled());
@@ -939,9 +939,9 @@ TEST_P(ParameterizedWebFrameTest, VisualViewportSetSizeInvalidatesTextAutosizing
FrameTestHelpers::WebViewHelper webViewHelper(this);
webViewHelper.initializeAndLoad(m_baseURL + "iframe_reload.html", true, nullptr, &client, nullptr, enableViewportSettings);
- LocalFrame* mainFrame = toLocalFrame(webViewHelper.webViewImpl()->page()->mainFrame());
+ LocalFrame* mainFrame = toLocalFrame(webViewHelper.webView()->page()->mainFrame());
Document* document = mainFrame->document();
- FrameView* frameView = webViewHelper.webViewImpl()->mainFrameImpl()->frameView();
+ FrameView* frameView = webViewHelper.webView()->mainFrameImpl()->frameView();
document->settings()->setTextAutosizingEnabled(true);
EXPECT_TRUE(document->settings()->textAutosizingEnabled());
webViewHelper.resize(WebSize(viewportWidth, viewportHeight));
@@ -979,8 +979,8 @@ TEST_P(ParameterizedWebFrameTest, ZeroHeightPositiveWidthNotIgnored)
webViewHelper.initialize(true, nullptr, &client, nullptr, enableViewportSettings);
webViewHelper.resize(WebSize(viewportWidth, viewportHeight));
- EXPECT_EQ(viewportWidth, webViewHelper.webViewImpl()->mainFrameImpl()->frameView()->layoutSize().width());
- EXPECT_EQ(viewportHeight, webViewHelper.webViewImpl()->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, DeviceScaleFactorUsesDefaultWithoutViewportTag)
@@ -998,7 +998,7 @@ TEST_P(ParameterizedWebFrameTest, DeviceScaleFactorUsesDefaultWithoutViewportTag
webViewHelper.resize(WebSize(viewportWidth, viewportHeight));
- EXPECT_EQ(2, webViewHelper.webViewImpl()->page()->deviceScaleFactor());
+ EXPECT_EQ(2, webViewHelper.webView()->page()->deviceScaleFactor());
// Device scale factor should be independent of page scale.
webViewHelper.webView()->setDefaultPageScaleLimits(1, 2);
@@ -1029,8 +1029,8 @@ TEST_P(ParameterizedWebFrameTest, FixedLayoutInitializeAtMinimumScale)
int defaultFixedLayoutWidth = 980;
float minimumPageScaleFactor = viewportWidth / (float) defaultFixedLayoutWidth;
- EXPECT_EQ(minimumPageScaleFactor, webViewHelper.webViewImpl()->pageScaleFactor());
- EXPECT_EQ(minimumPageScaleFactor, webViewHelper.webViewImpl()->minimumPageScaleFactor());
+ EXPECT_EQ(minimumPageScaleFactor, webViewHelper.webView()->pageScaleFactor());
+ EXPECT_EQ(minimumPageScaleFactor, webViewHelper.webView()->minimumPageScaleFactor());
// Assume the user has pinch zoomed to page scale factor 2.
float userPinchPageScaleFactor = 2;
@@ -1038,8 +1038,8 @@ TEST_P(ParameterizedWebFrameTest, FixedLayoutInitializeAtMinimumScale)
webViewHelper.webView()->updateAllLifecyclePhases();
// Make sure we don't reset to initial scale if the page continues to load.
- webViewHelper.webViewImpl()->didCommitLoad(false, false);
- webViewHelper.webViewImpl()->didChangeContentsSize();
+ webViewHelper.webView()->didCommitLoad(false, false);
+ webViewHelper.webView()->didChangeContentsSize();
EXPECT_EQ(userPinchPageScaleFactor, webViewHelper.webView()->pageScaleFactor());
// Make sure we don't reset to initial scale if the viewport size changes.
@@ -1066,8 +1066,8 @@ TEST_P(ParameterizedWebFrameTest, WideDocumentInitializeAtMinimumScale)
int wideDocumentWidth = 1500;
float minimumPageScaleFactor = viewportWidth / (float) wideDocumentWidth;
- EXPECT_EQ(minimumPageScaleFactor, webViewHelper.webViewImpl()->pageScaleFactor());
- EXPECT_EQ(minimumPageScaleFactor, webViewHelper.webViewImpl()->minimumPageScaleFactor());
+ EXPECT_EQ(minimumPageScaleFactor, webViewHelper.webView()->pageScaleFactor());
+ EXPECT_EQ(minimumPageScaleFactor, webViewHelper.webView()->minimumPageScaleFactor());
// Assume the user has pinch zoomed to page scale factor 2.
float userPinchPageScaleFactor = 2;
@@ -1075,8 +1075,8 @@ TEST_P(ParameterizedWebFrameTest, WideDocumentInitializeAtMinimumScale)
webViewHelper.webView()->updateAllLifecyclePhases();
// Make sure we don't reset to initial scale if the page continues to load.
- webViewHelper.webViewImpl()->didCommitLoad(false, false);
- webViewHelper.webViewImpl()->didChangeContentsSize();
+ webViewHelper.webView()->didCommitLoad(false, false);
+ webViewHelper.webView()->didChangeContentsSize();
EXPECT_EQ(userPinchPageScaleFactor, webViewHelper.webView()->pageScaleFactor());
// Make sure we don't reset to initial scale if the viewport size changes.
@@ -1099,7 +1099,7 @@ TEST_P(ParameterizedWebFrameTest, DelayedViewportInitialScale)
EXPECT_EQ(0.25f, webViewHelper.webView()->pageScaleFactor());
- Document* document = toLocalFrame(webViewHelper.webViewImpl()->page()->mainFrame())->document();
+ Document* document = toLocalFrame(webViewHelper.webView()->page()->mainFrame())->document();
ViewportDescription description = document->viewportDescription();
description.zoom = 2;
document->setViewportDescription(description);
@@ -1162,8 +1162,8 @@ TEST_P(ParameterizedWebFrameTest, NoWideViewportIgnoresPageViewportWidth)
webViewHelper.resize(WebSize(viewportWidth, viewportHeight));
// The page sets viewport width to 3000, but with UseWideViewport == false is must be ignored.
- EXPECT_EQ(viewportWidth, webViewHelper.webViewImpl()->mainFrameImpl()->frameView()->contentsSize().width());
- EXPECT_EQ(viewportHeight, webViewHelper.webViewImpl()->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, NoWideViewportIgnoresPageViewportWidthButAccountsScale)
@@ -1183,8 +1183,8 @@ TEST_P(ParameterizedWebFrameTest, NoWideViewportIgnoresPageViewportWidthButAccou
// 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.webViewImpl()->mainFrameImpl()->frameView()->contentsSize().width());
- EXPECT_EQ(viewportHeight / 2, webViewHelper.webViewImpl()->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)
@@ -1203,8 +1203,8 @@ TEST_P(ParameterizedWebFrameTest, WideViewportSetsTo980WithoutViewportTag)
webViewHelper.webView()->settings()->setUseWideViewport(true);
webViewHelper.resize(WebSize(viewportWidth, viewportHeight));
- EXPECT_EQ(980, webViewHelper.webViewImpl()->mainFrameImpl()->frameView()->contentsSize().width());
- EXPECT_EQ(980.0 / viewportWidth * viewportHeight, webViewHelper.webViewImpl()->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)
@@ -1224,8 +1224,8 @@ TEST_P(ParameterizedWebFrameTest, WideViewportSetsTo980WithXhtmlMp)
FrameTestHelpers::loadFrame(webViewHelper.webView()->mainFrame(), m_baseURL + "viewport/viewport-legacy-xhtmlmp.html");
webViewHelper.resize(WebSize(viewportWidth, viewportHeight));
- EXPECT_EQ(viewportWidth, webViewHelper.webViewImpl()->mainFrameImpl()->frameView()->contentsSize().width());
- EXPECT_EQ(viewportHeight, webViewHelper.webViewImpl()->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)
@@ -1243,7 +1243,7 @@ TEST_P(ParameterizedWebFrameTest, NoWideViewportAndHeightInMeta)
webViewHelper.webView()->settings()->setUseWideViewport(false);
webViewHelper.resize(WebSize(viewportWidth, viewportHeight));
- EXPECT_EQ(viewportWidth, webViewHelper.webViewImpl()->mainFrameImpl()->frameView()->contentsSize().width());
+ EXPECT_EQ(viewportWidth, webViewHelper.webView()->mainFrameImpl()->frameView()->contentsSize().width());
}
TEST_P(ParameterizedWebFrameTest, WideViewportSetsTo980WithAutoWidth)
@@ -1262,8 +1262,8 @@ TEST_P(ParameterizedWebFrameTest, WideViewportSetsTo980WithAutoWidth)
webViewHelper.webView()->settings()->setUseWideViewport(true);
webViewHelper.resize(WebSize(viewportWidth, viewportHeight));
- EXPECT_EQ(980, webViewHelper.webViewImpl()->mainFrameImpl()->frameView()->contentsSize().width());
- EXPECT_EQ(980.0 / viewportWidth * viewportHeight, webViewHelper.webViewImpl()->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, PageViewportInitialScaleOverridesLoadWithOverviewMode)
@@ -1401,7 +1401,7 @@ TEST_P(ParameterizedWebFrameTest, PermanentInitialPageScaleFactorAffectsLayoutWi
webViewHelper.webView()->setInitialPageScaleOverride(enforcedPageScaleFactor);
webViewHelper.resize(WebSize(viewportWidth, viewportHeight));
- EXPECT_EQ(viewportWidth / enforcedPageScaleFactor, webViewHelper.webViewImpl()->mainFrameImpl()->frameView()->contentsSize().width());
+ EXPECT_EQ(viewportWidth / enforcedPageScaleFactor, webViewHelper.webView()->mainFrameImpl()->frameView()->contentsSize().width());
EXPECT_EQ(enforcedPageScaleFactor, webViewHelper.webView()->pageScaleFactor());
}
@@ -1420,7 +1420,7 @@ TEST_P(ParameterizedWebFrameTest, DocumentElementClientHeightWorksWithWrapConten
webViewHelper.webView()->settings()->setForceZeroLayoutHeight(true);
webViewHelper.resize(WebSize(viewportWidth, viewportHeight));
- LocalFrame* frame = webViewHelper.webViewImpl()->mainFrameImpl()->frame();
+ LocalFrame* frame = webViewHelper.webView()->mainFrameImpl()->frame();
Document* document = frame->document();
EXPECT_EQ(viewportHeight, document->documentElement()->clientHeight());
EXPECT_EQ(viewportWidth, document->documentElement()->clientWidth());
@@ -1439,15 +1439,15 @@ TEST_P(ParameterizedWebFrameTest, SetForceZeroLayoutHeightWorksWithWrapContentMo
webViewHelper.initializeAndLoad(m_baseURL + "0-by-0.html", true, nullptr, &client, nullptr, configureAndroid);
webViewHelper.webView()->settings()->setForceZeroLayoutHeight(true);
- PaintLayerCompositor* compositor = webViewHelper.webViewImpl()->compositor();
- EXPECT_EQ(0, webViewHelper.webViewImpl()->mainFrameImpl()->frameView()->layoutSize().width());
- EXPECT_EQ(0, webViewHelper.webViewImpl()->mainFrameImpl()->frameView()->layoutSize().height());
+ 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.0, compositor->containerLayer()->size().width());
EXPECT_EQ(0.0, compositor->containerLayer()->size().height());
webViewHelper.resize(WebSize(viewportWidth, 0));
- EXPECT_EQ(viewportWidth, webViewHelper.webViewImpl()->mainFrameImpl()->frameView()->layoutSize().width());
- EXPECT_EQ(0, webViewHelper.webViewImpl()->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());
@@ -1455,13 +1455,13 @@ TEST_P(ParameterizedWebFrameTest, SetForceZeroLayoutHeightWorksWithWrapContentMo
// height to be ignored by the outer viewport (the container layer of
// LayerCompositor). The height of the visualViewport, however, is not affected.
webViewHelper.resize(WebSize(viewportWidth, viewportHeight));
- EXPECT_FALSE(webViewHelper.webViewImpl()->mainFrameImpl()->frameView()->needsLayout());
- EXPECT_EQ(viewportWidth, webViewHelper.webViewImpl()->mainFrameImpl()->frameView()->layoutSize().width());
- EXPECT_EQ(0, webViewHelper.webViewImpl()->mainFrameImpl()->frameView()->layoutSize().height());
+ 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, compositor->containerLayer()->size().width());
EXPECT_EQ(viewportHeight, compositor->containerLayer()->size().height());
- LocalFrame* frame = webViewHelper.webViewImpl()->mainFrameImpl()->frame();
+ LocalFrame* frame = webViewHelper.webView()->mainFrameImpl()->frame();
VisualViewport& visualViewport = frame->page()->frameHost().visualViewport();
EXPECT_EQ(viewportHeight, visualViewport.containerLayer()->size().height());
EXPECT_TRUE(visualViewport.containerLayer()->platformLayer()->masksToBounds());
@@ -1482,21 +1482,21 @@ TEST_P(ParameterizedWebFrameTest, SetForceZeroLayoutHeight)
webViewHelper.initializeAndLoad(m_baseURL + "200-by-300.html", true, nullptr, &client, nullptr, enableViewportSettings);
webViewHelper.resize(WebSize(viewportWidth, viewportHeight));
- EXPECT_LE(viewportHeight, webViewHelper.webViewImpl()->mainFrameImpl()->frameView()->layoutSize().height());
+ EXPECT_LE(viewportHeight, webViewHelper.webView()->mainFrameImpl()->frameView()->layoutSize().height());
webViewHelper.webView()->settings()->setForceZeroLayoutHeight(true);
- EXPECT_TRUE(webViewHelper.webViewImpl()->mainFrameImpl()->frameView()->needsLayout());
+ EXPECT_TRUE(webViewHelper.webView()->mainFrameImpl()->frameView()->needsLayout());
- EXPECT_EQ(0, webViewHelper.webViewImpl()->mainFrameImpl()->frameView()->layoutSize().height());
+ EXPECT_EQ(0, webViewHelper.webView()->mainFrameImpl()->frameView()->layoutSize().height());
webViewHelper.resize(WebSize(viewportWidth, viewportHeight * 2));
- EXPECT_FALSE(webViewHelper.webViewImpl()->mainFrameImpl()->frameView()->needsLayout());
- EXPECT_EQ(0, webViewHelper.webViewImpl()->mainFrameImpl()->frameView()->layoutSize().height());
+ EXPECT_FALSE(webViewHelper.webView()->mainFrameImpl()->frameView()->needsLayout());
+ EXPECT_EQ(0, webViewHelper.webView()->mainFrameImpl()->frameView()->layoutSize().height());
webViewHelper.resize(WebSize(viewportWidth * 2, viewportHeight));
- EXPECT_EQ(0, webViewHelper.webViewImpl()->mainFrameImpl()->frameView()->layoutSize().height());
+ EXPECT_EQ(0, webViewHelper.webView()->mainFrameImpl()->frameView()->layoutSize().height());
webViewHelper.webView()->settings()->setForceZeroLayoutHeight(false);
- EXPECT_LE(viewportHeight, webViewHelper.webViewImpl()->mainFrameImpl()->frameView()->layoutSize().height());
+ EXPECT_LE(viewportHeight, webViewHelper.webView()->mainFrameImpl()->frameView()->layoutSize().height());
}
TEST_F(WebFrameTest, ToggleViewportMetaOnOff)
@@ -1517,7 +1517,7 @@ TEST_F(WebFrameTest, ToggleViewportMetaOnOff)
settings->setShrinksViewportContentToFit(true);
webViewHelper.resize(WebSize(viewportWidth, viewportHeight));
- Document* document = toLocalFrame(webViewHelper.webViewImpl()->page()->mainFrame())->document();
+ Document* document = toLocalFrame(webViewHelper.webView()->page()->mainFrame())->document();
EXPECT_FALSE(document->viewportDescription().isLegacyViewportType());
settings->setViewportMetaEnabled(true);
@@ -1555,7 +1555,7 @@ TEST_F(WebFrameTest, SetForceZeroLayoutHeightWorksWithRelayoutsWhenHeightChanged
IntPoint hitPoint = IntPoint(30, 30); // button size is 100x100
- WebLocalFrameImpl* frame = toWebLocalFrameImpl(webViewHelper.webView()->mainFrame());
+ WebLocalFrameImpl* frame = webViewHelper.webView()->mainFrameImpl();
Document* document = frame->frame()->document();
Element* element = document->getElementById("tap_button");
@@ -1563,7 +1563,7 @@ TEST_F(WebFrameTest, SetForceZeroLayoutHeightWorksWithRelayoutsWhenHeightChanged
EXPECT_EQ(String("oldValue"), element->innerText());
PlatformGestureEvent gestureEvent(PlatformEvent::EventType::GestureTap, hitPoint, hitPoint, IntSize(0, 0), 0, PlatformEvent::NoModifiers, PlatformGestureSourceTouchscreen);
- webViewHelper.webViewImpl()->mainFrameImpl()->frame()->eventHandler().handleGestureEvent(gestureEvent);
+ webViewHelper.webView()->mainFrameImpl()->frame()->eventHandler().handleGestureEvent(gestureEvent);
// when pressed, the button changes its own text to "updatedValue"
EXPECT_EQ(String("updatedValue"), element->innerText());
}
@@ -1581,18 +1581,18 @@ TEST_F(WebFrameTest, FrameOwnerPropertiesMargin)
WebFrameOwnerProperties properties;
properties.marginWidth = 11;
properties.marginHeight = 22;
- WebLocalFrame* localFrame = FrameTestHelpers::createLocalChild(root, "frameName", nullptr, nullptr, nullptr, properties);
+ WebLocalFrameImpl* localFrame = FrameTestHelpers::createLocalChild(root, "frameName", nullptr, nullptr, nullptr, properties);
registerMockedHttpURLLoad("frame_owner_properties.html");
FrameTestHelpers::loadFrame(localFrame, m_baseURL + "frame_owner_properties.html");
// Check if the LocalFrame has seen the marginwidth and marginheight
// properties.
- Document* childDocument = toWebLocalFrameImpl(localFrame)->frame()->document();
+ Document* childDocument = localFrame->frame()->document();
EXPECT_EQ(11, childDocument->firstBodyElement()->getIntegralAttribute(HTMLNames::marginwidthAttr));
EXPECT_EQ(22, childDocument->firstBodyElement()->getIntegralAttribute(HTMLNames::marginheightAttr));
- FrameView* frameView = toWebLocalFrameImpl(localFrame)->frameView();
+ FrameView* frameView = localFrame->frameView();
// Expect scrollbars to be enabled by default.
EXPECT_NE(nullptr, frameView->horizontalScrollbar());
EXPECT_NE(nullptr, frameView->verticalScrollbar());
@@ -1613,12 +1613,12 @@ TEST_F(WebFrameTest, FrameOwnerPropertiesScrolling)
WebFrameOwnerProperties properties;
// Turn off scrolling in the subframe.
properties.scrollingMode = WebFrameOwnerProperties::ScrollingMode::AlwaysOff;
- WebLocalFrame* localFrame = FrameTestHelpers::createLocalChild(root, "frameName", nullptr, nullptr, nullptr, properties);
+ WebLocalFrameImpl* localFrame = FrameTestHelpers::createLocalChild(root, "frameName", nullptr, nullptr, nullptr, properties);
registerMockedHttpURLLoad("frame_owner_properties.html");
FrameTestHelpers::loadFrame(localFrame, m_baseURL + "frame_owner_properties.html");
- Document* childDocument = toWebLocalFrameImpl(localFrame)->frame()->document();
+ Document* childDocument = localFrame->frame()->document();
EXPECT_EQ(0, childDocument->firstBodyElement()->getIntegralAttribute(HTMLNames::marginwidthAttr));
EXPECT_EQ(0, childDocument->firstBodyElement()->getIntegralAttribute(HTMLNames::marginheightAttr));
@@ -1649,7 +1649,7 @@ TEST_P(ParameterizedWebFrameTest, SetForceZeroLayoutHeightWorksAcrossNavigations
FrameTestHelpers::loadFrame(webViewHelper.webView()->mainFrame(), m_baseURL + "large-div.html");
webViewHelper.webView()->updateAllLifecyclePhases();
- EXPECT_EQ(0, webViewHelper.webViewImpl()->mainFrameImpl()->frameView()->layoutSize().height());
+ EXPECT_EQ(0, webViewHelper.webView()->mainFrameImpl()->frameView()->layoutSize().height());
}
TEST_P(ParameterizedWebFrameTest, SetForceZeroLayoutHeightWithWideViewportQuirk)
@@ -1669,7 +1669,7 @@ TEST_P(ParameterizedWebFrameTest, SetForceZeroLayoutHeightWithWideViewportQuirk)
webViewHelper.webView()->settings()->setForceZeroLayoutHeight(true);
webViewHelper.resize(WebSize(viewportWidth, viewportHeight));
- EXPECT_EQ(0, webViewHelper.webViewImpl()->mainFrameImpl()->frameView()->layoutSize().height());
+ EXPECT_EQ(0, webViewHelper.webView()->mainFrameImpl()->frameView()->layoutSize().height());
}
TEST_P(ParameterizedWebFrameTest, WideViewportAndWideContentWithInitialScale)
@@ -1694,8 +1694,8 @@ TEST_P(ParameterizedWebFrameTest, WideViewportAndWideContentWithInitialScale)
int wideDocumentWidth = 800;
float minimumPageScaleFactor = viewportWidth / (float) wideDocumentWidth;
- EXPECT_EQ(minimumPageScaleFactor, webViewHelper.webViewImpl()->pageScaleFactor());
- EXPECT_EQ(minimumPageScaleFactor, webViewHelper.webViewImpl()->minimumPageScaleFactor());
+ EXPECT_EQ(minimumPageScaleFactor, webViewHelper.webView()->pageScaleFactor());
+ EXPECT_EQ(minimumPageScaleFactor, webViewHelper.webView()->minimumPageScaleFactor());
}
TEST_P(ParameterizedWebFrameTest, WideViewportQuirkClobbersHeight)
@@ -1717,7 +1717,7 @@ TEST_P(ParameterizedWebFrameTest, WideViewportQuirkClobbersHeight)
FrameTestHelpers::loadFrame(webViewHelper.webView()->mainFrame(), m_baseURL + "viewport-height-1000.html");
webViewHelper.resize(WebSize(viewportWidth, viewportHeight));
- EXPECT_EQ(800, webViewHelper.webViewImpl()->mainFrameImpl()->frameView()->layoutSize().height());
+ EXPECT_EQ(800, webViewHelper.webView()->mainFrameImpl()->frameView()->layoutSize().height());
EXPECT_EQ(1, webViewHelper.webView()->pageScaleFactor());
}
@@ -1740,36 +1740,36 @@ TEST_P(ParameterizedWebFrameTest, LayoutSize320Quirk)
FrameTestHelpers::loadFrame(webViewHelper.webView()->mainFrame(), m_baseURL + "viewport/viewport-30.html");
webViewHelper.resize(WebSize(viewportWidth, viewportHeight));
- EXPECT_EQ(600, webViewHelper.webViewImpl()->mainFrameImpl()->frameView()->layoutSize().width());
- EXPECT_EQ(800, webViewHelper.webViewImpl()->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
// respected.
- Document* document = toLocalFrame(webViewHelper.webViewImpl()->page()->mainFrame())->document();
+ Document* document = toLocalFrame(webViewHelper.webView()->page()->mainFrame())->document();
ViewportDescription description = document->viewportDescription();
description.minWidth = Length(321, blink::Fixed);
description.maxWidth = Length(321, blink::Fixed);
document->setViewportDescription(description);
webViewHelper.webView()->updateAllLifecyclePhases();
- EXPECT_EQ(321, webViewHelper.webViewImpl()->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.webViewImpl()->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.webViewImpl()->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.webViewImpl()->mainFrameImpl()->frameView()->layoutSize().height());
+ EXPECT_EQ(800, webViewHelper.webView()->mainFrameImpl()->frameView()->layoutSize().height());
}
TEST_P(ParameterizedWebFrameTest, ZeroValuesQuirk)
@@ -1789,12 +1789,12 @@ TEST_P(ParameterizedWebFrameTest, ZeroValuesQuirk)
FrameTestHelpers::loadFrame(webViewHelper.webView()->mainFrame(), m_baseURL + "viewport-zero-values.html");
webViewHelper.resize(WebSize(viewportWidth, viewportHeight));
- EXPECT_EQ(viewportWidth, webViewHelper.webViewImpl()->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.webViewImpl()->mainFrameImpl()->frameView()->layoutSize().width());
+ EXPECT_EQ(viewportWidth, webViewHelper.webView()->mainFrameImpl()->frameView()->layoutSize().width());
EXPECT_EQ(1.0f, webViewHelper.webView()->pageScaleFactor());
}
@@ -1812,7 +1812,7 @@ TEST_P(ParameterizedWebFrameTest, OverflowHiddenDisablesScrolling)
FrameTestHelpers::loadFrame(webViewHelper.webView()->mainFrame(), m_baseURL + "body-overflow-hidden.html");
webViewHelper.resize(WebSize(viewportWidth, viewportHeight));
- FrameView* view = webViewHelper.webViewImpl()->mainFrameImpl()->frameView();
+ FrameView* view = webViewHelper.webView()->mainFrameImpl()->frameView();
EXPECT_FALSE(view->userInputScrollable(VerticalScrollbar));
EXPECT_FALSE(view->userInputScrollable(HorizontalScrollbar));
}
@@ -1831,11 +1831,11 @@ TEST_P(ParameterizedWebFrameTest, OverflowHiddenDisablesScrollingWithSetCanHaveS
FrameTestHelpers::loadFrame(webViewHelper.webView()->mainFrame(), m_baseURL + "body-overflow-hidden-short.html");
webViewHelper.resize(WebSize(viewportWidth, viewportHeight));
- FrameView* view = webViewHelper.webViewImpl()->mainFrameImpl()->frameView();
+ FrameView* view = webViewHelper.webView()->mainFrameImpl()->frameView();
EXPECT_FALSE(view->userInputScrollable(VerticalScrollbar));
EXPECT_FALSE(view->userInputScrollable(HorizontalScrollbar));
- webViewHelper.webViewImpl()->mainFrameImpl()->setCanHaveScrollbars(true);
+ webViewHelper.webView()->mainFrameImpl()->setCanHaveScrollbars(true);
EXPECT_FALSE(view->userInputScrollable(VerticalScrollbar));
EXPECT_FALSE(view->userInputScrollable(HorizontalScrollbar));
}
@@ -1855,7 +1855,7 @@ TEST_F(WebFrameTest, IgnoreOverflowHiddenQuirk)
FrameTestHelpers::loadFrame(webViewHelper.webView()->mainFrame(), m_baseURL + "body-overflow-hidden.html");
webViewHelper.resize(WebSize(viewportWidth, viewportHeight));
- FrameView* view = webViewHelper.webViewImpl()->mainFrameImpl()->frameView();
+ FrameView* view = webViewHelper.webView()->mainFrameImpl()->frameView();
EXPECT_TRUE(view->userInputScrollable(VerticalScrollbar));
}
@@ -1876,12 +1876,12 @@ TEST_P(ParameterizedWebFrameTest, NonZeroValuesNoQuirk)
FrameTestHelpers::loadFrame(webViewHelper.webView()->mainFrame(), m_baseURL + "viewport-nonzero-values.html");
webViewHelper.resize(WebSize(viewportWidth, viewportHeight));
- EXPECT_EQ(viewportWidth / expectedPageScaleFactor, webViewHelper.webViewImpl()->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.webViewImpl()->mainFrameImpl()->frameView()->layoutSize().width());
+ EXPECT_EQ(viewportWidth / expectedPageScaleFactor, webViewHelper.webView()->mainFrameImpl()->frameView()->layoutSize().width());
EXPECT_EQ(expectedPageScaleFactor, webViewHelper.webView()->pageScaleFactor());
}
@@ -1899,10 +1899,10 @@ TEST_P(ParameterizedWebFrameTest, setPageScaleFactorDoesNotLayout)
webViewHelper.initializeAndLoad(m_baseURL + "fixed_layout.html", true, nullptr, &client, nullptr, enableViewportSettings);
webViewHelper.resize(WebSize(viewportWidth, viewportHeight));
- int prevLayoutCount = webViewHelper.webViewImpl()->mainFrameImpl()->frameView()->layoutCount();
- webViewHelper.webViewImpl()->setPageScaleFactor(3);
- EXPECT_FALSE(webViewHelper.webViewImpl()->mainFrameImpl()->frameView()->needsLayout());
- EXPECT_EQ(prevLayoutCount, webViewHelper.webViewImpl()->mainFrameImpl()->frameView()->layoutCount());
+ int prevLayoutCount = webViewHelper.webView()->mainFrameImpl()->frameView()->layoutCount();
+ webViewHelper.webView()->setPageScaleFactor(3);
+ EXPECT_FALSE(webViewHelper.webView()->mainFrameImpl()->frameView()->needsLayout());
+ EXPECT_EQ(prevLayoutCount, webViewHelper.webView()->mainFrameImpl()->frameView()->layoutCount());
}
TEST_P(ParameterizedWebFrameTest, setPageScaleFactorWithOverlayScrollbarsDoesNotLayout)
@@ -1918,10 +1918,10 @@ TEST_P(ParameterizedWebFrameTest, setPageScaleFactorWithOverlayScrollbarsDoesNot
webViewHelper.initializeAndLoad(m_baseURL + "fixed_layout.html", true, nullptr, &client, nullptr, enableViewportSettings);
webViewHelper.resize(WebSize(viewportWidth, viewportHeight));
- int prevLayoutCount = webViewHelper.webViewImpl()->mainFrameImpl()->frameView()->layoutCount();
- webViewHelper.webViewImpl()->setPageScaleFactor(30);
- EXPECT_FALSE(webViewHelper.webViewImpl()->mainFrameImpl()->frameView()->needsLayout());
- EXPECT_EQ(prevLayoutCount, webViewHelper.webViewImpl()->mainFrameImpl()->frameView()->layoutCount());
+ int prevLayoutCount = webViewHelper.webView()->mainFrameImpl()->frameView()->layoutCount();
+ webViewHelper.webView()->setPageScaleFactor(30);
+ EXPECT_FALSE(webViewHelper.webView()->mainFrameImpl()->frameView()->needsLayout());
+ EXPECT_EQ(prevLayoutCount, webViewHelper.webView()->mainFrameImpl()->frameView()->layoutCount());
}
@@ -1939,7 +1939,7 @@ TEST_P(ParameterizedWebFrameTest, pageScaleFactorWrittenToHistoryItem)
webViewHelper.resize(WebSize(viewportWidth, viewportHeight));
webViewHelper.webView()->setPageScaleFactor(3);
- EXPECT_EQ(3, toLocalFrame(webViewHelper.webViewImpl()->page()->mainFrame())->loader().currentItem()->pageScaleFactor());
+ EXPECT_EQ(3, toLocalFrame(webViewHelper.webView()->page()->mainFrame())->loader().currentItem()->pageScaleFactor());
}
TEST_P(ParameterizedWebFrameTest, initialScaleWrittenToHistoryItem)
@@ -1959,7 +1959,7 @@ TEST_P(ParameterizedWebFrameTest, initialScaleWrittenToHistoryItem)
int defaultFixedLayoutWidth = 980;
float minimumPageScaleFactor = viewportWidth / (float) defaultFixedLayoutWidth;
- EXPECT_EQ(minimumPageScaleFactor, toLocalFrame(webViewHelper.webViewImpl()->page()->mainFrame())->loader().currentItem()->pageScaleFactor());
+ EXPECT_EQ(minimumPageScaleFactor, toLocalFrame(webViewHelper.webView()->page()->mainFrame())->loader().currentItem()->pageScaleFactor());
}
TEST_P(ParameterizedWebFrameTest, pageScaleFactorDoesntShrinkFrameView)
@@ -1976,7 +1976,7 @@ TEST_P(ParameterizedWebFrameTest, pageScaleFactorDoesntShrinkFrameView)
webViewHelper.initializeAndLoad(m_baseURL + "large-div.html", true, nullptr, &client, nullptr, enableViewportSettings);
webViewHelper.resize(WebSize(viewportWidth, viewportHeight));
- FrameView* view = webViewHelper.webViewImpl()->mainFrameImpl()->frameView();
+ FrameView* view = webViewHelper.webView()->mainFrameImpl()->frameView();
int viewportWidthMinusScrollbar = viewportWidth;
int viewportHeightMinusScrollbar = viewportHeight;
@@ -2016,8 +2016,8 @@ TEST_P(ParameterizedWebFrameTest, pageScaleFactorDoesNotApplyCssTransform)
webViewHelper.webView()->setPageScaleFactor(2);
- EXPECT_EQ(980, toLocalFrame(webViewHelper.webViewImpl()->page()->mainFrame())->contentLayoutItem().documentRect().width());
- EXPECT_EQ(980, webViewHelper.webViewImpl()->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)
@@ -2045,8 +2045,8 @@ 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.webViewImpl()->mainFrameImpl()->frameView()->layoutSize().width(), 1.0f);
- EXPECT_NEAR(viewportHeight * densityDpiScaleRatio, webViewHelper.webViewImpl()->mainFrameImpl()->frameView()->layoutSize().height(), 1.0f);
+ EXPECT_NEAR(viewportWidth * densityDpiScaleRatio, webViewHelper.webView()->mainFrameImpl()->frameView()->layoutSize().width(), 1.0f);
+ EXPECT_NEAR(viewportHeight * densityDpiScaleRatio, webViewHelper.webView()->mainFrameImpl()->frameView()->layoutSize().height(), 1.0f);
EXPECT_NEAR(1.0f / densityDpiScaleRatio, webViewHelper.webView()->pageScaleFactor(), 0.01f);
}
}
@@ -2070,8 +2070,8 @@ TEST_P(ParameterizedWebFrameTest, targetDensityDpiDevice)
webViewHelper.webView()->settings()->setSupportDeprecatedTargetDensityDPI(true);
webViewHelper.resize(WebSize(viewportWidth, viewportHeight));
- EXPECT_NEAR(viewportWidth * client.m_screenInfo.deviceScaleFactor, webViewHelper.webViewImpl()->mainFrameImpl()->frameView()->layoutSize().width(), 1.0f);
- EXPECT_NEAR(viewportHeight * client.m_screenInfo.deviceScaleFactor, webViewHelper.webViewImpl()->mainFrameImpl()->frameView()->layoutSize().height(), 1.0f);
+ EXPECT_NEAR(viewportWidth * client.m_screenInfo.deviceScaleFactor, webViewHelper.webView()->mainFrameImpl()->frameView()->layoutSize().width(), 1.0f);
+ EXPECT_NEAR(viewportHeight * client.m_screenInfo.deviceScaleFactor, webViewHelper.webView()->mainFrameImpl()->frameView()->layoutSize().height(), 1.0f);
EXPECT_NEAR(1.0f / client.m_screenInfo.deviceScaleFactor, webViewHelper.webView()->pageScaleFactor(), 0.01f);
}
}
@@ -2096,8 +2096,8 @@ TEST_P(ParameterizedWebFrameTest, targetDensityDpiDeviceAndFixedWidth)
webViewHelper.webView()->settings()->setUseWideViewport(true);
webViewHelper.resize(WebSize(viewportWidth, viewportHeight));
- EXPECT_NEAR(viewportWidth, webViewHelper.webViewImpl()->mainFrameImpl()->frameView()->layoutSize().width(), 1.0f);
- EXPECT_NEAR(viewportHeight, webViewHelper.webViewImpl()->mainFrameImpl()->frameView()->layoutSize().height(), 1.0f);
+ EXPECT_NEAR(viewportWidth, webViewHelper.webView()->mainFrameImpl()->frameView()->layoutSize().width(), 1.0f);
+ EXPECT_NEAR(viewportHeight, webViewHelper.webView()->mainFrameImpl()->frameView()->layoutSize().height(), 1.0f);
EXPECT_NEAR(1.0f, webViewHelper.webView()->pageScaleFactor(), 0.01f);
}
}
@@ -2118,8 +2118,8 @@ TEST_P(ParameterizedWebFrameTest, NoWideViewportAndScaleLessThanOne)
webViewHelper.webView()->settings()->setUseWideViewport(false);
webViewHelper.resize(WebSize(viewportWidth, viewportHeight));
- EXPECT_NEAR(viewportWidth * client.m_screenInfo.deviceScaleFactor, webViewHelper.webViewImpl()->mainFrameImpl()->frameView()->layoutSize().width(), 1.0f);
- EXPECT_NEAR(viewportHeight * client.m_screenInfo.deviceScaleFactor, webViewHelper.webViewImpl()->mainFrameImpl()->frameView()->layoutSize().height(), 1.0f);
+ EXPECT_NEAR(viewportWidth * client.m_screenInfo.deviceScaleFactor, webViewHelper.webView()->mainFrameImpl()->frameView()->layoutSize().width(), 1.0f);
+ EXPECT_NEAR(viewportHeight * client.m_screenInfo.deviceScaleFactor, webViewHelper.webView()->mainFrameImpl()->frameView()->layoutSize().height(), 1.0f);
EXPECT_NEAR(1.0f / client.m_screenInfo.deviceScaleFactor, webViewHelper.webView()->pageScaleFactor(), 0.01f);
}
@@ -2140,8 +2140,8 @@ TEST_P(ParameterizedWebFrameTest, NoWideViewportAndScaleLessThanOneWithDeviceWid
webViewHelper.resize(WebSize(viewportWidth, viewportHeight));
const float pageZoom = 0.25f;
- EXPECT_NEAR(viewportWidth * client.m_screenInfo.deviceScaleFactor / pageZoom, webViewHelper.webViewImpl()->mainFrameImpl()->frameView()->layoutSize().width(), 1.0f);
- EXPECT_NEAR(viewportHeight * client.m_screenInfo.deviceScaleFactor / pageZoom, webViewHelper.webViewImpl()->mainFrameImpl()->frameView()->layoutSize().height(), 1.0f);
+ EXPECT_NEAR(viewportWidth * client.m_screenInfo.deviceScaleFactor / pageZoom, webViewHelper.webView()->mainFrameImpl()->frameView()->layoutSize().width(), 1.0f);
+ EXPECT_NEAR(viewportHeight * client.m_screenInfo.deviceScaleFactor / pageZoom, webViewHelper.webView()->mainFrameImpl()->frameView()->layoutSize().height(), 1.0f);
EXPECT_NEAR(1.0f / client.m_screenInfo.deviceScaleFactor, webViewHelper.webView()->pageScaleFactor(), 0.01f);
}
@@ -2162,8 +2162,8 @@ TEST_P(ParameterizedWebFrameTest, NoWideViewportAndNoViewportWithInitialPageScal
webViewHelper.webView()->setInitialPageScaleOverride(enforcedPageScaleFactor);
webViewHelper.resize(WebSize(viewportWidth, viewportHeight));
- EXPECT_NEAR(viewportWidth / enforcedPageScaleFactor, webViewHelper.webViewImpl()->mainFrameImpl()->frameView()->layoutSize().width(), 1.0f);
- EXPECT_NEAR(viewportHeight / enforcedPageScaleFactor, webViewHelper.webViewImpl()->mainFrameImpl()->frameView()->layoutSize().height(), 1.0f);
+ EXPECT_NEAR(viewportWidth / enforcedPageScaleFactor, webViewHelper.webView()->mainFrameImpl()->frameView()->layoutSize().width(), 1.0f);
+ EXPECT_NEAR(viewportHeight / enforcedPageScaleFactor, webViewHelper.webView()->mainFrameImpl()->frameView()->layoutSize().height(), 1.0f);
EXPECT_NEAR(enforcedPageScaleFactor, webViewHelper.webView()->pageScaleFactor(), 0.01f);
}
@@ -2180,8 +2180,8 @@ TEST_P(ParameterizedWebFrameTest, NoUserScalableQuirkIgnoresViewportScale)
webViewHelper.webView()->settings()->setViewportMetaNonUserScalableQuirk(true);
webViewHelper.resize(WebSize(viewportWidth, viewportHeight));
- EXPECT_NEAR(viewportWidth, webViewHelper.webViewImpl()->mainFrameImpl()->frameView()->layoutSize().width(), 1.0f);
- EXPECT_NEAR(viewportHeight, webViewHelper.webViewImpl()->mainFrameImpl()->frameView()->layoutSize().height(), 1.0f);
+ EXPECT_NEAR(viewportWidth, webViewHelper.webView()->mainFrameImpl()->frameView()->layoutSize().width(), 1.0f);
+ EXPECT_NEAR(viewportHeight, webViewHelper.webView()->mainFrameImpl()->frameView()->layoutSize().height(), 1.0f);
EXPECT_NEAR(1.0f, webViewHelper.webView()->pageScaleFactor(), 0.01f);
}
@@ -2202,8 +2202,8 @@ TEST_P(ParameterizedWebFrameTest, NoUserScalableQuirkIgnoresViewportScaleForNonW
webViewHelper.webView()->settings()->setUseWideViewport(false);
webViewHelper.resize(WebSize(viewportWidth, viewportHeight));
- EXPECT_NEAR(viewportWidth * client.m_screenInfo.deviceScaleFactor, webViewHelper.webViewImpl()->mainFrameImpl()->frameView()->layoutSize().width(), 1.0f);
- EXPECT_NEAR(viewportHeight * client.m_screenInfo.deviceScaleFactor, webViewHelper.webViewImpl()->mainFrameImpl()->frameView()->layoutSize().height(), 1.0f);
+ EXPECT_NEAR(viewportWidth * client.m_screenInfo.deviceScaleFactor, webViewHelper.webView()->mainFrameImpl()->frameView()->layoutSize().width(), 1.0f);
+ EXPECT_NEAR(viewportHeight * client.m_screenInfo.deviceScaleFactor, webViewHelper.webView()->mainFrameImpl()->frameView()->layoutSize().height(), 1.0f);
EXPECT_NEAR(1.0f / client.m_screenInfo.deviceScaleFactor, webViewHelper.webView()->pageScaleFactor(), 0.01f);
}
@@ -2222,8 +2222,8 @@ TEST_P(ParameterizedWebFrameTest, NoUserScalableQuirkIgnoresViewportScaleForWide
webViewHelper.webView()->settings()->setUseWideViewport(true);
webViewHelper.resize(WebSize(viewportWidth, viewportHeight));
- EXPECT_NEAR(viewportWidth, webViewHelper.webViewImpl()->mainFrameImpl()->frameView()->layoutSize().width(), 1.0f);
- EXPECT_NEAR(viewportHeight, webViewHelper.webViewImpl()->mainFrameImpl()->frameView()->layoutSize().height(), 1.0f);
+ EXPECT_NEAR(viewportWidth, webViewHelper.webView()->mainFrameImpl()->frameView()->layoutSize().width(), 1.0f);
+ EXPECT_NEAR(viewportHeight, webViewHelper.webView()->mainFrameImpl()->frameView()->layoutSize().height(), 1.0f);
EXPECT_NEAR(1.0f, webViewHelper.webView()->pageScaleFactor(), 0.01f);
}
@@ -2242,9 +2242,9 @@ TEST_P(ParameterizedWebFrameTest, DesktopPageCanBeZoomedInWhenWideViewportIsTurn
webViewHelper.webView()->settings()->setUseWideViewport(false);
webViewHelper.resize(WebSize(viewportWidth, viewportHeight));
- EXPECT_NEAR(1.0f, webViewHelper.webViewImpl()->pageScaleFactor(), 0.01f);
- EXPECT_NEAR(1.0f, webViewHelper.webViewImpl()->minimumPageScaleFactor(), 0.01f);
- EXPECT_NEAR(5.0f, webViewHelper.webViewImpl()->maximumPageScaleFactor(), 0.01f);
+ EXPECT_NEAR(1.0f, webViewHelper.webView()->pageScaleFactor(), 0.01f);
+ EXPECT_NEAR(1.0f, webViewHelper.webView()->minimumPageScaleFactor(), 0.01f);
+ EXPECT_NEAR(5.0f, webViewHelper.webView()->maximumPageScaleFactor(), 0.01f);
}
class WebFrameResizeTest : public ParameterizedWebFrameTest {
@@ -2268,33 +2268,33 @@ protected:
FrameTestHelpers::WebViewHelper webViewHelper(this);
webViewHelper.initializeAndLoad(m_baseURL + url, true, nullptr, nullptr, nullptr, enableViewportSettings);
- webViewHelper.webViewImpl()->setDefaultPageScaleLimits(0.25f, 5);
+ webViewHelper.webView()->setDefaultPageScaleLimits(0.25f, 5);
// Origin scrollOffsets preserved under resize.
{
webViewHelper.resize(WebSize(viewportSize.width, viewportSize.height));
- webViewHelper.webViewImpl()->setPageScaleFactor(initialPageScaleFactor);
- ASSERT_EQ(viewportSize, webViewHelper.webViewImpl()->size());
- ASSERT_EQ(initialPageScaleFactor, webViewHelper.webViewImpl()->pageScaleFactor());
+ webViewHelper.webView()->setPageScaleFactor(initialPageScaleFactor);
+ ASSERT_EQ(viewportSize, webViewHelper.webView()->size());
+ ASSERT_EQ(initialPageScaleFactor, webViewHelper.webView()->pageScaleFactor());
webViewHelper.resize(WebSize(viewportSize.height, viewportSize.width));
float expectedPageScaleFactor = initialPageScaleFactor * (shouldScaleRelativeToViewportWidth ? 1 / aspectRatio : 1);
- EXPECT_NEAR(expectedPageScaleFactor, webViewHelper.webViewImpl()->pageScaleFactor(), 0.05f);
- EXPECT_EQ(WebSize(), webViewHelper.webViewImpl()->mainFrame()->scrollOffset());
+ EXPECT_NEAR(expectedPageScaleFactor, webViewHelper.webView()->pageScaleFactor(), 0.05f);
+ EXPECT_EQ(WebSize(), webViewHelper.webView()->mainFrame()->scrollOffset());
}
// Resizing just the height should not affect pageScaleFactor or scrollOffset.
{
webViewHelper.resize(WebSize(viewportSize.width, viewportSize.height));
- webViewHelper.webViewImpl()->setPageScaleFactor(initialPageScaleFactor);
- webViewHelper.webViewImpl()->mainFrame()->setScrollOffset(scrollOffset);
- webViewHelper.webViewImpl()->updateAllLifecyclePhases();
- const WebSize expectedScrollOffset = webViewHelper.webViewImpl()->mainFrame()->scrollOffset();
+ webViewHelper.webView()->setPageScaleFactor(initialPageScaleFactor);
+ webViewHelper.webView()->mainFrame()->setScrollOffset(scrollOffset);
+ webViewHelper.webView()->updateAllLifecyclePhases();
+ const WebSize expectedScrollOffset = webViewHelper.webView()->mainFrame()->scrollOffset();
webViewHelper.resize(WebSize(viewportSize.width, viewportSize.height * 0.8f));
- EXPECT_EQ(initialPageScaleFactor, webViewHelper.webViewImpl()->pageScaleFactor());
- EXPECT_EQ(expectedScrollOffset, webViewHelper.webViewImpl()->mainFrame()->scrollOffset());
+ EXPECT_EQ(initialPageScaleFactor, webViewHelper.webView()->pageScaleFactor());
+ EXPECT_EQ(expectedScrollOffset, webViewHelper.webView()->mainFrame()->scrollOffset());
webViewHelper.resize(WebSize(viewportSize.width, viewportSize.height * 0.8f));
- EXPECT_EQ(initialPageScaleFactor, webViewHelper.webViewImpl()->pageScaleFactor());
- EXPECT_EQ(expectedScrollOffset, webViewHelper.webViewImpl()->mainFrame()->scrollOffset());
+ EXPECT_EQ(initialPageScaleFactor, webViewHelper.webView()->pageScaleFactor());
+ EXPECT_EQ(expectedScrollOffset, webViewHelper.webView()->mainFrame()->scrollOffset());
}
}
};
@@ -2372,7 +2372,7 @@ TEST_P(ParameterizedWebFrameTest, pageScaleFactorUpdatesScrollbars)
webViewHelper.initializeAndLoad(m_baseURL + "fixed_layout.html", true, nullptr, &client, nullptr, enableViewportSettings);
webViewHelper.resize(WebSize(viewportWidth, viewportHeight));
- FrameView* view = webViewHelper.webViewImpl()->mainFrameImpl()->frameView();
+ FrameView* view = webViewHelper.webView()->mainFrameImpl()->frameView();
EXPECT_EQ(view->scrollSize(HorizontalScrollbar), view->contentsSize().width() - view->visibleContentRect().width());
EXPECT_EQ(view->scrollSize(VerticalScrollbar), view->contentsSize().height() - view->visibleContentRect().height());
@@ -2396,20 +2396,20 @@ TEST_P(ParameterizedWebFrameTest, CanOverrideScaleLimits)
webViewHelper.webView()->setDefaultPageScaleLimits(0.25f, 5);
webViewHelper.resize(WebSize(viewportWidth, viewportHeight));
- EXPECT_EQ(2.0f, webViewHelper.webViewImpl()->minimumPageScaleFactor());
- EXPECT_EQ(2.0f, webViewHelper.webViewImpl()->maximumPageScaleFactor());
+ EXPECT_EQ(2.0f, webViewHelper.webView()->minimumPageScaleFactor());
+ EXPECT_EQ(2.0f, webViewHelper.webView()->maximumPageScaleFactor());
webViewHelper.webView()->setIgnoreViewportTagScaleLimits(true);
webViewHelper.webView()->updateAllLifecyclePhases();
- EXPECT_EQ(1.0f, webViewHelper.webViewImpl()->minimumPageScaleFactor());
- EXPECT_EQ(5.0f, webViewHelper.webViewImpl()->maximumPageScaleFactor());
+ EXPECT_EQ(1.0f, webViewHelper.webView()->minimumPageScaleFactor());
+ EXPECT_EQ(5.0f, webViewHelper.webView()->maximumPageScaleFactor());
webViewHelper.webView()->setIgnoreViewportTagScaleLimits(false);
webViewHelper.webView()->updateAllLifecyclePhases();
- EXPECT_EQ(2.0f, webViewHelper.webViewImpl()->minimumPageScaleFactor());
- EXPECT_EQ(2.0f, webViewHelper.webViewImpl()->maximumPageScaleFactor());
+ EXPECT_EQ(2.0f, webViewHelper.webView()->minimumPageScaleFactor());
+ EXPECT_EQ(2.0f, webViewHelper.webView()->maximumPageScaleFactor());
}
// Android doesn't have scrollbars on the main FrameView
@@ -2431,7 +2431,7 @@ TEST_F(WebFrameTest, updateOverlayScrollbarLayers)
webViewHelper.resize(WebSize(viewWidth, viewHeight));
FrameTestHelpers::loadFrame(webViewHelper.webView()->mainFrame(), m_baseURL + "large-div.html");
- FrameView* view = webViewHelper.webViewImpl()->mainFrameImpl()->frameView();
+ FrameView* view = webViewHelper.webView()->mainFrameImpl()->frameView();
EXPECT_TRUE(view->layoutViewItem().compositor()->layerForHorizontalScrollbar());
EXPECT_TRUE(view->layoutViewItem().compositor()->layerForVerticalScrollbar());
@@ -2490,30 +2490,30 @@ TEST_P(ParameterizedWebFrameTest, DivAutoZoomParamsTest)
float scale;
WebPoint scroll;
- float doubleTapZoomAlreadyLegibleScale = webViewHelper.webViewImpl()->minimumPageScaleFactor() * doubleTapZoomAlreadyLegibleRatio;
+ float doubleTapZoomAlreadyLegibleScale = webViewHelper.webView()->minimumPageScaleFactor() * doubleTapZoomAlreadyLegibleRatio;
// Test double-tap zooming into wide div.
- WebRect wideBlockBound = webViewHelper.webViewImpl()->computeBlockBound(doubleTapPointWide, false);
- webViewHelper.webViewImpl()->computeScaleAndScrollForBlockRect(WebPoint(doubleTapPointWide.x, doubleTapPointWide.y), wideBlockBound, touchPointPadding, doubleTapZoomAlreadyLegibleScale, scale, scroll);
+ WebRect wideBlockBound = webViewHelper.webView()->computeBlockBound(doubleTapPointWide, false);
+ webViewHelper.webView()->computeScaleAndScrollForBlockRect(WebPoint(doubleTapPointWide.x, doubleTapPointWide.y), wideBlockBound, touchPointPadding, doubleTapZoomAlreadyLegibleScale, scale, scroll);
// The div should horizontally fill the screen (modulo margins), and
// vertically centered (modulo integer rounding).
EXPECT_NEAR(viewportWidth / (float) wideDiv.width, scale, 0.1);
EXPECT_NEAR(wideDiv.x, scroll.x, 20);
EXPECT_EQ(0, scroll.y);
- setScaleAndScrollAndLayout(webViewHelper.webViewImpl(), scroll, scale);
+ setScaleAndScrollAndLayout(webViewHelper.webView(), scroll, scale);
// Test zoom out back to minimum scale.
- wideBlockBound = webViewHelper.webViewImpl()->computeBlockBound(doubleTapPointWide, false);
- webViewHelper.webViewImpl()->computeScaleAndScrollForBlockRect(WebPoint(doubleTapPointWide.x, doubleTapPointWide.y), wideBlockBound, touchPointPadding, doubleTapZoomAlreadyLegibleScale, scale, scroll);
+ wideBlockBound = webViewHelper.webView()->computeBlockBound(doubleTapPointWide, false);
+ webViewHelper.webView()->computeScaleAndScrollForBlockRect(WebPoint(doubleTapPointWide.x, doubleTapPointWide.y), wideBlockBound, touchPointPadding, doubleTapZoomAlreadyLegibleScale, scale, scroll);
// FIXME: Looks like we are missing EXPECTs here.
- scale = webViewHelper.webViewImpl()->minimumPageScaleFactor();
- setScaleAndScrollAndLayout(webViewHelper.webViewImpl(), WebPoint(0, 0), scale);
+ scale = webViewHelper.webView()->minimumPageScaleFactor();
+ setScaleAndScrollAndLayout(webViewHelper.webView(), WebPoint(0, 0), scale);
// Test double-tap zooming into tall div.
- WebRect tallBlockBound = webViewHelper.webViewImpl()->computeBlockBound(doubleTapPointTall, false);
- webViewHelper.webViewImpl()->computeScaleAndScrollForBlockRect(WebPoint(doubleTapPointTall.x, doubleTapPointTall.y), tallBlockBound, touchPointPadding, doubleTapZoomAlreadyLegibleScale, scale, scroll);
+ WebRect tallBlockBound = webViewHelper.webView()->computeBlockBound(doubleTapPointTall, false);
+ webViewHelper.webView()->computeScaleAndScrollForBlockRect(WebPoint(doubleTapPointTall.x, doubleTapPointTall.y), tallBlockBound, touchPointPadding, doubleTapZoomAlreadyLegibleScale, scale, scroll);
// The div should start at the top left of the viewport.
EXPECT_NEAR(viewportWidth / (float) tallDiv.width, scale, 0.1);
EXPECT_NEAR(tallDiv.x, scroll.x, 20);
@@ -2535,19 +2535,19 @@ TEST_P(ParameterizedWebFrameTest, DivAutoZoomWideDivTest)
webViewHelper.webView()->setPageScaleFactor(1.0f);
webViewHelper.webView()->updateAllLifecyclePhases();
- webViewHelper.webViewImpl()->enableFakePageScaleAnimationForTesting(true);
+ webViewHelper.webView()->enableFakePageScaleAnimationForTesting(true);
- float doubleTapZoomAlreadyLegibleScale = webViewHelper.webViewImpl()->minimumPageScaleFactor() * doubleTapZoomAlreadyLegibleRatio;
+ float doubleTapZoomAlreadyLegibleScale = webViewHelper.webView()->minimumPageScaleFactor() * doubleTapZoomAlreadyLegibleRatio;
WebRect div(0, 100, viewportWidth, 150);
WebPoint point(div.x + 50, div.y + 50);
float scale;
- setScaleAndScrollAndLayout(webViewHelper.webViewImpl(), WebPoint(0, 0), (webViewHelper.webViewImpl()->minimumPageScaleFactor()) * (1 + doubleTapZoomAlreadyLegibleRatio) / 2);
+ setScaleAndScrollAndLayout(webViewHelper.webView(), WebPoint(0, 0), (webViewHelper.webView()->minimumPageScaleFactor()) * (1 + doubleTapZoomAlreadyLegibleRatio) / 2);
- simulateDoubleTap(webViewHelper.webViewImpl(), point, scale);
+ simulateDoubleTap(webViewHelper.webView(), point, scale);
EXPECT_FLOAT_EQ(doubleTapZoomAlreadyLegibleScale, scale);
- simulateDoubleTap(webViewHelper.webViewImpl(), point, scale);
- EXPECT_FLOAT_EQ(webViewHelper.webViewImpl()->minimumPageScaleFactor(), scale);
+ simulateDoubleTap(webViewHelper.webView(), point, scale);
+ EXPECT_FLOAT_EQ(webViewHelper.webView()->minimumPageScaleFactor(), scale);
}
TEST_P(ParameterizedWebFrameTest, DivAutoZoomVeryTallTest)
@@ -2572,8 +2572,8 @@ TEST_P(ParameterizedWebFrameTest, DivAutoZoomVeryTallTest)
float scale;
WebPoint scroll;
- WebRect blockBound = webViewHelper.webViewImpl()->computeBlockBound(point, true);
- webViewHelper.webViewImpl()->computeScaleAndScrollForBlockRect(point, blockBound, 0, 1.0f, scale, scroll);
+ WebRect blockBound = webViewHelper.webView()->computeBlockBound(point, true);
+ webViewHelper.webView()->computeScaleAndScrollForBlockRect(point, blockBound, 0, 1.0f, scale, scroll);
EXPECT_EQ(scale, 1.0f);
EXPECT_EQ(scroll.y, 2660);
}
@@ -2595,37 +2595,37 @@ TEST_F(WebFrameTest, DivAutoZoomMultipleDivsTest)
webViewHelper.webView()->setMaximumLegibleScale(1.f);
webViewHelper.webView()->updateAllLifecyclePhases();
- webViewHelper.webViewImpl()->enableFakePageScaleAnimationForTesting(true);
+ webViewHelper.webView()->enableFakePageScaleAnimationForTesting(true);
WebRect topDiv(200, 100, 200, 150);
WebRect bottomDiv(200, 300, 200, 150);
WebPoint topPoint(topDiv.x + 50, topDiv.y + 50);
WebPoint bottomPoint(bottomDiv.x + 50, bottomDiv.y + 50);
float scale;
- setScaleAndScrollAndLayout(webViewHelper.webViewImpl(), WebPoint(0, 0), (webViewHelper.webViewImpl()->minimumPageScaleFactor()) * (1 + doubleTapZoomAlreadyLegibleRatio) / 2);
+ setScaleAndScrollAndLayout(webViewHelper.webView(), WebPoint(0, 0), (webViewHelper.webView()->minimumPageScaleFactor()) * (1 + doubleTapZoomAlreadyLegibleRatio) / 2);
// Test double tap on two different divs
// After first zoom, we should go back to minimum page scale with a second double tap.
- simulateDoubleTap(webViewHelper.webViewImpl(), topPoint, scale);
+ simulateDoubleTap(webViewHelper.webView(), topPoint, scale);
EXPECT_FLOAT_EQ(1, scale);
- simulateDoubleTap(webViewHelper.webViewImpl(), bottomPoint, scale);
- EXPECT_FLOAT_EQ(webViewHelper.webViewImpl()->minimumPageScaleFactor(), scale);
+ simulateDoubleTap(webViewHelper.webView(), bottomPoint, scale);
+ EXPECT_FLOAT_EQ(webViewHelper.webView()->minimumPageScaleFactor(), scale);
// If the user pinch zooms after double tap, a second double tap should zoom back to the div.
- simulateDoubleTap(webViewHelper.webViewImpl(), topPoint, scale);
+ simulateDoubleTap(webViewHelper.webView(), topPoint, scale);
EXPECT_FLOAT_EQ(1, scale);
- webViewHelper.webViewImpl()->applyViewportDeltas(WebFloatSize(), WebFloatSize(), WebFloatSize(), 0.6f, 0);
- simulateDoubleTap(webViewHelper.webViewImpl(), bottomPoint, scale);
+ webViewHelper.webView()->applyViewportDeltas(WebFloatSize(), WebFloatSize(), WebFloatSize(), 0.6f, 0);
+ simulateDoubleTap(webViewHelper.webView(), bottomPoint, scale);
EXPECT_FLOAT_EQ(1, scale);
- simulateDoubleTap(webViewHelper.webViewImpl(), bottomPoint, scale);
- EXPECT_FLOAT_EQ(webViewHelper.webViewImpl()->minimumPageScaleFactor(), scale);
+ simulateDoubleTap(webViewHelper.webView(), bottomPoint, scale);
+ EXPECT_FLOAT_EQ(webViewHelper.webView()->minimumPageScaleFactor(), scale);
// If we didn't yet get an auto-zoom update and a second double-tap arrives, should go back to minimum scale.
- webViewHelper.webViewImpl()->applyViewportDeltas(WebFloatSize(), WebFloatSize(), WebFloatSize(), 1.1f, 0);
- webViewHelper.webViewImpl()->animateDoubleTapZoom(topPoint);
- EXPECT_TRUE(webViewHelper.webViewImpl()->fakeDoubleTapAnimationPendingForTesting());
- simulateDoubleTap(webViewHelper.webViewImpl(), bottomPoint, scale);
- EXPECT_FLOAT_EQ(webViewHelper.webViewImpl()->minimumPageScaleFactor(), scale);
+ webViewHelper.webView()->applyViewportDeltas(WebFloatSize(), WebFloatSize(), WebFloatSize(), 1.1f, 0);
+ webViewHelper.webView()->animateDoubleTapZoom(topPoint);
+ EXPECT_TRUE(webViewHelper.webView()->fakeDoubleTapAnimationPendingForTesting());
+ simulateDoubleTap(webViewHelper.webView(), bottomPoint, scale);
+ EXPECT_FLOAT_EQ(webViewHelper.webView()->minimumPageScaleFactor(), scale);
}
TEST_F(WebFrameTest, DivAutoZoomScaleBoundsTest)
@@ -2642,7 +2642,7 @@ TEST_F(WebFrameTest, DivAutoZoomScaleBoundsTest)
webViewHelper.webView()->setMaximumLegibleScale(1.f);
webViewHelper.webView()->updateAllLifecyclePhases();
- webViewHelper.webViewImpl()->enableFakePageScaleAnimationForTesting(true);
+ webViewHelper.webView()->enableFakePageScaleAnimationForTesting(true);
WebRect div(200, 100, 200, 150);
WebPoint doubleTapPoint(div.x + 50, div.y + 50);
@@ -2652,41 +2652,41 @@ TEST_F(WebFrameTest, DivAutoZoomScaleBoundsTest)
// minimumPageScale < doubleTapZoomAlreadyLegibleScale < 1
webViewHelper.webView()->setDefaultPageScaleLimits(0.5f, 4);
webViewHelper.webView()->updateAllLifecyclePhases();
- float doubleTapZoomAlreadyLegibleScale = webViewHelper.webViewImpl()->minimumPageScaleFactor() * doubleTapZoomAlreadyLegibleRatio;
- setScaleAndScrollAndLayout(webViewHelper.webViewImpl(), WebPoint(0, 0), (webViewHelper.webViewImpl()->minimumPageScaleFactor()) * (1 + doubleTapZoomAlreadyLegibleRatio) / 2);
- simulateDoubleTap(webViewHelper.webViewImpl(), doubleTapPoint, scale);
+ float doubleTapZoomAlreadyLegibleScale = webViewHelper.webView()->minimumPageScaleFactor() * doubleTapZoomAlreadyLegibleRatio;
+ setScaleAndScrollAndLayout(webViewHelper.webView(), WebPoint(0, 0), (webViewHelper.webView()->minimumPageScaleFactor()) * (1 + doubleTapZoomAlreadyLegibleRatio) / 2);
+ simulateDoubleTap(webViewHelper.webView(), doubleTapPoint, scale);
EXPECT_FLOAT_EQ(1, scale);
- simulateDoubleTap(webViewHelper.webViewImpl(), doubleTapPoint, scale);
- EXPECT_FLOAT_EQ(webViewHelper.webViewImpl()->minimumPageScaleFactor(), scale);
- simulateDoubleTap(webViewHelper.webViewImpl(), doubleTapPoint, scale);
+ simulateDoubleTap(webViewHelper.webView(), doubleTapPoint, scale);
+ EXPECT_FLOAT_EQ(webViewHelper.webView()->minimumPageScaleFactor(), scale);
+ simulateDoubleTap(webViewHelper.webView(), doubleTapPoint, scale);
EXPECT_FLOAT_EQ(1, scale);
// Zoom in to reset double_tap_zoom_in_effect flag.
- webViewHelper.webViewImpl()->applyViewportDeltas(WebFloatSize(), WebFloatSize(), WebFloatSize(), 1.1f, 0);
+ webViewHelper.webView()->applyViewportDeltas(WebFloatSize(), WebFloatSize(), WebFloatSize(), 1.1f, 0);
// 1 < minimumPageScale < doubleTapZoomAlreadyLegibleScale
webViewHelper.webView()->setDefaultPageScaleLimits(1.1f, 4);
webViewHelper.webView()->updateAllLifecyclePhases();
- doubleTapZoomAlreadyLegibleScale = webViewHelper.webViewImpl()->minimumPageScaleFactor() * doubleTapZoomAlreadyLegibleRatio;
- setScaleAndScrollAndLayout(webViewHelper.webViewImpl(), WebPoint(0, 0), (webViewHelper.webViewImpl()->minimumPageScaleFactor()) * (1 + doubleTapZoomAlreadyLegibleRatio) / 2);
- simulateDoubleTap(webViewHelper.webViewImpl(), doubleTapPoint, scale);
+ doubleTapZoomAlreadyLegibleScale = webViewHelper.webView()->minimumPageScaleFactor() * doubleTapZoomAlreadyLegibleRatio;
+ setScaleAndScrollAndLayout(webViewHelper.webView(), WebPoint(0, 0), (webViewHelper.webView()->minimumPageScaleFactor()) * (1 + doubleTapZoomAlreadyLegibleRatio) / 2);
+ simulateDoubleTap(webViewHelper.webView(), doubleTapPoint, scale);
EXPECT_FLOAT_EQ(doubleTapZoomAlreadyLegibleScale, scale);
- simulateDoubleTap(webViewHelper.webViewImpl(), doubleTapPoint, scale);
- EXPECT_FLOAT_EQ(webViewHelper.webViewImpl()->minimumPageScaleFactor(), scale);
- simulateDoubleTap(webViewHelper.webViewImpl(), doubleTapPoint, scale);
+ simulateDoubleTap(webViewHelper.webView(), doubleTapPoint, scale);
+ EXPECT_FLOAT_EQ(webViewHelper.webView()->minimumPageScaleFactor(), scale);
+ simulateDoubleTap(webViewHelper.webView(), doubleTapPoint, scale);
EXPECT_FLOAT_EQ(doubleTapZoomAlreadyLegibleScale, scale);
// Zoom in to reset double_tap_zoom_in_effect flag.
- webViewHelper.webViewImpl()->applyViewportDeltas(WebFloatSize(), WebFloatSize(), WebFloatSize(), 1.1f, 0);
+ webViewHelper.webView()->applyViewportDeltas(WebFloatSize(), WebFloatSize(), WebFloatSize(), 1.1f, 0);
// minimumPageScale < 1 < doubleTapZoomAlreadyLegibleScale
webViewHelper.webView()->setDefaultPageScaleLimits(0.95f, 4);
webViewHelper.webView()->updateAllLifecyclePhases();
- doubleTapZoomAlreadyLegibleScale = webViewHelper.webViewImpl()->minimumPageScaleFactor() * doubleTapZoomAlreadyLegibleRatio;
- setScaleAndScrollAndLayout(webViewHelper.webViewImpl(), WebPoint(0, 0), (webViewHelper.webViewImpl()->minimumPageScaleFactor()) * (1 + doubleTapZoomAlreadyLegibleRatio) / 2);
- simulateDoubleTap(webViewHelper.webViewImpl(), doubleTapPoint, scale);
+ doubleTapZoomAlreadyLegibleScale = webViewHelper.webView()->minimumPageScaleFactor() * doubleTapZoomAlreadyLegibleRatio;
+ setScaleAndScrollAndLayout(webViewHelper.webView(), WebPoint(0, 0), (webViewHelper.webView()->minimumPageScaleFactor()) * (1 + doubleTapZoomAlreadyLegibleRatio) / 2);
+ simulateDoubleTap(webViewHelper.webView(), doubleTapPoint, scale);
EXPECT_FLOAT_EQ(doubleTapZoomAlreadyLegibleScale, scale);
- simulateDoubleTap(webViewHelper.webViewImpl(), doubleTapPoint, scale);
- EXPECT_FLOAT_EQ(webViewHelper.webViewImpl()->minimumPageScaleFactor(), scale);
- simulateDoubleTap(webViewHelper.webViewImpl(), doubleTapPoint, scale);
+ simulateDoubleTap(webViewHelper.webView(), doubleTapPoint, scale);
+ EXPECT_FLOAT_EQ(webViewHelper.webView()->minimumPageScaleFactor(), scale);
+ simulateDoubleTap(webViewHelper.webView(), doubleTapPoint, scale);
EXPECT_FLOAT_EQ(doubleTapZoomAlreadyLegibleScale, scale);
}
@@ -2704,8 +2704,8 @@ TEST_F(WebFrameTest, DivAutoZoomScaleLegibleScaleTest)
webViewHelper.webView()->setMaximumLegibleScale(maximumLegibleScaleFactor);
webViewHelper.webView()->updateAllLifecyclePhases();
- webViewHelper.webViewImpl()->enableFakePageScaleAnimationForTesting(true);
- webViewHelper.webViewImpl()->page()->settings().setTextAutosizingEnabled(true);
+ webViewHelper.webView()->enableFakePageScaleAnimationForTesting(true);
+ webViewHelper.webView()->page()->settings().setTextAutosizingEnabled(true);
WebRect div(200, 100, 200, 150);
WebPoint doubleTapPoint(div.x + 50, div.y + 50);
@@ -2714,57 +2714,57 @@ TEST_F(WebFrameTest, DivAutoZoomScaleLegibleScaleTest)
// Test double tap scale bounds.
// minimumPageScale < doubleTapZoomAlreadyLegibleScale < 1 < maximumLegibleScaleFactor
float legibleScale = maximumLegibleScaleFactor;
- setScaleAndScrollAndLayout(webViewHelper.webViewImpl(), WebPoint(0, 0), (webViewHelper.webViewImpl()->minimumPageScaleFactor()) * (1 + doubleTapZoomAlreadyLegibleRatio) / 2);
- float doubleTapZoomAlreadyLegibleScale = webViewHelper.webViewImpl()->minimumPageScaleFactor() * doubleTapZoomAlreadyLegibleRatio;
+ setScaleAndScrollAndLayout(webViewHelper.webView(), WebPoint(0, 0), (webViewHelper.webView()->minimumPageScaleFactor()) * (1 + doubleTapZoomAlreadyLegibleRatio) / 2);
+ float doubleTapZoomAlreadyLegibleScale = webViewHelper.webView()->minimumPageScaleFactor() * doubleTapZoomAlreadyLegibleRatio;
webViewHelper.webView()->setDefaultPageScaleLimits(0.5f, 4);
webViewHelper.webView()->updateAllLifecyclePhases();
- simulateDoubleTap(webViewHelper.webViewImpl(), doubleTapPoint, scale);
+ simulateDoubleTap(webViewHelper.webView(), doubleTapPoint, scale);
EXPECT_FLOAT_EQ(legibleScale, scale);
- simulateDoubleTap(webViewHelper.webViewImpl(), doubleTapPoint, scale);
- EXPECT_FLOAT_EQ(webViewHelper.webViewImpl()->minimumPageScaleFactor(), scale);
- simulateDoubleTap(webViewHelper.webViewImpl(), doubleTapPoint, scale);
+ simulateDoubleTap(webViewHelper.webView(), doubleTapPoint, scale);
+ EXPECT_FLOAT_EQ(webViewHelper.webView()->minimumPageScaleFactor(), scale);
+ simulateDoubleTap(webViewHelper.webView(), doubleTapPoint, scale);
EXPECT_FLOAT_EQ(legibleScale, scale);
// Zoom in to reset double_tap_zoom_in_effect flag.
- webViewHelper.webViewImpl()->applyViewportDeltas(WebFloatSize(), WebFloatSize(), WebFloatSize(), 1.1f, 0);
+ webViewHelper.webView()->applyViewportDeltas(WebFloatSize(), WebFloatSize(), WebFloatSize(), 1.1f, 0);
// 1 < maximumLegibleScaleFactor < minimumPageScale < doubleTapZoomAlreadyLegibleScale
webViewHelper.webView()->setDefaultPageScaleLimits(1.0f, 4);
webViewHelper.webView()->updateAllLifecyclePhases();
- doubleTapZoomAlreadyLegibleScale = webViewHelper.webViewImpl()->minimumPageScaleFactor() * doubleTapZoomAlreadyLegibleRatio;
- setScaleAndScrollAndLayout(webViewHelper.webViewImpl(), WebPoint(0, 0), (webViewHelper.webViewImpl()->minimumPageScaleFactor()) * (1 + doubleTapZoomAlreadyLegibleRatio) / 2);
- simulateDoubleTap(webViewHelper.webViewImpl(), doubleTapPoint, scale);
+ doubleTapZoomAlreadyLegibleScale = webViewHelper.webView()->minimumPageScaleFactor() * doubleTapZoomAlreadyLegibleRatio;
+ setScaleAndScrollAndLayout(webViewHelper.webView(), WebPoint(0, 0), (webViewHelper.webView()->minimumPageScaleFactor()) * (1 + doubleTapZoomAlreadyLegibleRatio) / 2);
+ simulateDoubleTap(webViewHelper.webView(), doubleTapPoint, scale);
EXPECT_FLOAT_EQ(doubleTapZoomAlreadyLegibleScale, scale);
- simulateDoubleTap(webViewHelper.webViewImpl(), doubleTapPoint, scale);
- EXPECT_FLOAT_EQ(webViewHelper.webViewImpl()->minimumPageScaleFactor(), scale);
- simulateDoubleTap(webViewHelper.webViewImpl(), doubleTapPoint, scale);
+ simulateDoubleTap(webViewHelper.webView(), doubleTapPoint, scale);
+ EXPECT_FLOAT_EQ(webViewHelper.webView()->minimumPageScaleFactor(), scale);
+ simulateDoubleTap(webViewHelper.webView(), doubleTapPoint, scale);
EXPECT_FLOAT_EQ(doubleTapZoomAlreadyLegibleScale, scale);
// Zoom in to reset double_tap_zoom_in_effect flag.
- webViewHelper.webViewImpl()->applyViewportDeltas(WebFloatSize(), WebFloatSize(), WebFloatSize(), 1.1f, 0);
+ webViewHelper.webView()->applyViewportDeltas(WebFloatSize(), WebFloatSize(), WebFloatSize(), 1.1f, 0);
// minimumPageScale < 1 < maximumLegibleScaleFactor < doubleTapZoomAlreadyLegibleScale
webViewHelper.webView()->setDefaultPageScaleLimits(0.95f, 4);
webViewHelper.webView()->updateAllLifecyclePhases();
- doubleTapZoomAlreadyLegibleScale = webViewHelper.webViewImpl()->minimumPageScaleFactor() * doubleTapZoomAlreadyLegibleRatio;
- setScaleAndScrollAndLayout(webViewHelper.webViewImpl(), WebPoint(0, 0), (webViewHelper.webViewImpl()->minimumPageScaleFactor()) * (1 + doubleTapZoomAlreadyLegibleRatio) / 2);
- simulateDoubleTap(webViewHelper.webViewImpl(), doubleTapPoint, scale);
+ doubleTapZoomAlreadyLegibleScale = webViewHelper.webView()->minimumPageScaleFactor() * doubleTapZoomAlreadyLegibleRatio;
+ setScaleAndScrollAndLayout(webViewHelper.webView(), WebPoint(0, 0), (webViewHelper.webView()->minimumPageScaleFactor()) * (1 + doubleTapZoomAlreadyLegibleRatio) / 2);
+ simulateDoubleTap(webViewHelper.webView(), doubleTapPoint, scale);
EXPECT_FLOAT_EQ(doubleTapZoomAlreadyLegibleScale, scale);
- simulateDoubleTap(webViewHelper.webViewImpl(), doubleTapPoint, scale);
- EXPECT_FLOAT_EQ(webViewHelper.webViewImpl()->minimumPageScaleFactor(), scale);
- simulateDoubleTap(webViewHelper.webViewImpl(), doubleTapPoint, scale);
+ simulateDoubleTap(webViewHelper.webView(), doubleTapPoint, scale);
+ EXPECT_FLOAT_EQ(webViewHelper.webView()->minimumPageScaleFactor(), scale);
+ simulateDoubleTap(webViewHelper.webView(), doubleTapPoint, scale);
EXPECT_FLOAT_EQ(doubleTapZoomAlreadyLegibleScale, scale);
// Zoom in to reset double_tap_zoom_in_effect flag.
- webViewHelper.webViewImpl()->applyViewportDeltas(WebFloatSize(), WebFloatSize(), WebFloatSize(), 1.1f, 0);
+ webViewHelper.webView()->applyViewportDeltas(WebFloatSize(), WebFloatSize(), WebFloatSize(), 1.1f, 0);
// minimumPageScale < 1 < doubleTapZoomAlreadyLegibleScale < maximumLegibleScaleFactor
webViewHelper.webView()->setDefaultPageScaleLimits(0.9f, 4);
webViewHelper.webView()->updateAllLifecyclePhases();
- doubleTapZoomAlreadyLegibleScale = webViewHelper.webViewImpl()->minimumPageScaleFactor() * doubleTapZoomAlreadyLegibleRatio;
- setScaleAndScrollAndLayout(webViewHelper.webViewImpl(), WebPoint(0, 0), (webViewHelper.webViewImpl()->minimumPageScaleFactor()) * (1 + doubleTapZoomAlreadyLegibleRatio) / 2);
- simulateDoubleTap(webViewHelper.webViewImpl(), doubleTapPoint, scale);
+ doubleTapZoomAlreadyLegibleScale = webViewHelper.webView()->minimumPageScaleFactor() * doubleTapZoomAlreadyLegibleRatio;
+ setScaleAndScrollAndLayout(webViewHelper.webView(), WebPoint(0, 0), (webViewHelper.webView()->minimumPageScaleFactor()) * (1 + doubleTapZoomAlreadyLegibleRatio) / 2);
+ simulateDoubleTap(webViewHelper.webView(), doubleTapPoint, scale);
EXPECT_FLOAT_EQ(legibleScale, scale);
- simulateDoubleTap(webViewHelper.webViewImpl(), doubleTapPoint, scale);
- EXPECT_FLOAT_EQ(webViewHelper.webViewImpl()->minimumPageScaleFactor(), scale);
- simulateDoubleTap(webViewHelper.webViewImpl(), doubleTapPoint, scale);
+ simulateDoubleTap(webViewHelper.webView(), doubleTapPoint, scale);
+ EXPECT_FLOAT_EQ(webViewHelper.webView()->minimumPageScaleFactor(), scale);
+ simulateDoubleTap(webViewHelper.webView(), doubleTapPoint, scale);
EXPECT_FLOAT_EQ(legibleScale, scale);
}
@@ -2783,9 +2783,9 @@ TEST_F(WebFrameTest, DivAutoZoomScaleFontScaleFactorTest)
webViewHelper.webView()->setMaximumLegibleScale(1.f);
webViewHelper.webView()->updateAllLifecyclePhases();
- webViewHelper.webViewImpl()->enableFakePageScaleAnimationForTesting(true);
- webViewHelper.webViewImpl()->page()->settings().setTextAutosizingEnabled(true);
- webViewHelper.webViewImpl()->page()->settings().setAccessibilityFontScaleFactor(accessibilityFontScaleFactor);
+ webViewHelper.webView()->enableFakePageScaleAnimationForTesting(true);
+ webViewHelper.webView()->page()->settings().setTextAutosizingEnabled(true);
+ webViewHelper.webView()->page()->settings().setAccessibilityFontScaleFactor(accessibilityFontScaleFactor);
WebRect div(200, 100, 200, 150);
WebPoint doubleTapPoint(div.x + 50, div.y + 50);
@@ -2794,57 +2794,57 @@ TEST_F(WebFrameTest, DivAutoZoomScaleFontScaleFactorTest)
// Test double tap scale bounds.
// minimumPageScale < doubleTapZoomAlreadyLegibleScale < 1 < accessibilityFontScaleFactor
float legibleScale = accessibilityFontScaleFactor;
- setScaleAndScrollAndLayout(webViewHelper.webViewImpl(), WebPoint(0, 0), (webViewHelper.webViewImpl()->minimumPageScaleFactor()) * (1 + doubleTapZoomAlreadyLegibleRatio) / 2);
- float doubleTapZoomAlreadyLegibleScale = webViewHelper.webViewImpl()->minimumPageScaleFactor() * doubleTapZoomAlreadyLegibleRatio;
+ setScaleAndScrollAndLayout(webViewHelper.webView(), WebPoint(0, 0), (webViewHelper.webView()->minimumPageScaleFactor()) * (1 + doubleTapZoomAlreadyLegibleRatio) / 2);
+ float doubleTapZoomAlreadyLegibleScale = webViewHelper.webView()->minimumPageScaleFactor() * doubleTapZoomAlreadyLegibleRatio;
webViewHelper.webView()->setDefaultPageScaleLimits(0.5f, 4);
webViewHelper.webView()->updateAllLifecyclePhases();
- simulateDoubleTap(webViewHelper.webViewImpl(), doubleTapPoint, scale);
+ simulateDoubleTap(webViewHelper.webView(), doubleTapPoint, scale);
EXPECT_FLOAT_EQ(legibleScale, scale);
- simulateDoubleTap(webViewHelper.webViewImpl(), doubleTapPoint, scale);
- EXPECT_FLOAT_EQ(webViewHelper.webViewImpl()->minimumPageScaleFactor(), scale);
- simulateDoubleTap(webViewHelper.webViewImpl(), doubleTapPoint, scale);
+ simulateDoubleTap(webViewHelper.webView(), doubleTapPoint, scale);
+ EXPECT_FLOAT_EQ(webViewHelper.webView()->minimumPageScaleFactor(), scale);
+ simulateDoubleTap(webViewHelper.webView(), doubleTapPoint, scale);
EXPECT_FLOAT_EQ(legibleScale, scale);
// Zoom in to reset double_tap_zoom_in_effect flag.
- webViewHelper.webViewImpl()->applyViewportDeltas(WebFloatSize(), WebFloatSize(), WebFloatSize(), 1.1f, 0);
+ webViewHelper.webView()->applyViewportDeltas(WebFloatSize(), WebFloatSize(), WebFloatSize(), 1.1f, 0);
// 1 < accessibilityFontScaleFactor < minimumPageScale < doubleTapZoomAlreadyLegibleScale
webViewHelper.webView()->setDefaultPageScaleLimits(1.0f, 4);
webViewHelper.webView()->updateAllLifecyclePhases();
- doubleTapZoomAlreadyLegibleScale = webViewHelper.webViewImpl()->minimumPageScaleFactor() * doubleTapZoomAlreadyLegibleRatio;
- setScaleAndScrollAndLayout(webViewHelper.webViewImpl(), WebPoint(0, 0), (webViewHelper.webViewImpl()->minimumPageScaleFactor()) * (1 + doubleTapZoomAlreadyLegibleRatio) / 2);
- simulateDoubleTap(webViewHelper.webViewImpl(), doubleTapPoint, scale);
+ doubleTapZoomAlreadyLegibleScale = webViewHelper.webView()->minimumPageScaleFactor() * doubleTapZoomAlreadyLegibleRatio;
+ setScaleAndScrollAndLayout(webViewHelper.webView(), WebPoint(0, 0), (webViewHelper.webView()->minimumPageScaleFactor()) * (1 + doubleTapZoomAlreadyLegibleRatio) / 2);
+ simulateDoubleTap(webViewHelper.webView(), doubleTapPoint, scale);
EXPECT_FLOAT_EQ(doubleTapZoomAlreadyLegibleScale, scale);
- simulateDoubleTap(webViewHelper.webViewImpl(), doubleTapPoint, scale);
- EXPECT_FLOAT_EQ(webViewHelper.webViewImpl()->minimumPageScaleFactor(), scale);
- simulateDoubleTap(webViewHelper.webViewImpl(), doubleTapPoint, scale);
+ simulateDoubleTap(webViewHelper.webView(), doubleTapPoint, scale);
+ EXPECT_FLOAT_EQ(webViewHelper.webView()->minimumPageScaleFactor(), scale);
+ simulateDoubleTap(webViewHelper.webView(), doubleTapPoint, scale);
EXPECT_FLOAT_EQ(doubleTapZoomAlreadyLegibleScale, scale);
// Zoom in to reset double_tap_zoom_in_effect flag.
- webViewHelper.webViewImpl()->applyViewportDeltas(WebFloatSize(), WebFloatSize(), WebFloatSize(), 1.1f, 0);
+ webViewHelper.webView()->applyViewportDeltas(WebFloatSize(), WebFloatSize(), WebFloatSize(), 1.1f, 0);
// minimumPageScale < 1 < accessibilityFontScaleFactor < doubleTapZoomAlreadyLegibleScale
webViewHelper.webView()->setDefaultPageScaleLimits(0.95f, 4);
webViewHelper.webView()->updateAllLifecyclePhases();
- doubleTapZoomAlreadyLegibleScale = webViewHelper.webViewImpl()->minimumPageScaleFactor() * doubleTapZoomAlreadyLegibleRatio;
- setScaleAndScrollAndLayout(webViewHelper.webViewImpl(), WebPoint(0, 0), (webViewHelper.webViewImpl()->minimumPageScaleFactor()) * (1 + doubleTapZoomAlreadyLegibleRatio) / 2);
- simulateDoubleTap(webViewHelper.webViewImpl(), doubleTapPoint, scale);
+ doubleTapZoomAlreadyLegibleScale = webViewHelper.webView()->minimumPageScaleFactor() * doubleTapZoomAlreadyLegibleRatio;
+ setScaleAndScrollAndLayout(webViewHelper.webView(), WebPoint(0, 0), (webViewHelper.webView()->minimumPageScaleFactor()) * (1 + doubleTapZoomAlreadyLegibleRatio) / 2);
+ simulateDoubleTap(webViewHelper.webView(), doubleTapPoint, scale);
EXPECT_FLOAT_EQ(doubleTapZoomAlreadyLegibleScale, scale);
- simulateDoubleTap(webViewHelper.webViewImpl(), doubleTapPoint, scale);
- EXPECT_FLOAT_EQ(webViewHelper.webViewImpl()->minimumPageScaleFactor(), scale);
- simulateDoubleTap(webViewHelper.webViewImpl(), doubleTapPoint, scale);
+ simulateDoubleTap(webViewHelper.webView(), doubleTapPoint, scale);
+ EXPECT_FLOAT_EQ(webViewHelper.webView()->minimumPageScaleFactor(), scale);
+ simulateDoubleTap(webViewHelper.webView(), doubleTapPoint, scale);
EXPECT_FLOAT_EQ(doubleTapZoomAlreadyLegibleScale, scale);
// Zoom in to reset double_tap_zoom_in_effect flag.
- webViewHelper.webViewImpl()->applyViewportDeltas(WebFloatSize(), WebFloatSize(), WebFloatSize(), 1.1f, 0);
+ webViewHelper.webView()->applyViewportDeltas(WebFloatSize(), WebFloatSize(), WebFloatSize(), 1.1f, 0);
// minimumPageScale < 1 < doubleTapZoomAlreadyLegibleScale < accessibilityFontScaleFactor
webViewHelper.webView()->setDefaultPageScaleLimits(0.9f, 4);
webViewHelper.webView()->updateAllLifecyclePhases();
- doubleTapZoomAlreadyLegibleScale = webViewHelper.webViewImpl()->minimumPageScaleFactor() * doubleTapZoomAlreadyLegibleRatio;
- setScaleAndScrollAndLayout(webViewHelper.webViewImpl(), WebPoint(0, 0), (webViewHelper.webViewImpl()->minimumPageScaleFactor()) * (1 + doubleTapZoomAlreadyLegibleRatio) / 2);
- simulateDoubleTap(webViewHelper.webViewImpl(), doubleTapPoint, scale);
+ doubleTapZoomAlreadyLegibleScale = webViewHelper.webView()->minimumPageScaleFactor() * doubleTapZoomAlreadyLegibleRatio;
+ setScaleAndScrollAndLayout(webViewHelper.webView(), WebPoint(0, 0), (webViewHelper.webView()->minimumPageScaleFactor()) * (1 + doubleTapZoomAlreadyLegibleRatio) / 2);
+ simulateDoubleTap(webViewHelper.webView(), doubleTapPoint, scale);
EXPECT_FLOAT_EQ(legibleScale, scale);
- simulateDoubleTap(webViewHelper.webViewImpl(), doubleTapPoint, scale);
- EXPECT_FLOAT_EQ(webViewHelper.webViewImpl()->minimumPageScaleFactor(), scale);
- simulateDoubleTap(webViewHelper.webViewImpl(), doubleTapPoint, scale);
+ simulateDoubleTap(webViewHelper.webView(), doubleTapPoint, scale);
+ EXPECT_FLOAT_EQ(webViewHelper.webView()->minimumPageScaleFactor(), scale);
+ simulateDoubleTap(webViewHelper.webView(), doubleTapPoint, scale);
EXPECT_FLOAT_EQ(legibleScale, scale);
}
@@ -2860,25 +2860,25 @@ TEST_P(ParameterizedWebFrameTest, BlockBoundTest)
IntRect rectRightBottom = IntRect(110, 110, 80, 80);
IntRect blockBound;
- blockBound = IntRect(webViewHelper.webViewImpl()->computeBlockBound(WebPoint(9, 9), true));
+ blockBound = IntRect(webViewHelper.webView()->computeBlockBound(WebPoint(9, 9), true));
EXPECT_RECT_EQ(rectBack, blockBound);
- blockBound = IntRect(webViewHelper.webViewImpl()->computeBlockBound(WebPoint(10, 10), true));
+ blockBound = IntRect(webViewHelper.webView()->computeBlockBound(WebPoint(10, 10), true));
EXPECT_RECT_EQ(rectLeftTop, blockBound);
- blockBound = IntRect(webViewHelper.webViewImpl()->computeBlockBound(WebPoint(50, 50), true));
+ blockBound = IntRect(webViewHelper.webView()->computeBlockBound(WebPoint(50, 50), true));
EXPECT_RECT_EQ(rectLeftTop, blockBound);
- blockBound = IntRect(webViewHelper.webViewImpl()->computeBlockBound(WebPoint(89, 89), true));
+ blockBound = IntRect(webViewHelper.webView()->computeBlockBound(WebPoint(89, 89), true));
EXPECT_RECT_EQ(rectLeftTop, blockBound);
- blockBound = IntRect(webViewHelper.webViewImpl()->computeBlockBound(WebPoint(90, 90), true));
+ blockBound = IntRect(webViewHelper.webView()->computeBlockBound(WebPoint(90, 90), true));
EXPECT_RECT_EQ(rectBack, blockBound);
- blockBound = IntRect(webViewHelper.webViewImpl()->computeBlockBound(WebPoint(109, 109), true));
+ blockBound = IntRect(webViewHelper.webView()->computeBlockBound(WebPoint(109, 109), true));
EXPECT_RECT_EQ(rectBack, blockBound);
- blockBound = IntRect(webViewHelper.webViewImpl()->computeBlockBound(WebPoint(110, 110), true));
+ blockBound = IntRect(webViewHelper.webView()->computeBlockBound(WebPoint(110, 110), true));
EXPECT_RECT_EQ(rectRightBottom, blockBound);
}
@@ -2899,22 +2899,22 @@ TEST_P(ParameterizedWebFrameTest, DivMultipleTargetZoomMultipleDivsTest)
webViewHelper.webView()->setMaximumLegibleScale(1.f);
webViewHelper.webView()->updateAllLifecyclePhases();
- webViewHelper.webViewImpl()->enableFakePageScaleAnimationForTesting(true);
+ webViewHelper.webView()->enableFakePageScaleAnimationForTesting(true);
WebRect viewportRect(0, 0, viewportWidth, viewportHeight);
WebRect topDiv(200, 100, 200, 150);
WebRect bottomDiv(200, 300, 200, 150);
float scale;
- setScaleAndScrollAndLayout(webViewHelper.webViewImpl(), WebPoint(0, 0), (webViewHelper.webViewImpl()->minimumPageScaleFactor()) * (1 + doubleTapZoomAlreadyLegibleRatio) / 2);
+ setScaleAndScrollAndLayout(webViewHelper.webView(), WebPoint(0, 0), (webViewHelper.webView()->minimumPageScaleFactor()) * (1 + doubleTapZoomAlreadyLegibleRatio) / 2);
- simulateMultiTargetZoom(webViewHelper.webViewImpl(), topDiv, scale);
+ simulateMultiTargetZoom(webViewHelper.webView(), topDiv, scale);
EXPECT_FLOAT_EQ(1, scale);
- simulateMultiTargetZoom(webViewHelper.webViewImpl(), bottomDiv, scale);
+ simulateMultiTargetZoom(webViewHelper.webView(), bottomDiv, scale);
EXPECT_FLOAT_EQ(1, scale);
- simulateMultiTargetZoom(webViewHelper.webViewImpl(), viewportRect, scale);
+ simulateMultiTargetZoom(webViewHelper.webView(), viewportRect, scale);
EXPECT_FLOAT_EQ(1, scale);
- webViewHelper.webViewImpl()->setPageScaleFactor(webViewHelper.webViewImpl()->minimumPageScaleFactor());
- simulateMultiTargetZoom(webViewHelper.webViewImpl(), topDiv, scale);
+ webViewHelper.webView()->setPageScaleFactor(webViewHelper.webView()->minimumPageScaleFactor());
+ simulateMultiTargetZoom(webViewHelper.webView(), topDiv, scale);
EXPECT_FLOAT_EQ(1, scale);
}
@@ -2927,38 +2927,38 @@ TEST_F(WebFrameTest, DontZoomInOnFocusedInTouchAction)
FrameTestHelpers::WebViewHelper webViewHelper;
webViewHelper.initializeAndLoad(m_baseURL + "textbox_in_touch_action.html");
- webViewHelper.webViewImpl()->setDefaultPageScaleLimits(0.25f, 4);
- webViewHelper.webViewImpl()->enableFakePageScaleAnimationForTesting(true);
- webViewHelper.webViewImpl()->page()->settings().setTextAutosizingEnabled(false);
- webViewHelper.webViewImpl()->settings()->setAutoZoomFocusedNodeToLegibleScale(true);
+ webViewHelper.webView()->setDefaultPageScaleLimits(0.25f, 4);
+ webViewHelper.webView()->enableFakePageScaleAnimationForTesting(true);
+ webViewHelper.webView()->page()->settings().setTextAutosizingEnabled(false);
+ webViewHelper.webView()->settings()->setAutoZoomFocusedNodeToLegibleScale(true);
webViewHelper.resize(WebSize(viewportWidth, viewportHeight));
- float initialScale = webViewHelper.webViewImpl()->pageScaleFactor();
+ float initialScale = webViewHelper.webView()->pageScaleFactor();
// Focus the first textbox that's in a touch-action: pan-x ancestor, this
// shouldn't cause an autozoom since pan-x disables pinch-zoom.
- webViewHelper.webViewImpl()->advanceFocus(false);
- webViewHelper.webViewImpl()->scrollFocusedEditableElementIntoRect(WebRect());
- EXPECT_EQ(webViewHelper.webViewImpl()->fakePageScaleAnimationPageScaleForTesting(), 0);
+ webViewHelper.webView()->advanceFocus(false);
+ webViewHelper.webView()->scrollFocusedEditableElementIntoRect(WebRect());
+ EXPECT_EQ(webViewHelper.webView()->fakePageScaleAnimationPageScaleForTesting(), 0);
- setScaleAndScrollAndLayout(webViewHelper.webViewImpl(), WebPoint(0, 0), initialScale);
- ASSERT_EQ(initialScale, webViewHelper.webViewImpl()->pageScaleFactor());
+ setScaleAndScrollAndLayout(webViewHelper.webView(), WebPoint(0, 0), initialScale);
+ ASSERT_EQ(initialScale, webViewHelper.webView()->pageScaleFactor());
// Focus the second textbox that's in a touch-action: manipulation ancestor,
// this should cause an autozoom since it allows pinch-zoom.
- webViewHelper.webViewImpl()->advanceFocus(false);
- webViewHelper.webViewImpl()->scrollFocusedEditableElementIntoRect(WebRect());
- EXPECT_GT(webViewHelper.webViewImpl()->fakePageScaleAnimationPageScaleForTesting(), initialScale);
+ webViewHelper.webView()->advanceFocus(false);
+ webViewHelper.webView()->scrollFocusedEditableElementIntoRect(WebRect());
+ EXPECT_GT(webViewHelper.webView()->fakePageScaleAnimationPageScaleForTesting(), initialScale);
- setScaleAndScrollAndLayout(webViewHelper.webViewImpl(), WebPoint(0, 0), initialScale);
- ASSERT_EQ(initialScale, webViewHelper.webViewImpl()->pageScaleFactor());
+ setScaleAndScrollAndLayout(webViewHelper.webView(), WebPoint(0, 0), initialScale);
+ ASSERT_EQ(initialScale, webViewHelper.webView()->pageScaleFactor());
// Focus the third textbox that has a touch-action: pan-x ancestor, this
// should cause an autozoom since it's seperated from the node with the
// touch-action by an overflow:scroll element.
webViewHelper.webView()->advanceFocus(false);
- webViewHelper.webViewImpl()->scrollFocusedEditableElementIntoRect(WebRect());
- EXPECT_GT(webViewHelper.webViewImpl()->fakePageScaleAnimationPageScaleForTesting(), initialScale);
+ webViewHelper.webView()->scrollFocusedEditableElementIntoRect(WebRect());
+ EXPECT_GT(webViewHelper.webView()->fakePageScaleAnimationPageScaleForTesting(), initialScale);
}
@@ -2974,11 +2974,11 @@ TEST_F(WebFrameTest, DivScrollIntoEditableTest)
float minReadableCaretHeight = 16.0f;
FrameTestHelpers::WebViewHelper webViewHelper;
webViewHelper.initializeAndLoad(m_baseURL + "get_scale_for_zoom_into_editable_test.html");
- webViewHelper.webViewImpl()->page()->settings().setTextAutosizingEnabled(false);
+ webViewHelper.webView()->page()->settings().setTextAutosizingEnabled(false);
webViewHelper.resize(WebSize(viewportWidth, viewportHeight));
webViewHelper.webView()->setDefaultPageScaleLimits(0.25f, 4);
- webViewHelper.webViewImpl()->enableFakePageScaleAnimationForTesting(true);
+ webViewHelper.webView()->enableFakePageScaleAnimationForTesting(true);
WebRect editBoxWithText(200, 200, 250, 20);
WebRect editBoxWithNoText(200, 250, 250, 20);
@@ -2988,18 +2988,18 @@ TEST_F(WebFrameTest, DivScrollIntoEditableTest)
webViewHelper.webView()->advanceFocus(false);
// Set the caret to the end of the input box.
webViewHelper.webView()->mainFrame()->document().getElementById("EditBoxWithText").to<WebInputElement>().setSelectionRange(1000, 1000);
- setScaleAndScrollAndLayout(webViewHelper.webViewImpl(), WebPoint(0, 0), 1);
+ setScaleAndScrollAndLayout(webViewHelper.webView(), WebPoint(0, 0), 1);
WebRect rect, caret;
- webViewHelper.webViewImpl()->selectionBounds(caret, rect);
+ webViewHelper.webView()->selectionBounds(caret, rect);
// Set the page scale to be smaller than the minimal readable scale.
float initialScale = minReadableCaretHeight / caret.height * 0.5f;
- setScaleAndScrollAndLayout(webViewHelper.webViewImpl(), WebPoint(0, 0), initialScale);
+ setScaleAndScrollAndLayout(webViewHelper.webView(), WebPoint(0, 0), initialScale);
float scale;
IntPoint scroll;
bool needAnimation;
- webViewHelper.webViewImpl()->computeScaleAndScrollForFocusedNode(webViewHelper.webViewImpl()->focusedElement(), autoZoomToLegibleScale, scale, scroll, needAnimation);
+ webViewHelper.webView()->computeScaleAndScrollForFocusedNode(webViewHelper.webView()->focusedElement(), autoZoomToLegibleScale, scale, scroll, needAnimation);
EXPECT_TRUE(needAnimation);
// The edit box should be left aligned with a margin for possible label.
int hScroll = editBoxWithText.x - leftBoxRatio * viewportWidth / scale;
@@ -3012,18 +3012,18 @@ TEST_F(WebFrameTest, DivScrollIntoEditableTest)
viewportWidth = 200;
viewportHeight = 150;
webViewHelper.resize(WebSize(viewportWidth, viewportHeight));
- setScaleAndScrollAndLayout(webViewHelper.webViewImpl(), WebPoint(0, 0), initialScale);
- webViewHelper.webViewImpl()->computeScaleAndScrollForFocusedNode(webViewHelper.webViewImpl()->focusedElement(), autoZoomToLegibleScale, scale, scroll, needAnimation);
+ setScaleAndScrollAndLayout(webViewHelper.webView(), WebPoint(0, 0), initialScale);
+ webViewHelper.webView()->computeScaleAndScrollForFocusedNode(webViewHelper.webView()->focusedElement(), autoZoomToLegibleScale, scale, scroll, needAnimation);
EXPECT_TRUE(needAnimation);
// The caret should be right aligned since the caret would be offscreen when the edit box is left aligned.
hScroll = caret.x + caret.width + caretPadding - viewportWidth / scale;
EXPECT_NEAR(hScroll, scroll.x(), 2);
EXPECT_NEAR(minReadableCaretHeight / caret.height, scale, 0.1);
- setScaleAndScrollAndLayout(webViewHelper.webViewImpl(), WebPoint(0, 0), initialScale);
+ setScaleAndScrollAndLayout(webViewHelper.webView(), WebPoint(0, 0), initialScale);
// Move focus to edit box with text.
webViewHelper.webView()->advanceFocus(false);
- webViewHelper.webViewImpl()->computeScaleAndScrollForFocusedNode(webViewHelper.webViewImpl()->focusedElement(), autoZoomToLegibleScale, scale, scroll, needAnimation);
+ webViewHelper.webView()->computeScaleAndScrollForFocusedNode(webViewHelper.webView()->focusedElement(), autoZoomToLegibleScale, scale, scroll, needAnimation);
EXPECT_TRUE(needAnimation);
// The edit box should be left aligned.
hScroll = editBoxWithNoText.x;
@@ -3036,10 +3036,10 @@ TEST_F(WebFrameTest, DivScrollIntoEditableTest)
webViewHelper.webView()->advanceFocus(true);
// Zoom out slightly.
const float withinToleranceScale = scale * 0.9f;
- setScaleAndScrollAndLayout(webViewHelper.webViewImpl(), scroll, withinToleranceScale);
+ setScaleAndScrollAndLayout(webViewHelper.webView(), scroll, withinToleranceScale);
// Move focus back to the second edit box.
webViewHelper.webView()->advanceFocus(false);
- webViewHelper.webViewImpl()->computeScaleAndScrollForFocusedNode(webViewHelper.webViewImpl()->focusedElement(), autoZoomToLegibleScale, scale, scroll, needAnimation);
+ webViewHelper.webView()->computeScaleAndScrollForFocusedNode(webViewHelper.webView()->focusedElement(), autoZoomToLegibleScale, scale, scroll, needAnimation);
// The scale should not be adjusted as the zoomed out scale was sufficiently close to the previously focused scale.
EXPECT_FALSE(needAnimation);
}
@@ -3054,27 +3054,27 @@ TEST_F(WebFrameTest, DivScrollIntoEditablePreservePageScaleTest)
const float minReadableCaretHeight = 16.0f;
FrameTestHelpers::WebViewHelper webViewHelper;
webViewHelper.initializeAndLoad(m_baseURL + "get_scale_for_zoom_into_editable_test.html");
- webViewHelper.webViewImpl()->page()->settings().setTextAutosizingEnabled(false);
+ webViewHelper.webView()->page()->settings().setTextAutosizingEnabled(false);
webViewHelper.resize(WebSize(viewportWidth, viewportHeight));
- webViewHelper.webViewImpl()->enableFakePageScaleAnimationForTesting(true);
+ webViewHelper.webView()->enableFakePageScaleAnimationForTesting(true);
const WebRect editBoxWithText(200, 200, 250, 20);
webViewHelper.webView()->advanceFocus(false);
// Set the caret to the begining of the input box.
webViewHelper.webView()->mainFrame()->document().getElementById("EditBoxWithText").to<WebInputElement>().setSelectionRange(0, 0);
- setScaleAndScrollAndLayout(webViewHelper.webViewImpl(), WebPoint(0, 0), 1);
+ setScaleAndScrollAndLayout(webViewHelper.webView(), WebPoint(0, 0), 1);
WebRect rect, caret;
- webViewHelper.webViewImpl()->selectionBounds(caret, rect);
+ webViewHelper.webView()->selectionBounds(caret, rect);
// Set the page scale to be twice as large as the minimal readable scale.
float newScale = minReadableCaretHeight / caret.height * 2.0;
- setScaleAndScrollAndLayout(webViewHelper.webViewImpl(), WebPoint(0, 0), newScale);
+ setScaleAndScrollAndLayout(webViewHelper.webView(), WebPoint(0, 0), newScale);
float scale;
IntPoint scroll;
bool needAnimation;
- webViewHelper.webViewImpl()->computeScaleAndScrollForFocusedNode(webViewHelper.webViewImpl()->focusedElement(), autoZoomToLegibleScale, scale, scroll, needAnimation);
+ webViewHelper.webView()->computeScaleAndScrollForFocusedNode(webViewHelper.webView()->focusedElement(), autoZoomToLegibleScale, scale, scroll, needAnimation);
EXPECT_TRUE(needAnimation);
// Edit box and caret should be left alinged
int hScroll = editBoxWithText.x;
@@ -3087,8 +3087,8 @@ TEST_F(WebFrameTest, DivScrollIntoEditablePreservePageScaleTest)
// Set page scale and scroll such that edit box will be under the screen
newScale = 3.0;
hScroll = 200;
- setScaleAndScrollAndLayout(webViewHelper.webViewImpl(), WebPoint(hScroll, 0), newScale);
- webViewHelper.webViewImpl()->computeScaleAndScrollForFocusedNode(webViewHelper.webViewImpl()->focusedElement(), autoZoomToLegibleScale, scale, scroll, needAnimation);
+ setScaleAndScrollAndLayout(webViewHelper.webView(), WebPoint(hScroll, 0), newScale);
+ webViewHelper.webView()->computeScaleAndScrollForFocusedNode(webViewHelper.webView()->focusedElement(), autoZoomToLegibleScale, scale, scroll, needAnimation);
EXPECT_TRUE(needAnimation);
// Horizontal scroll have to be the same
EXPECT_NEAR(hScroll, scroll.x(), 1);
@@ -3110,11 +3110,11 @@ TEST_F(WebFrameTest, DivScrollIntoEditableTestZoomToLegibleScaleDisabled)
float leftBoxRatio = 0.3f;
FrameTestHelpers::WebViewHelper webViewHelper;
webViewHelper.initializeAndLoad(m_baseURL + "get_scale_for_zoom_into_editable_test.html");
- webViewHelper.webViewImpl()->page()->settings().setTextAutosizingEnabled(false);
+ webViewHelper.webView()->page()->settings().setTextAutosizingEnabled(false);
webViewHelper.resize(WebSize(viewportWidth, viewportHeight));
webViewHelper.webView()->setDefaultPageScaleLimits(0.25f, 4);
- webViewHelper.webViewImpl()->enableFakePageScaleAnimationForTesting(true);
+ webViewHelper.webView()->enableFakePageScaleAnimationForTesting(true);
WebRect editBoxWithText(200, 200, 250, 20);
WebRect editBoxWithNoText(200, 250, 250, 20);
@@ -3129,12 +3129,12 @@ TEST_F(WebFrameTest, DivScrollIntoEditableTestZoomToLegibleScaleDisabled)
// Set the page scale to be smaller than the minimal readable scale.
float initialScale = 0.25f;
- setScaleAndScrollAndLayout(webViewHelper.webViewImpl(), WebPoint(0, 0), initialScale);
+ setScaleAndScrollAndLayout(webViewHelper.webView(), WebPoint(0, 0), initialScale);
float scale;
IntPoint scroll;
bool needAnimation;
- webViewHelper.webViewImpl()->computeScaleAndScrollForFocusedNode(webViewHelper.webViewImpl()->focusedElement(), autoZoomToLegibleScale, scale, scroll, needAnimation);
+ webViewHelper.webView()->computeScaleAndScrollForFocusedNode(webViewHelper.webView()->focusedElement(), autoZoomToLegibleScale, scale, scroll, needAnimation);
// There should be no change in page scale.
EXPECT_EQ(initialScale, scale);
@@ -3145,13 +3145,13 @@ TEST_F(WebFrameTest, DivScrollIntoEditableTestZoomToLegibleScaleDisabled)
int vScroll = editBoxWithNoText.y - (viewportHeight / scale - editBoxWithNoText.height) / 2;
EXPECT_NEAR(vScroll, scroll.y(), 2);
- setScaleAndScrollAndLayout(webViewHelper.webViewImpl(), scroll, scale);
+ setScaleAndScrollAndLayout(webViewHelper.webView(), scroll, scale);
// Select the first textbox.
webViewHelper.webView()->advanceFocus(true);
WebRect rect, caret;
- webViewHelper.webViewImpl()->selectionBounds(caret, rect);
- webViewHelper.webViewImpl()->computeScaleAndScrollForFocusedNode(webViewHelper.webViewImpl()->focusedElement(), autoZoomToLegibleScale, scale, scroll, needAnimation);
+ webViewHelper.webView()->selectionBounds(caret, rect);
+ webViewHelper.webView()->computeScaleAndScrollForFocusedNode(webViewHelper.webView()->focusedElement(), autoZoomToLegibleScale, scale, scroll, needAnimation);
// There should be no change at all since the textbox is fully visible already.
EXPECT_EQ(initialScale, scale);
@@ -3166,13 +3166,13 @@ TEST_P(ParameterizedWebFrameTest, CharacterIndexAtPointWithPinchZoom)
webViewHelper.initializeAndLoad(m_baseURL + "sometext.html");
webViewHelper.resize(WebSize(640, 480));
- webViewHelper.webViewImpl()->setPageScaleFactor(2);
- webViewHelper.webViewImpl()->setVisualViewportOffset(WebFloatPoint(50, 60));
+ webViewHelper.webView()->setPageScaleFactor(2);
+ webViewHelper.webView()->setVisualViewportOffset(WebFloatPoint(50, 60));
WebRect baseRect;
WebRect extentRect;
- WebLocalFrame* mainFrame = webViewHelper.webViewImpl()->mainFrame()->toWebLocalFrame();
+ WebLocalFrame* mainFrame = webViewHelper.webView()->mainFrame()->toWebLocalFrame();
size_t ix = mainFrame->characterIndexForPoint(WebPoint(320, 388));
EXPECT_EQ(2ul, ix);
@@ -3186,7 +3186,7 @@ TEST_P(ParameterizedWebFrameTest, FirstRectForCharacterRangeWithPinchZoom)
webViewHelper.initializeAndLoad(m_baseURL + "textbox.html", true);
webViewHelper.resize(WebSize(640, 480));
- WebLocalFrame* mainFrame = webViewHelper.webViewImpl()->mainFrame()->toWebLocalFrame();
+ WebLocalFrame* mainFrame = webViewHelper.webView()->mainFrame()->toWebLocalFrame();
mainFrame->executeScript(WebScriptSource("selectRange();"));
WebRect oldRect;
@@ -3194,8 +3194,8 @@ TEST_P(ParameterizedWebFrameTest, FirstRectForCharacterRangeWithPinchZoom)
WebFloatPoint visualOffset(100, 130);
float scale = 2;
- webViewHelper.webViewImpl()->setPageScaleFactor(scale);
- webViewHelper.webViewImpl()->setVisualViewportOffset(visualOffset);
+ webViewHelper.webView()->setPageScaleFactor(scale);
+ webViewHelper.webView()->setVisualViewportOffset(visualOffset);
WebRect baseRect;
WebRect extentRect;
@@ -3257,32 +3257,32 @@ TEST_F(WebFrameTest, ReloadWithOverrideURLPreservesState)
ClearScrollStateOnCommitWebFrameClient client;
webViewHelper.initializeAndLoad(m_baseURL + firstURL, true, &client);
webViewHelper.resize(WebSize(pageWidth, pageHeight));
- webViewHelper.webViewImpl()->mainFrame()->setScrollOffset(WebSize(pageWidth / 4, pageHeight / 4));
- webViewHelper.webViewImpl()->setPageScaleFactor(pageScaleFactor);
+ webViewHelper.webView()->mainFrame()->setScrollOffset(WebSize(pageWidth / 4, pageHeight / 4));
+ webViewHelper.webView()->setPageScaleFactor(pageScaleFactor);
- WebSize previousOffset = webViewHelper.webViewImpl()->mainFrame()->scrollOffset();
- float previousScale = webViewHelper.webViewImpl()->pageScaleFactor();
+ WebSize previousOffset = webViewHelper.webView()->mainFrame()->scrollOffset();
+ float previousScale = webViewHelper.webView()->pageScaleFactor();
// Reload the page and end up at the same url. State should be propagated.
- webViewHelper.webViewImpl()->mainFrame()->reloadWithOverrideURL(toKURL(m_baseURL + firstURL), WebFrameLoadType::Reload);
- FrameTestHelpers::pumpPendingRequestsForFrameToLoad(webViewHelper.webViewImpl()->mainFrame());
- EXPECT_EQ(previousOffset.width, webViewHelper.webViewImpl()->mainFrame()->scrollOffset().width);
- EXPECT_EQ(previousOffset.height, webViewHelper.webViewImpl()->mainFrame()->scrollOffset().height);
- EXPECT_EQ(previousScale, webViewHelper.webViewImpl()->pageScaleFactor());
+ webViewHelper.webView()->mainFrame()->reloadWithOverrideURL(toKURL(m_baseURL + firstURL), WebFrameLoadType::Reload);
+ FrameTestHelpers::pumpPendingRequestsForFrameToLoad(webViewHelper.webView()->mainFrame());
+ EXPECT_EQ(previousOffset.width, webViewHelper.webView()->mainFrame()->scrollOffset().width);
+ EXPECT_EQ(previousOffset.height, webViewHelper.webView()->mainFrame()->scrollOffset().height);
+ EXPECT_EQ(previousScale, webViewHelper.webView()->pageScaleFactor());
// Reload the page using the cache. State should not be propagated.
- webViewHelper.webViewImpl()->mainFrame()->reloadWithOverrideURL(toKURL(m_baseURL + secondURL), WebFrameLoadType::Reload);
- FrameTestHelpers::pumpPendingRequestsForFrameToLoad(webViewHelper.webViewImpl()->mainFrame());
- EXPECT_EQ(0, webViewHelper.webViewImpl()->mainFrame()->scrollOffset().width);
- EXPECT_EQ(0, webViewHelper.webViewImpl()->mainFrame()->scrollOffset().height);
- EXPECT_EQ(1.0f, webViewHelper.webViewImpl()->pageScaleFactor());
+ webViewHelper.webView()->mainFrame()->reloadWithOverrideURL(toKURL(m_baseURL + secondURL), WebFrameLoadType::Reload);
+ FrameTestHelpers::pumpPendingRequestsForFrameToLoad(webViewHelper.webView()->mainFrame());
+ EXPECT_EQ(0, webViewHelper.webView()->mainFrame()->scrollOffset().width);
+ EXPECT_EQ(0, webViewHelper.webView()->mainFrame()->scrollOffset().height);
+ EXPECT_EQ(1.0f, webViewHelper.webView()->pageScaleFactor());
// Reload the page while ignoring the cache. State should not be propagated.
- webViewHelper.webViewImpl()->mainFrame()->reloadWithOverrideURL(toKURL(m_baseURL + thirdURL), WebFrameLoadType::ReloadBypassingCache);
- FrameTestHelpers::pumpPendingRequestsForFrameToLoad(webViewHelper.webViewImpl()->mainFrame());
- EXPECT_EQ(0, webViewHelper.webViewImpl()->mainFrame()->scrollOffset().width);
- EXPECT_EQ(0, webViewHelper.webViewImpl()->mainFrame()->scrollOffset().height);
- EXPECT_EQ(1.0f, webViewHelper.webViewImpl()->pageScaleFactor());
+ webViewHelper.webView()->mainFrame()->reloadWithOverrideURL(toKURL(m_baseURL + thirdURL), WebFrameLoadType::ReloadBypassingCache);
+ FrameTestHelpers::pumpPendingRequestsForFrameToLoad(webViewHelper.webView()->mainFrame());
+ EXPECT_EQ(0, webViewHelper.webView()->mainFrame()->scrollOffset().width);
+ EXPECT_EQ(0, webViewHelper.webView()->mainFrame()->scrollOffset().height);
+ EXPECT_EQ(1.0f, webViewHelper.webView()->pageScaleFactor());
}
TEST_P(ParameterizedWebFrameTest, ReloadWhileProvisional)
@@ -3334,7 +3334,7 @@ TEST_P(ParameterizedWebFrameTest, IframeRedirect)
// Pump pending requests one more time. The test page loads script that navigates.
FrameTestHelpers::pumpPendingRequestsForFrameToLoad(webViewHelper.webView()->mainFrame());
- WebFrame* iframe = webViewHelper.webView()->findFrameByName(WebString::fromUTF8("ifr"));
+ WebFrame* iframe = webViewHelper.webView()->findFrameByName(WebString::fromUTF8("ifr"), nullptr);
tkent 2016/07/20 04:51:01 Do you need to add nullptr argument in this CL?
dcheng 2016/07/20 06:18:07 findFrameByName has a default argument on WebView
tkent 2016/07/20 06:31:53 ok, I understand.
ASSERT_TRUE(iframe);
WebDataSource* iframeDataSource = iframe->dataSource();
ASSERT_TRUE(iframeDataSource);
@@ -3357,7 +3357,7 @@ TEST_P(ParameterizedWebFrameTest, ClearFocusedNodeTest)
webViewHelper.webView()->clearFocusedElement();
// Now retrieve the FocusedNode and test it should be null.
- EXPECT_EQ(0, webViewHelper.webViewImpl()->focusedElement());
+ EXPECT_EQ(0, webViewHelper.webView()->focusedElement());
}
// Implementation of WebFrameClient that tracks the v8 contexts that are created
@@ -3540,9 +3540,9 @@ TEST_P(ParameterizedWebFrameTest, FindInPage)
registerMockedHttpURLLoad("find.html");
FrameTestHelpers::WebViewHelper webViewHelper(this);
webViewHelper.initializeAndLoad(m_baseURL + "find.html");
- ASSERT_TRUE(webViewHelper.webView()->mainFrame()->isWebLocalFrame());
+ ASSERT_TRUE(webViewHelper.webView()->mainFrameImpl());
webViewHelper.webView()->setFocus(true);
- WebLocalFrame* frame = webViewHelper.webView()->mainFrame()->toWebLocalFrame();
+ WebLocalFrame* frame = webViewHelper.webView()->mainFrameImpl();
const int findIdentifier = 12345;
WebFindOptions options;
@@ -3640,7 +3640,7 @@ TEST_P(ParameterizedWebFrameTest, GetFullHtmlOfPage)
{
FrameTestHelpers::WebViewHelper webViewHelper(this);
webViewHelper.initializeAndLoad("about:blank", true);
- WebLocalFrame* frame = webViewHelper.webView()->mainFrame()->toWebLocalFrame();
+ WebLocalFrame* frame = webViewHelper.webView()->mainFrameImpl();
// Generate a simple test case.
const char simpleSource[] = "<p>Hello</p><p>World</p>";
@@ -3742,7 +3742,7 @@ TEST_P(ParameterizedWebFrameTest, FindInPageMatchRects)
WebFindOptions options;
WebString searchText = WebString::fromUTF8(kFindString);
- WebLocalFrameImpl* mainFrame = toWebLocalFrameImpl(webViewHelper.webView()->mainFrame());
+ WebLocalFrameImpl* mainFrame = webViewHelper.webView()->mainFrameImpl();
EXPECT_TRUE(mainFrame->find(kFindIdentifier, searchText, options, false, 0));
mainFrame->resetMatchCount();
@@ -3802,7 +3802,7 @@ TEST_F(WebFrameTest, FindInPageActiveIndex)
WebFindOptions options;
WebString searchText = WebString::fromUTF8(kFindString);
- WebLocalFrameImpl* mainFrame = toWebLocalFrameImpl(webViewHelper.webView()->mainFrame());
+ WebLocalFrameImpl* mainFrame = webViewHelper.webView()->mainFrameImpl();
EXPECT_TRUE(mainFrame->find(kFindIdentifier, searchText, options, false, 0));
mainFrame->resetMatchCount();
@@ -3851,7 +3851,7 @@ TEST_P(ParameterizedWebFrameTest, FindOnDetachedFrame)
WebFindOptions options;
WebString searchText = WebString::fromUTF8(kFindString);
- WebLocalFrameImpl* mainFrame = toWebLocalFrameImpl(webViewHelper.webView()->mainFrame());
+ WebLocalFrameImpl* mainFrame = webViewHelper.webView()->mainFrameImpl();
WebLocalFrameImpl* secondFrame = toWebLocalFrameImpl(mainFrame->traverseNext(false));
// Detach the frame before finding.
@@ -3889,7 +3889,7 @@ TEST_P(ParameterizedWebFrameTest, FindDetachFrameBeforeScopeStrings)
WebFindOptions options;
WebString searchText = WebString::fromUTF8(kFindString);
- WebLocalFrameImpl* mainFrame = toWebLocalFrameImpl(webViewHelper.webView()->mainFrame());
+ WebLocalFrameImpl* mainFrame = webViewHelper.webView()->mainFrameImpl();
for (WebFrame* frame = mainFrame; frame; frame = frame->traverseNext(false)) {
webViewHelper.webView()->setFocusedFrame(frame);
@@ -3928,7 +3928,7 @@ TEST_P(ParameterizedWebFrameTest, FindDetachFrameWhileScopingStrings)
WebFindOptions options;
WebString searchText = WebString::fromUTF8(kFindString);
- WebLocalFrameImpl* mainFrame = toWebLocalFrameImpl(webViewHelper.webView()->mainFrame());
+ WebLocalFrameImpl* mainFrame = webViewHelper.webView()->mainFrameImpl();
for (WebFrame* frame = mainFrame; frame; frame = frame->traverseNext(false)) {
webViewHelper.webView()->setFocusedFrame(frame);
@@ -3966,7 +3966,7 @@ TEST_P(ParameterizedWebFrameTest, ResetMatchCount)
WebFindOptions options;
WebString searchText = WebString::fromUTF8(kFindString);
- WebLocalFrameImpl* mainFrame = toWebLocalFrameImpl(webViewHelper.webView()->mainFrame());
+ WebLocalFrameImpl* mainFrame = webViewHelper.webView()->mainFrameImpl();
// Check that child frame exists.
EXPECT_TRUE(!!mainFrame->traverseNext(false));
@@ -3996,7 +3996,7 @@ TEST_P(ParameterizedWebFrameTest, SetTickmarks)
WebFindOptions options;
WebString searchText = WebString::fromUTF8(kFindString);
- WebLocalFrameImpl* mainFrame = toWebLocalFrameImpl(webViewHelper.webView()->mainFrame());
+ WebLocalFrameImpl* mainFrame = webViewHelper.webView()->mainFrameImpl();
EXPECT_TRUE(mainFrame->find(kFindIdentifier, searchText, options, false, 0));
mainFrame->resetMatchCount();
@@ -4006,7 +4006,7 @@ TEST_P(ParameterizedWebFrameTest, SetTickmarks)
EXPECT_TRUE(client.findResultsAreReady());
// Get the tickmarks for the original find request.
- FrameView* frameView = webViewHelper.webViewImpl()->mainFrameImpl()->frameView();
+ FrameView* frameView = webViewHelper.webView()->mainFrameImpl()->frameView();
Scrollbar* scrollbar = frameView->createScrollbar(HorizontalScrollbar);
Vector<IntRect> originalTickmarks;
scrollbar->getTickmarks(originalTickmarks);
@@ -4045,7 +4045,7 @@ TEST_P(ParameterizedWebFrameTest, FindInPageJavaScriptUpdatesDOM)
webViewHelper.webView()->setFocus(true);
runPendingTasks();
- WebLocalFrame* frame = webViewHelper.webView()->mainFrame()->toWebLocalFrame();
+ WebLocalFrame* frame = webViewHelper.webView()->mainFrameImpl();
const int findIdentifier = 12345;
static const char* kFindString = "foo";
WebString searchText = WebString::fromUTF8(kFindString);
@@ -4117,7 +4117,7 @@ TEST_P(ParameterizedWebFrameTest, SelectRange)
FrameTestHelpers::WebViewHelper webViewHelper(this);
initializeTextSelectionWebView(m_baseURL + "select_range_basic.html", &webViewHelper);
- frame = webViewHelper.webView()->mainFrame()->toWebLocalFrame();
+ frame = webViewHelper.webView()->mainFrameImpl();
EXPECT_EQ("Some test text for testing.", selectionAsString(frame));
webViewHelper.webView()->selectionBounds(startWebRect, endWebRect);
frame->executeCommand(WebString::fromUTF8("Unselect"));
@@ -4129,7 +4129,7 @@ TEST_P(ParameterizedWebFrameTest, SelectRange)
|| selectionString == "Some test text for testing");
initializeTextSelectionWebView(m_baseURL + "select_range_scroll.html", &webViewHelper);
- frame = webViewHelper.webView()->mainFrame()->toWebLocalFrame();
+ frame = webViewHelper.webView()->mainFrameImpl();
EXPECT_EQ("Some offscreen test text for testing.", selectionAsString(frame));
webViewHelper.webView()->selectionBounds(startWebRect, endWebRect);
frame->executeCommand(WebString::fromUTF8("Unselect"));
@@ -4177,7 +4177,7 @@ TEST_P(ParameterizedWebFrameTest, SelectRangeDivContentEditable)
// The selection range should be clipped to the bounds of the editable element.
FrameTestHelpers::WebViewHelper webViewHelper(this);
initializeTextSelectionWebView(m_baseURL + "select_range_div_editable.html", &webViewHelper);
- frame = webViewHelper.webView()->mainFrame()->toWebLocalFrame();
+ frame = webViewHelper.webView()->mainFrameImpl();
EXPECT_EQ("This text is initially selected.", selectionAsString(frame));
webViewHelper.webView()->selectionBounds(startWebRect, endWebRect);
@@ -4186,7 +4186,7 @@ TEST_P(ParameterizedWebFrameTest, SelectRangeDivContentEditable)
// As above, but extending the selection to the bottom of the document.
initializeTextSelectionWebView(m_baseURL + "select_range_div_editable.html", &webViewHelper);
- frame = webViewHelper.webView()->mainFrame()->toWebLocalFrame();
+ frame = webViewHelper.webView()->mainFrameImpl();
webViewHelper.webView()->selectionBounds(startWebRect, endWebRect);
frame->selectRange(topLeft(startWebRect), bottomRightMinusOne(endWebRect));
@@ -4212,7 +4212,7 @@ TEST_P(ParameterizedWebFrameTest, DISABLED_SelectRangeSpanContentEditable)
// The selection range should be clipped to the bounds of the editable element.
FrameTestHelpers::WebViewHelper webViewHelper(this);
initializeTextSelectionWebView(m_baseURL + "select_range_span_editable.html", &webViewHelper);
- frame = webViewHelper.webView()->mainFrame()->toWebLocalFrame();
+ frame = webViewHelper.webView()->mainFrameImpl();
EXPECT_EQ("This text is initially selected.", selectionAsString(frame));
webViewHelper.webView()->selectionBounds(startWebRect, endWebRect);
@@ -4221,7 +4221,7 @@ TEST_P(ParameterizedWebFrameTest, DISABLED_SelectRangeSpanContentEditable)
// As above, but extending the selection to the bottom of the document.
initializeTextSelectionWebView(m_baseURL + "select_range_span_editable.html", &webViewHelper);
- frame = webViewHelper.webView()->mainFrame()->toWebLocalFrame();
+ frame = webViewHelper.webView()->mainFrameImpl();
webViewHelper.webView()->selectionBounds(startWebRect, endWebRect);
frame->selectRange(topLeft(startWebRect), bottomRightMinusOne(endWebRect));
@@ -4239,7 +4239,7 @@ TEST_P(ParameterizedWebFrameTest, SelectRangeCanMoveSelectionStart)
registerMockedHttpURLLoad("text_selection.html");
FrameTestHelpers::WebViewHelper webViewHelper(this);
initializeTextSelectionWebView(m_baseURL + "text_selection.html", &webViewHelper);
- WebLocalFrame* frame = webViewHelper.webView()->mainFrame()->toWebLocalFrame();
+ WebLocalFrame* frame = webViewHelper.webView()->mainFrameImpl();
// Select second span. We can move the start to include the first span.
frame->executeScript(WebScriptSource("selectElement('header_2');"));
@@ -4287,7 +4287,7 @@ TEST_P(ParameterizedWebFrameTest, SelectRangeCanMoveSelectionEnd)
registerMockedHttpURLLoad("text_selection.html");
FrameTestHelpers::WebViewHelper webViewHelper(this);
initializeTextSelectionWebView(m_baseURL + "text_selection.html", &webViewHelper);
- WebLocalFrame* frame = webViewHelper.webView()->mainFrame()->toWebLocalFrame();
+ WebLocalFrame* frame = webViewHelper.webView()->mainFrameImpl();
// Select first span. We can move the end to include the second span.
frame->executeScript(WebScriptSource("selectElement('header_1');"));
@@ -4340,7 +4340,7 @@ TEST_P(ParameterizedWebFrameTest, MoveRangeSelectionExtent)
FrameTestHelpers::WebViewHelper webViewHelper(this);
initializeTextSelectionWebView(m_baseURL + "move_range_selection_extent.html", &webViewHelper);
- frame = toWebLocalFrameImpl(webViewHelper.webView()->mainFrame());
+ frame = webViewHelper.webView()->mainFrameImpl();
EXPECT_EQ("This text is initially selected.", selectionAsString(frame));
webViewHelper.webView()->selectionBounds(startWebRect, endWebRect);
@@ -4374,7 +4374,7 @@ TEST_P(ParameterizedWebFrameTest, MoveRangeSelectionExtentCannotCollapse)
FrameTestHelpers::WebViewHelper webViewHelper(this);
initializeTextSelectionWebView(m_baseURL + "move_range_selection_extent.html", &webViewHelper);
- frame = toWebLocalFrameImpl(webViewHelper.webView()->mainFrame());
+ frame = webViewHelper.webView()->mainFrameImpl();
EXPECT_EQ("This text is initially selected.", selectionAsString(frame));
webViewHelper.webView()->selectionBounds(startWebRect, endWebRect);
@@ -4399,7 +4399,7 @@ TEST_P(ParameterizedWebFrameTest, MoveRangeSelectionExtentScollsInputField)
FrameTestHelpers::WebViewHelper webViewHelper(this);
initializeTextSelectionWebView(m_baseURL + "move_range_selection_extent_input_field.html", &webViewHelper);
- frame = toWebLocalFrameImpl(webViewHelper.webView()->mainFrame());
+ frame = webViewHelper.webView()->mainFrameImpl();
EXPECT_EQ("Length", selectionAsString(frame));
webViewHelper.webView()->selectionBounds(startWebRect, endWebRect);
@@ -4421,14 +4421,14 @@ TEST_P(ParameterizedWebFrameTest, DISABLED_PositionForPointTest)
registerMockedHttpURLLoad("select_range_span_editable.html");
FrameTestHelpers::WebViewHelper webViewHelper(this);
initializeTextSelectionWebView(m_baseURL + "select_range_span_editable.html", &webViewHelper);
- WebLocalFrameImpl* mainFrame = toWebLocalFrameImpl(webViewHelper.webView()->mainFrame());
+ WebLocalFrameImpl* mainFrame = webViewHelper.webView()->mainFrameImpl();
LayoutObject* layoutObject = mainFrame->frame()->selection().rootEditableElement()->layoutObject();
EXPECT_EQ(0, computeOffset(layoutObject, -1, -1));
EXPECT_EQ(64, computeOffset(layoutObject, 1000, 1000));
registerMockedHttpURLLoad("select_range_div_editable.html");
initializeTextSelectionWebView(m_baseURL + "select_range_div_editable.html", &webViewHelper);
- mainFrame = toWebLocalFrameImpl(webViewHelper.webView()->mainFrame());
+ mainFrame = webViewHelper.webView()->mainFrameImpl();
layoutObject = mainFrame->frame()->selection().rootEditableElement()->layoutObject();
EXPECT_EQ(0, computeOffset(layoutObject, -1, -1));
EXPECT_EQ(64, computeOffset(layoutObject, 1000, 1000));
@@ -4441,7 +4441,7 @@ TEST_P(ParameterizedWebFrameTest, SelectRangeStaysHorizontallyAlignedWhenMoved)
FrameTestHelpers::WebViewHelper webViewHelper(this);
initializeTextSelectionWebView(m_baseURL + "move_caret.html", &webViewHelper);
- WebLocalFrameImpl* frame = toWebLocalFrameImpl(webViewHelper.webView()->mainFrame());
+ WebLocalFrameImpl* frame = webViewHelper.webView()->mainFrameImpl();
WebRect initialStartRect;
WebRect initialEndRect;
@@ -4580,7 +4580,7 @@ protected:
const WebSelectionBound* selectEnd = m_fakeSelectionLayerTreeView.end();
v8::HandleScope handleScope(v8::Isolate::GetCurrent());
- v8::Local<v8::Value> result = m_webViewHelper.webView()->mainFrame()->toWebLocalFrame()->executeScriptAndReturnValue(WebScriptSource("expectedResult"));
+ v8::Local<v8::Value> result = m_webViewHelper.webView()->mainFrameImpl()->executeScriptAndReturnValue(WebScriptSource("expectedResult"));
if (result.IsEmpty() || (*result)->IsUndefined()) {
EXPECT_FALSE(selection);
EXPECT_FALSE(selectStart);
@@ -4689,7 +4689,7 @@ TEST_P(ParameterizedWebFrameTest, CompositedSelectionBoundsCleared)
FrameTestHelpers::loadFrame(webViewHelper.webView()->mainFrame(), m_baseURL + "select_range_basic.html");
// The frame starts with no selection.
- WebLocalFrame* frame = webViewHelper.webView()->mainFrame()->toWebLocalFrame();
+ WebLocalFrame* frame = webViewHelper.webView()->mainFrameImpl();
ASSERT_TRUE(frame->hasSelection());
EXPECT_TRUE(fakeSelectionLayerTreeView.getAndResetSelectionCleared());
@@ -4712,7 +4712,7 @@ TEST_P(ParameterizedWebFrameTest, CompositedSelectionBoundsCleared)
// Transitions between non-empty selections should not trigger a clearing.
WebRect startWebRect;
WebRect endWebRect;
- webViewHelper.webViewImpl()->selectionBounds(startWebRect, endWebRect);
+ webViewHelper.webView()->selectionBounds(startWebRect, endWebRect);
WebPoint movedEnd(bottomRightMinusOne(endWebRect));
endWebRect.x -= 20;
frame->selectRange(topLeft(startWebRect), movedEnd);
@@ -4720,7 +4720,7 @@ TEST_P(ParameterizedWebFrameTest, CompositedSelectionBoundsCleared)
ASSERT_TRUE(frame->hasSelection());
EXPECT_FALSE(fakeSelectionLayerTreeView.getAndResetSelectionCleared());
- frame = webViewHelper.webView()->mainFrame()->toWebLocalFrame();
+ frame = webViewHelper.webView()->mainFrameImpl();
frame->executeCommand(WebString::fromUTF8("Unselect"));
webViewHelper.webView()->updateAllLifecyclePhases();
ASSERT_FALSE(frame->hasSelection());
@@ -4902,7 +4902,7 @@ TEST_F(WebFrameTest, DisambiguationPopupVisualViewport)
FrameTestHelpers::WebViewHelper webViewHelper;
webViewHelper.initializeAndLoad(m_baseURL + htmlFile, true, nullptr, &client, nullptr, configureAndroid);
- WebViewImpl* webViewImpl = webViewHelper.webViewImpl();
+ WebViewImpl* webViewImpl = webViewHelper.webView();
ASSERT_TRUE(webViewImpl);
LocalFrame* frame = webViewImpl->mainFrameImpl()->frame();
ASSERT_TRUE(frame);
@@ -5147,7 +5147,7 @@ TEST_P(ParameterizedWebFrameTest, ReplaceMisspelledRange)
SpellCheckClient spellcheck;
webViewHelper.webView()->setSpellCheckClient(&spellcheck);
- WebLocalFrameImpl* frame = toWebLocalFrameImpl(webViewHelper.webView()->mainFrame());
+ WebLocalFrameImpl* frame = webViewHelper.webView()->mainFrameImpl();
Document* document = frame->frame()->document();
Element* element = document->getElementById("data");
@@ -5179,7 +5179,7 @@ TEST_P(ParameterizedWebFrameTest, RemoveSpellingMarkers)
SpellCheckClient spellcheck;
webViewHelper.webView()->setSpellCheckClient(&spellcheck);
- WebLocalFrameImpl* frame = toWebLocalFrameImpl(webViewHelper.webView()->mainFrame());
+ WebLocalFrameImpl* frame = webViewHelper.webView()->mainFrameImpl();
Document* document = frame->frame()->document();
Element* element = document->getElementById("data");
@@ -5209,7 +5209,7 @@ TEST_P(ParameterizedWebFrameTest, RemoveSpellingMarkersUnderWords)
SpellCheckClient spellcheck;
webViewHelper.webView()->setSpellCheckClient(&spellcheck);
- LocalFrame* frame = toWebLocalFrameImpl(webViewHelper.webView()->mainFrame())->frame();
+ LocalFrame* frame = webViewHelper.webView()->mainFrameImpl()->frame();
Document* document = frame->document();
Element* element = document->getElementById("data");
@@ -5244,7 +5244,7 @@ TEST_P(ParameterizedWebFrameTest, MarkerHashIdentifiers)
SpellCheckClient spellcheck(kHash);
webViewHelper.webView()->setSpellCheckClient(&spellcheck);
- WebLocalFrameImpl* frame = toWebLocalFrameImpl(webViewHelper.webView()->mainFrame());
+ WebLocalFrameImpl* frame = webViewHelper.webView()->mainFrameImpl();
Document* document = frame->frame()->document();
Element* element = document->getElementById("data");
@@ -5320,7 +5320,7 @@ TEST_P(ParameterizedWebFrameTest, SlowSpellcheckMarkerPosition)
StubbornSpellCheckClient spellcheck;
webViewHelper.webView()->setSpellCheckClient(&spellcheck);
- WebLocalFrameImpl* frame = toWebLocalFrameImpl(webViewHelper.webView()->mainFrame());
+ WebLocalFrameImpl* frame = webViewHelper.webView()->mainFrameImpl();
Document* document = frame->frame()->document();
Element* element = document->getElementById("data");
@@ -5350,7 +5350,7 @@ TEST_P(ParameterizedWebFrameTest, CancelSpellingRequestCrash)
webViewHelper.initializeAndLoad(m_baseURL + "spell.html");
webViewHelper.webView()->setSpellCheckClient(0);
- WebLocalFrameImpl* frame = toWebLocalFrameImpl(webViewHelper.webView()->mainFrame());
+ WebLocalFrameImpl* frame = webViewHelper.webView()->mainFrameImpl();
Document* document = frame->frame()->document();
Element* element = document->getElementById("data");
@@ -5371,7 +5371,7 @@ TEST_P(ParameterizedWebFrameTest, SpellcheckResultErasesMarkers)
StubbornSpellCheckClient spellcheck;
webViewHelper.webView()->setSpellCheckClient(&spellcheck);
- WebLocalFrameImpl* frame = toWebLocalFrameImpl(webViewHelper.webView()->mainFrame());
+ WebLocalFrameImpl* frame = webViewHelper.webView()->mainFrameImpl();
Document* document = frame->frame()->document();
Element* element = document->getElementById("data");
@@ -5401,7 +5401,7 @@ TEST_P(ParameterizedWebFrameTest, SpellcheckResultsSavedInDocument)
StubbornSpellCheckClient spellcheck;
webViewHelper.webView()->setSpellCheckClient(&spellcheck);
- WebLocalFrameImpl* frame = toWebLocalFrameImpl(webViewHelper.webView()->mainFrame());
+ WebLocalFrameImpl* frame = webViewHelper.webView()->mainFrameImpl();
Document* document = frame->frame()->document();
Element* element = document->getElementById("data");
@@ -5635,7 +5635,7 @@ TEST_P(ParameterizedWebFrameTest, CompositorScrollIsUserScrollLongPage)
webViewHelper.initializeAndLoad(m_baseURL + "long_scroll.html", true, &client);
webViewHelper.resize(WebSize(1000, 1000));
- WebLocalFrameImpl* frameImpl = webViewHelper.webViewImpl()->mainFrameImpl();
+ WebLocalFrameImpl* frameImpl = webViewHelper.webView()->mainFrameImpl();
DocumentLoader::InitialScrollState& initialScrollState =
frameImpl->frame()->loader().documentLoader()->initialScrollState();
GraphicsLayer* frameViewLayer = frameImpl->frameView()->layerForScrolling();
@@ -5646,7 +5646,7 @@ TEST_P(ParameterizedWebFrameTest, CompositorScrollIsUserScrollLongPage)
// Do a compositor scroll, verify that this is counted as a user scroll.
frameViewLayer->platformLayer()->setScrollPositionDouble(WebDoublePoint(0, 1));
frameViewLayer->didScroll();
- webViewHelper.webViewImpl()->applyViewportDeltas(WebFloatSize(), WebFloatSize(), WebFloatSize(), 1.7f, 0);
+ webViewHelper.webView()->applyViewportDeltas(WebFloatSize(), WebFloatSize(), WebFloatSize(), 1.7f, 0);
EXPECT_TRUE(client.wasFrameScrolled());
EXPECT_TRUE(initialScrollState.wasScrolledByUser);
@@ -5656,7 +5656,7 @@ TEST_P(ParameterizedWebFrameTest, CompositorScrollIsUserScrollLongPage)
// The page scale 1.0f and scroll.
frameViewLayer->platformLayer()->setScrollPositionDouble(WebDoublePoint(0, 2));
frameViewLayer->didScroll();
- webViewHelper.webViewImpl()->applyViewportDeltas(WebFloatSize(), WebFloatSize(), WebFloatSize(), 1.0f, 0);
+ webViewHelper.webView()->applyViewportDeltas(WebFloatSize(), WebFloatSize(), WebFloatSize(), 1.0f, 0);
EXPECT_TRUE(client.wasFrameScrolled());
EXPECT_TRUE(initialScrollState.wasScrolledByUser);
client.reset();
@@ -5664,7 +5664,7 @@ TEST_P(ParameterizedWebFrameTest, CompositorScrollIsUserScrollLongPage)
// No scroll event if there is no scroll delta.
frameViewLayer->didScroll();
- webViewHelper.webViewImpl()->applyViewportDeltas(WebFloatSize(), WebFloatSize(), WebFloatSize(), 1.0f, 0);
+ webViewHelper.webView()->applyViewportDeltas(WebFloatSize(), WebFloatSize(), WebFloatSize(), 1.0f, 0);
EXPECT_FALSE(client.wasFrameScrolled());
EXPECT_FALSE(initialScrollState.wasScrolledByUser);
client.reset();
@@ -5672,7 +5672,7 @@ TEST_P(ParameterizedWebFrameTest, CompositorScrollIsUserScrollLongPage)
// Non zero page scale and scroll.
frameViewLayer->platformLayer()->setScrollPositionDouble(WebDoublePoint(9, 15));
frameViewLayer->didScroll();
- webViewHelper.webViewImpl()->applyViewportDeltas(WebFloatSize(), WebFloatSize(), WebFloatSize(), 0.6f, 0);
+ webViewHelper.webView()->applyViewportDeltas(WebFloatSize(), WebFloatSize(), WebFloatSize(), 0.6f, 0);
EXPECT_TRUE(client.wasFrameScrolled());
EXPECT_TRUE(initialScrollState.wasScrolledByUser);
client.reset();
@@ -5730,7 +5730,7 @@ TEST_P(ParameterizedWebFrameTest, SimulateFragmentAnchorMiddleClick)
FrameTestHelpers::WebViewHelper webViewHelper(this);
webViewHelper.initializeAndLoad(m_baseURL + "fragment_middle_click.html", true, &client);
- Document* document = toLocalFrame(webViewHelper.webViewImpl()->page()->mainFrame())->document();
+ Document* document = toLocalFrame(webViewHelper.webView()->page()->mainFrame())->document();
KURL destination = document->url();
destination.setFragmentIdentifier("test");
@@ -5739,7 +5739,7 @@ TEST_P(ParameterizedWebFrameTest, SimulateFragmentAnchorMiddleClick)
PlatformMouseEvent::RealOrIndistinguishable, String());
FrameLoadRequest frameRequest(document, ResourceRequest(destination));
frameRequest.setTriggeringEvent(event);
- toLocalFrame(webViewHelper.webViewImpl()->page()->mainFrame())->loader().load(frameRequest);
+ toLocalFrame(webViewHelper.webView()->page()->mainFrame())->loader().load(frameRequest);
}
class TestNewWindowWebViewClient : public FrameTestHelpers::TestWebViewClient {
@@ -5780,7 +5780,7 @@ TEST_P(ParameterizedWebFrameTest, ModifiedClickNewWindow)
FrameTestHelpers::WebViewHelper webViewHelper(this);
webViewHelper.initializeAndLoad(m_baseURL + "ctrl_click.html", true, &webFrameClient, &webViewClient);
- Document* document = toLocalFrame(webViewHelper.webViewImpl()->page()->mainFrame())->document();
+ Document* document = toLocalFrame(webViewHelper.webView()->page()->mainFrame())->document();
KURL destination = toKURL(m_baseURL + "hello_world.html");
// ctrl+click event
@@ -5790,7 +5790,7 @@ TEST_P(ParameterizedWebFrameTest, ModifiedClickNewWindow)
FrameLoadRequest frameRequest(document, ResourceRequest(destination));
frameRequest.setTriggeringEvent(event);
UserGestureIndicator gesture(DefinitelyProcessingUserGesture);
- toLocalFrame(webViewHelper.webViewImpl()->page()->mainFrame())->loader().load(frameRequest);
+ toLocalFrame(webViewHelper.webView()->page()->mainFrame())->loader().load(frameRequest);
FrameTestHelpers::pumpPendingRequestsForFrameToLoad(webViewHelper.webView()->mainFrame());
// decidePolicyForNavigation should be called both for the original request and the ctrl+click.
@@ -5803,7 +5803,7 @@ TEST_P(ParameterizedWebFrameTest, BackToReload)
FrameTestHelpers::WebViewHelper webViewHelper(this);
webViewHelper.initializeAndLoad(m_baseURL + "fragment_middle_click.html", true);
WebFrame* frame = webViewHelper.webView()->mainFrame();
- const FrameLoader& mainFrameLoader = webViewHelper.webViewImpl()->mainFrameImpl()->frame()->loader();
+ const FrameLoader& mainFrameLoader = webViewHelper.webView()->mainFrameImpl()->frame()->loader();
Persistent<HistoryItem> firstItem = mainFrameLoader.currentItem();
EXPECT_TRUE(firstItem);
@@ -5823,8 +5823,8 @@ TEST_P(ParameterizedWebFrameTest, BackDuringChildFrameReload)
registerMockedHttpURLLoad("page_with_blank_iframe.html");
FrameTestHelpers::WebViewHelper webViewHelper(this);
webViewHelper.initializeAndLoad(m_baseURL + "page_with_blank_iframe.html", true);
- WebFrame* mainFrame = webViewHelper.webView()->mainFrame();
- const FrameLoader& mainFrameLoader = webViewHelper.webViewImpl()->mainFrameImpl()->frame()->loader();
+ WebLocalFrame* mainFrame = webViewHelper.webView()->mainFrameImpl();
+ const FrameLoader& mainFrameLoader = webViewHelper.webView()->mainFrameImpl()->frame()->loader();
WebFrame* childFrame = mainFrame->firstChild();
ASSERT_TRUE(childFrame);
@@ -5837,8 +5837,8 @@ TEST_P(ParameterizedWebFrameTest, BackDuringChildFrameReload)
item.initialize();
WebURL historyURL(toKURL(m_baseURL + "white-1x1.png"));
item.setURLString(historyURL.string());
- WebURLRequest request = mainFrame->toWebLocalFrame()->requestFromHistoryItem(item, WebCachePolicy::UseProtocolCachePolicy);
- mainFrame->toWebLocalFrame()->load(request, WebFrameLoadType::BackForward, item);
+ WebURLRequest request = mainFrame->requestFromHistoryItem(item, WebCachePolicy::UseProtocolCachePolicy);
+ mainFrame->load(request, WebFrameLoadType::BackForward, item);
FrameTestHelpers::reloadFrame(childFrame);
EXPECT_EQ(item.urlString(), mainFrame->document().url().string());
@@ -5869,7 +5869,7 @@ TEST_P(ParameterizedWebFrameTest, LoadHistoryItemReload)
FrameTestHelpers::WebViewHelper webViewHelper(this);
webViewHelper.initializeAndLoad(m_baseURL + "fragment_middle_click.html", true);
WebFrame* frame = webViewHelper.webView()->mainFrame();
- const FrameLoader& mainFrameLoader = webViewHelper.webViewImpl()->mainFrameImpl()->frame()->loader();
+ const FrameLoader& mainFrameLoader = webViewHelper.webView()->mainFrameImpl()->frame()->loader();
Persistent<HistoryItem> firstItem = mainFrameLoader.currentItem();
EXPECT_TRUE(firstItem);
@@ -5953,7 +5953,7 @@ TEST_P(ParameterizedWebFrameTest, ReloadIframe)
FrameTestHelpers::WebViewHelper webViewHelper(this);
webViewHelper.initializeAndLoad(m_baseURL + "iframe_reload.html", true, &mainClient);
- WebLocalFrameImpl* mainFrame = webViewHelper.webViewImpl()->mainFrameImpl();
+ WebLocalFrameImpl* mainFrame = webViewHelper.webView()->mainFrameImpl();
WebLocalFrameImpl* childFrame = toWebLocalFrameImpl(mainFrame->firstChild());
ASSERT_EQ(childFrame->client(), &childClient);
EXPECT_EQ(mainClient.childFrameCreationCount(), 1);
@@ -5998,8 +5998,8 @@ TEST_P(ParameterizedWebFrameTest, NavigateToSame)
webViewHelper.initializeAndLoad(m_baseURL + "navigate_to_same.html", true, &client);
EXPECT_FALSE(client.frameLoadTypeReloadMainResourceSeen());
- FrameLoadRequest frameRequest(0, ResourceRequest(toLocalFrame(webViewHelper.webViewImpl()->page()->mainFrame())->document()->url()));
- toLocalFrame(webViewHelper.webViewImpl()->page()->mainFrame())->loader().load(frameRequest);
+ FrameLoadRequest frameRequest(0, ResourceRequest(toLocalFrame(webViewHelper.webView()->page()->mainFrame())->document()->url()));
+ toLocalFrame(webViewHelper.webView()->page()->mainFrame())->loader().load(frameRequest);
FrameTestHelpers::pumpPendingRequestsForFrameToLoad(webViewHelper.webView()->mainFrame());
EXPECT_TRUE(client.frameLoadTypeReloadMainResourceSeen());
@@ -6241,7 +6241,7 @@ TEST_F(WebFrameTest, overflowHiddenRewrite)
webViewHelper.resize(WebSize(100, 100));
FrameTestHelpers::loadFrame(webViewHelper.webView()->mainFrame(), m_baseURL + "non-scrollable.html");
- PaintLayerCompositor* compositor = webViewHelper.webViewImpl()->compositor();
+ PaintLayerCompositor* compositor = webViewHelper.webView()->compositor();
ASSERT_TRUE(compositor->scrollLayer());
// Verify that the WebLayer is not scrollable initially.
@@ -6267,7 +6267,7 @@ TEST_P(ParameterizedWebFrameTest, CurrentHistoryItem)
FrameTestHelpers::WebViewHelper webViewHelper(this);
webViewHelper.initialize();
WebFrame* frame = webViewHelper.webView()->mainFrame();
- const FrameLoader& mainFrameLoader = webViewHelper.webViewImpl()->mainFrameImpl()->frame()->loader();
+ const FrameLoader& mainFrameLoader = webViewHelper.webView()->mainFrameImpl()->frame()->loader();
WebURLRequest request;
request.setURL(toKURL(url));
request.setRequestorOrigin(WebSecurityOrigin::createUnique());
@@ -6317,10 +6317,10 @@ TEST_P(ParameterizedWebFrameTest, fixedPositionInFixedViewport)
FrameTestHelpers::WebViewHelper webViewHelper(this);
webViewHelper.initializeAndLoad(m_baseURL + "fixed-position-in-fixed-viewport.html", true, nullptr, nullptr, nullptr, enableViewportSettings);
- WebView* webView = webViewHelper.webView();
+ WebViewImpl* webView = webViewHelper.webView();
webViewHelper.resize(WebSize(100, 100));
- Document* document = toWebLocalFrameImpl(webView->mainFrame())->frame()->document();
+ Document* document = webView->mainFrameImpl()->frame()->document();
Element* bottomFixed = document->getElementById("bottom-fixed");
Element* topBottomFixed = document->getElementById("top-bottom-fixed");
Element* rightFixed = document->getElementById("right-fixed");
@@ -6342,9 +6342,9 @@ TEST_P(ParameterizedWebFrameTest, FrameViewMoveWithSetFrameRect)
FrameTestHelpers::WebViewHelper webViewHelper(this);
webViewHelper.initializeAndLoad("about:blank");
webViewHelper.resize(WebSize(200, 200));
- webViewHelper.webViewImpl()->updateAllLifecyclePhases();
+ webViewHelper.webView()->updateAllLifecyclePhases();
- FrameView* frameView = webViewHelper.webViewImpl()->mainFrameImpl()->frameView();
+ FrameView* frameView = webViewHelper.webView()->mainFrameImpl()->frameView();
EXPECT_RECT_EQ(IntRect(0, 0, 200, 200), frameView->frameRect());
frameView->setFrameRect(IntRect(100, 100, 200, 200));
EXPECT_RECT_EQ(IntRect(100, 100, 200, 200), frameView->frameRect());
@@ -6357,8 +6357,8 @@ TEST_F(WebFrameTest, FrameViewScrollAccountsForTopControls)
FrameTestHelpers::WebViewHelper webViewHelper;
webViewHelper.initializeAndLoad(m_baseURL + "long_scroll.html", true, nullptr, &client, nullptr, configureAndroid);
- WebViewImpl* webView = webViewHelper.webViewImpl();
- FrameView* frameView = webViewHelper.webViewImpl()->mainFrameImpl()->frameView();
+ WebViewImpl* webView = webViewHelper.webView();
+ FrameView* frameView = webViewHelper.webView()->mainFrameImpl()->frameView();
float topControlsHeight = 40;
webView->resizeWithTopControls(WebSize(100, 100), topControlsHeight, false);
@@ -6429,7 +6429,7 @@ TEST_F(WebFrameTest, MaximumScrollPositionCanBeNegative)
webViewHelper.resize(WebSize(viewportWidth, viewportHeight));
webViewHelper.webView()->updateAllLifecyclePhases();
- FrameView* frameView = webViewHelper.webViewImpl()->mainFrameImpl()->frameView();
+ FrameView* frameView = webViewHelper.webView()->mainFrameImpl()->frameView();
EXPECT_LT(frameView->maximumScrollPosition().x(), 0);
}
@@ -6448,7 +6448,7 @@ TEST_F(WebFrameTest, FullscreenCleanTopLayerAndFullscreenStack)
webViewImpl->updateAllLifecyclePhases();
UserGestureIndicator gesture(DefinitelyProcessingUserGesture);
- Document* document = toWebLocalFrameImpl(webViewImpl->mainFrame())->frame()->document();
+ Document* document = webViewImpl->mainFrameImpl()->frame()->document();
Fullscreen& fullscreen = Fullscreen::from(*document);
Element* divFullscreen = document->getElementById("div1");
@@ -6480,7 +6480,7 @@ TEST_P(ParameterizedWebFrameTest, FullscreenLayerSize)
webViewHelper.resize(WebSize(viewportWidth, viewportHeight));
webViewImpl->updateAllLifecyclePhases();
- Document* document = toWebLocalFrameImpl(webViewImpl->mainFrame())->frame()->document();
+ Document* document = webViewImpl->mainFrameImpl()->frame()->document();
UserGestureIndicator gesture(DefinitelyProcessingUserGesture);
Element* divFullscreen = document->getElementById("div1");
Fullscreen::from(*document).requestFullscreen(*divFullscreen, Fullscreen::PrefixedRequest);
@@ -6514,7 +6514,7 @@ TEST_F(WebFrameTest, FullscreenLayerNonScrollable)
webViewHelper.resize(WebSize(viewportWidth, viewportHeight));
webViewImpl->updateAllLifecyclePhases();
- Document* document = toWebLocalFrameImpl(webViewImpl->mainFrame())->frame()->document();
+ Document* document = webViewImpl->mainFrameImpl()->frame()->document();
UserGestureIndicator gesture(DefinitelyProcessingUserGesture);
Element* divFullscreen = document->getElementById("div1");
Fullscreen::from(*document).requestFullscreen(*divFullscreen, Fullscreen::PrefixedRequest);
@@ -6523,7 +6523,7 @@ TEST_F(WebFrameTest, FullscreenLayerNonScrollable)
// Verify that the viewports are nonscrollable.
ASSERT_TRUE(Fullscreen::isFullScreen(*document));
- FrameView* frameView = webViewHelper.webViewImpl()->mainFrameImpl()->frameView();
+ FrameView* frameView = webViewHelper.webView()->mainFrameImpl()->frameView();
WebLayer* layoutViewportScrollLayer = webViewImpl->compositor()->scrollLayer()->platformLayer();
WebLayer* visualViewportScrollLayer = frameView->page()->frameHost().visualViewport().scrollLayer()->platformLayer();
ASSERT_FALSE(layoutViewportScrollLayer->userScrollableHorizontal());
@@ -6552,7 +6552,7 @@ TEST_P(ParameterizedWebFrameTest, FullscreenMainFrame)
webViewHelper.resize(WebSize(viewportWidth, viewportHeight));
webViewImpl->updateAllLifecyclePhases();
- Document* document = toWebLocalFrameImpl(webViewImpl->mainFrame())->frame()->document();
+ Document* document = webViewImpl->mainFrameImpl()->frame()->document();
UserGestureIndicator gesture(DefinitelyProcessingUserGesture);
Fullscreen::from(*document).requestFullscreen(*document->documentElement(), Fullscreen::PrefixedRequest);
webViewImpl->didEnterFullscreen();
@@ -6621,14 +6621,14 @@ TEST_P(ParameterizedWebFrameTest, FullscreenWithTinyViewport)
webViewHelper.resize(WebSize(viewportWidth, viewportHeight));
webViewImpl->updateAllLifecyclePhases();
- LayoutViewItem layoutViewItem = webViewHelper.webViewImpl()->mainFrameImpl()->frameView()->layoutViewItem();
+ LayoutViewItem layoutViewItem = webViewHelper.webView()->mainFrameImpl()->frameView()->layoutViewItem();
EXPECT_EQ(320, layoutViewItem.logicalWidth().floor());
EXPECT_EQ(533, layoutViewItem.logicalHeight().floor());
EXPECT_FLOAT_EQ(1.2, webViewImpl->pageScaleFactor());
EXPECT_FLOAT_EQ(1.2, webViewImpl->minimumPageScaleFactor());
EXPECT_FLOAT_EQ(5.0, webViewImpl->maximumPageScaleFactor());
- Document* document = toWebLocalFrameImpl(webViewImpl->mainFrame())->frame()->document();
+ Document* document = webViewImpl->mainFrameImpl()->frame()->document();
UserGestureIndicator gesture(DefinitelyProcessingUserGesture);
Fullscreen::from(*document).requestFullscreen(*document->documentElement(), Fullscreen::PrefixedRequest);
webViewImpl->didEnterFullscreen();
@@ -6661,8 +6661,8 @@ TEST_P(ParameterizedWebFrameTest, FullscreenResizeWithTinyViewport)
webViewHelper.resize(WebSize(viewportWidth, viewportHeight));
webViewImpl->updateAllLifecyclePhases();
- LayoutViewItem layoutViewItem = webViewHelper.webViewImpl()->mainFrameImpl()->frameView()->layoutViewItem();
- Document* document = toWebLocalFrameImpl(webViewImpl->mainFrame())->frame()->document();
+ LayoutViewItem layoutViewItem = webViewHelper.webView()->mainFrameImpl()->frameView()->layoutViewItem();
+ Document* document = webViewImpl->mainFrameImpl()->frame()->document();
UserGestureIndicator gesture(DefinitelyProcessingUserGesture);
Fullscreen::from(*document).requestFullscreen(*document->documentElement(), Fullscreen::PrefixedRequest);
webViewImpl->didEnterFullscreen();
@@ -6711,7 +6711,7 @@ TEST_P(ParameterizedWebFrameTest, FullscreenRestoreScaleFactorUponExiting)
client.m_screenInfo.rect.width = screenSizeMinusStatusBarsMinusUrlBar.width;
client.m_screenInfo.rect.height = screenSizeMinusStatusBarsMinusUrlBar.height;
webViewHelper.resize(screenSizeMinusStatusBarsMinusUrlBar);
- LayoutViewItem layoutViewItem = webViewHelper.webViewImpl()->mainFrameImpl()->frameView()->layoutViewItem();
+ LayoutViewItem layoutViewItem = webViewHelper.webView()->mainFrameImpl()->frameView()->layoutViewItem();
EXPECT_EQ(screenSizeMinusStatusBarsMinusUrlBar.width, layoutViewItem.logicalWidth().floor());
EXPECT_EQ(screenSizeMinusStatusBarsMinusUrlBar.height, layoutViewItem.logicalHeight().floor());
EXPECT_FLOAT_EQ(1.0, webViewImpl->pageScaleFactor());
@@ -6719,7 +6719,7 @@ TEST_P(ParameterizedWebFrameTest, FullscreenRestoreScaleFactorUponExiting)
EXPECT_FLOAT_EQ(5.0, webViewImpl->maximumPageScaleFactor());
{
- Document* document = toWebLocalFrameImpl(webViewImpl->mainFrame())->frame()->document();
+ Document* document = webViewImpl->mainFrameImpl()->frame()->document();
UserGestureIndicator gesture(DefinitelyProcessingUserGesture);
Fullscreen::from(*document).requestFullscreen(*document->body(), Fullscreen::PrefixedRequest);
}
@@ -6784,7 +6784,7 @@ TEST_P(ParameterizedWebFrameTest, ClearFullscreenConstraintsOnNavigation)
EXPECT_FLOAT_EQ(5.0, webViewImpl->maximumPageScaleFactor());
Document* document =
- toWebLocalFrameImpl(webViewImpl->mainFrame())->frame()->document();
+ webViewImpl->mainFrameImpl()->frame()->document();
UserGestureIndicator gesture(DefinitelyProcessingUserGesture);
Fullscreen::from(*document).requestFullscreen(
*document->documentElement(), Fullscreen::PrefixedRequest);
@@ -6824,11 +6824,11 @@ TEST_P(ParameterizedWebFrameTest, LayoutBlockPercentHeightDescendants)
FrameTestHelpers::WebViewHelper webViewHelper(this);
webViewHelper.initializeAndLoad(m_baseURL + "percent-height-descendants.html");
- WebView* webView = webViewHelper.webView();
+ WebViewImpl* webView = webViewHelper.webView();
webViewHelper.resize(WebSize(800, 800));
webView->updateAllLifecyclePhases();
- Document* document = toWebLocalFrameImpl(webView->mainFrame())->frame()->document();
+ Document* document = webView->mainFrameImpl()->frame()->document();
LayoutBlock* container = toLayoutBlock(document->getElementById("container")->layoutObject());
LayoutBox* percentHeightInAnonymous = toLayoutBox(document->getElementById("percent-height-in-anonymous")->layoutObject());
LayoutBox* percentHeightDirectChild = toLayoutBox(document->getElementById("percent-height-direct-child")->layoutObject());
@@ -6907,7 +6907,7 @@ TEST_P(ParameterizedWebFrameTest, ManifestFetch)
FrameTestHelpers::WebViewHelper webViewHelper(this);
webViewHelper.initializeAndLoad(m_baseURL + "foo.html");
- Document* document = toWebLocalFrameImpl(webViewHelper.webViewImpl()->mainFrame())->frame()->document();
+ Document* document = webViewHelper.webView()->mainFrameImpl()->frame()->document();
Resource* resource = fetchManifest(document, toKURL(m_baseURL + "link-manifest-fetch.json"));
@@ -6921,7 +6921,7 @@ TEST_P(ParameterizedWebFrameTest, ManifestCSPFetchAllow)
FrameTestHelpers::WebViewHelper webViewHelper(this);
webViewHelper.initializeAndLoad(m_baseURL + "foo.html");
- Document* document = toWebLocalFrameImpl(webViewHelper.webViewImpl()->mainFrame())->frame()->document();
+ Document* document = webViewHelper.webView()->mainFrameImpl()->frame()->document();
Resource* resource = fetchManifest(document, toKURL(m_notBaseURL + "link-manifest-fetch.json"));
@@ -6935,7 +6935,7 @@ TEST_P(ParameterizedWebFrameTest, ManifestCSPFetchSelf)
FrameTestHelpers::WebViewHelper webViewHelper(this);
webViewHelper.initializeAndLoad(m_baseURL + "foo.html");
- Document* document = toWebLocalFrameImpl(webViewHelper.webViewImpl()->mainFrame())->frame()->document();
+ Document* document = webViewHelper.webView()->mainFrameImpl()->frame()->document();
Resource* resource = fetchManifest(document, toKURL(m_notBaseURL + "link-manifest-fetch.json"));
@@ -6949,7 +6949,7 @@ TEST_P(ParameterizedWebFrameTest, ManifestCSPFetchSelfReportOnly)
FrameTestHelpers::WebViewHelper webViewHelper(this);
webViewHelper.initializeAndLoad(m_baseURL + "foo.html");
- Document* document = toWebLocalFrameImpl(webViewHelper.webViewImpl()->mainFrame())->frame()->document();
+ Document* document = webViewHelper.webView()->mainFrameImpl()->frame()->document();
Resource* resource = fetchManifest(document, toKURL(m_notBaseURL + "link-manifest-fetch.json"));
@@ -7082,7 +7082,7 @@ TEST_P(ParameterizedWebFrameTest, ThemeColor)
ThemeColorTestWebFrameClient client;
webViewHelper.initializeAndLoad(m_baseURL + "theme_color_test.html", true, &client);
EXPECT_TRUE(client.didNotify());
- WebLocalFrameImpl* frame = webViewHelper.webViewImpl()->mainFrameImpl();
+ WebLocalFrameImpl* frame = webViewHelper.webView()->mainFrameImpl();
EXPECT_EQ(0xff0000ff, frame->document().themeColor());
// Change color by rgb.
client.reset();
@@ -7633,11 +7633,11 @@ TEST_F(WebFrameSwapTest, UniqueNameAfterRemoteToLocalSwap)
// Swap to a RemoteFrame.
FrameTestHelpers::TestWebRemoteFrameClient remoteFrameClient;
- WebRemoteFrame* remoteFrame = WebRemoteFrame::create(WebTreeScopeType::Document, &remoteFrameClient);
+ WebRemoteFrameImpl* remoteFrame = WebRemoteFrameImpl::create(WebTreeScopeType::Document, &remoteFrameClient);
targetFrame->swap(remoteFrame);
ASSERT_TRUE(mainFrame()->firstChild());
ASSERT_EQ(mainFrame()->firstChild(), remoteFrame);
- EXPECT_EQ(uniqueName.utf8(), WebString(toWebRemoteFrameImpl(remoteFrame)->frame()->tree().uniqueName()).utf8());
+ EXPECT_EQ(uniqueName.utf8(), WebString(remoteFrame->frame()->tree().uniqueName()).utf8());
// Swap back to a LocalFrame.
RemoteToLocalSwapWebFrameClient client(remoteFrame);
@@ -7652,11 +7652,11 @@ TEST_F(WebFrameSwapTest, UniqueNameAfterRemoteToLocalSwap)
EXPECT_EQ("<!--framePath //<!--frame2-->-->", uniqueName2.utf8());
FrameTestHelpers::TestWebRemoteFrameClient remoteFrameClient2;
- WebRemoteFrame* remoteFrame2 = WebRemoteFrame::create(WebTreeScopeType::Document, &remoteFrameClient2);
+ WebRemoteFrameImpl* remoteFrame2 = WebRemoteFrameImpl::create(WebTreeScopeType::Document, &remoteFrameClient2);
localFrame->swap(remoteFrame2);
ASSERT_TRUE(mainFrame()->firstChild());
ASSERT_EQ(mainFrame()->firstChild(), remoteFrame2);
- EXPECT_EQ(uniqueName2.utf8(), WebString(toWebRemoteFrameImpl(remoteFrame2)->frame()->tree().uniqueName()).utf8());
+ EXPECT_EQ(uniqueName2.utf8(), WebString(remoteFrame2->frame()->tree().uniqueName()).utf8());
RemoteToLocalSwapWebFrameClient client2(remoteFrame2);
WebLocalFrame* localFrame2 = WebLocalFrame::createProvisional(&client2, remoteFrame2, WebSandboxFlags::None);
@@ -7922,7 +7922,7 @@ TEST_P(ParameterizedWebFrameTest, LoaderOriginAccess)
request.setRequestContext(WebURLRequest::RequestContextObject);
registerMockedChromeURLLoad("test.pdf");
- LocalFrame* frame(toLocalFrame(webViewHelper.webViewImpl()->page()->mainFrame()));
+ LocalFrame* frame(toLocalFrame(webViewHelper.webView()->page()->mainFrame()));
MockDocumentThreadableLoaderClient client;
ThreadableLoaderOptions options;
@@ -8026,7 +8026,7 @@ protected:
String code = "dumpSize('" + id + "')";
v8::HandleScope scope(v8::Isolate::GetCurrent());
ScriptExecutionCallbackHelper callbackHelper(m_webViewHelper.webView()->mainFrame()->mainWorldScriptContext());
- m_webViewHelper.webView()->mainFrame()->toWebLocalFrame()->requestExecuteScriptAndReturnValue(WebScriptSource(WebString(code)), false, &callbackHelper);
+ m_webViewHelper.webView()->mainFrameImpl()->requestExecuteScriptAndReturnValue(WebScriptSource(WebString(code)), false, &callbackHelper);
runPendingTasks();
EXPECT_TRUE(callbackHelper.didComplete());
return callbackHelper.stringValue();
@@ -8196,17 +8196,17 @@ protected:
void ScrollBegin(FrameTestHelpers::WebViewHelper* webViewHelper)
{
- webViewHelper->webViewImpl()->handleInputEvent(generateEvent(WebInputEvent::GestureScrollBegin));
+ webViewHelper->webView()->handleInputEvent(generateEvent(WebInputEvent::GestureScrollBegin));
}
void ScrollUpdate(FrameTestHelpers::WebViewHelper* webViewHelper, float deltaX, float deltaY)
{
- webViewHelper->webViewImpl()->handleInputEvent(generateEvent(WebInputEvent::GestureScrollUpdate, deltaX, deltaY));
+ webViewHelper->webView()->handleInputEvent(generateEvent(WebInputEvent::GestureScrollUpdate, deltaX, deltaY));
}
void ScrollEnd(FrameTestHelpers::WebViewHelper* webViewHelper)
{
- webViewHelper->webViewImpl()->handleInputEvent(generateEvent(WebInputEvent::GestureScrollEnd));
+ webViewHelper->webView()->handleInputEvent(generateEvent(WebInputEvent::GestureScrollEnd));
}
};
@@ -8468,8 +8468,8 @@ TEST_F(WebFrameTest, ImageDocumentLoadFinishTime)
registerMockedHttpURLLoadWithMimeType("white-1x1.png", "image/png");
FrameTestHelpers::WebViewHelper webViewHelper;
webViewHelper.initializeAndLoad(m_baseURL + "white-1x1.png");
- WebView* webView = webViewHelper.webView();
- Document* document = toWebLocalFrameImpl(webView->mainFrame())->frame()->document();
+ WebViewImpl* webView = webViewHelper.webView();
+ Document* document = webView->mainFrameImpl()->frame()->document();
EXPECT_TRUE(document);
EXPECT_TRUE(document->isImageDocument());
@@ -8599,7 +8599,7 @@ TEST(WebFrameGlobalReuseTest, MainFrameWithNoOpener)
FrameTestHelpers::WebViewHelper helper;
helper.initialize(true);
- WebLocalFrame* mainFrame = helper.webView()->mainFrame()->toWebLocalFrame();
+ WebLocalFrame* mainFrame = helper.webView()->mainFrameImpl();
v8::HandleScope scope(v8::Isolate::GetCurrent());
mainFrame->executeScript(WebScriptSource("hello = 'world';"));
FrameTestHelpers::loadFrame(mainFrame, "data:text/html,new page");
@@ -8615,7 +8615,7 @@ TEST(WebFrameGlobalReuseTest, ChildFrame)
FrameTestHelpers::WebViewHelper helper;
helper.initialize(true, nullptr, nullptr, nullptr, enableGlobalReuseForUnownedMainFrames);
- WebLocalFrame* mainFrame = helper.webView()->mainFrame()->toWebLocalFrame();
+ WebLocalFrame* mainFrame = helper.webView()->mainFrameImpl();
FrameTestHelpers::loadFrame(mainFrame, "data:text/html,<iframe></iframe>");
WebLocalFrame* childFrame = mainFrame->firstChild()->toWebLocalFrame();
@@ -8637,7 +8637,7 @@ TEST(WebFrameGlobalReuseTest, MainFrameWithOpener)
FrameTestHelpers::WebViewHelper helper;
helper.initializeWithOpener(openerHelper.webView()->mainFrame(), true, nullptr, nullptr, nullptr, enableGlobalReuseForUnownedMainFrames);
- WebLocalFrame* mainFrame = helper.webView()->mainFrame()->toWebLocalFrame();
+ WebLocalFrame* mainFrame = helper.webView()->mainFrameImpl();
v8::HandleScope scope(v8::Isolate::GetCurrent());
mainFrame->executeScript(WebScriptSource("hello = 'world';"));
FrameTestHelpers::loadFrame(mainFrame, "data:text/html,new page");
@@ -8655,7 +8655,7 @@ TEST(WebFrameGlobalReuseTest, ReuseForMainFrameIfEnabled)
FrameTestHelpers::WebViewHelper helper;
helper.initialize(true, nullptr, nullptr, nullptr, enableGlobalReuseForUnownedMainFrames);
- WebLocalFrame* mainFrame = helper.webView()->mainFrame()->toWebLocalFrame();
+ WebLocalFrame* mainFrame = helper.webView()->mainFrameImpl();
v8::HandleScope scope(v8::Isolate::GetCurrent());
mainFrame->executeScript(WebScriptSource("hello = 'world';"));
FrameTestHelpers::loadFrame(mainFrame, "data:text/html,new page");
@@ -8689,7 +8689,7 @@ TEST_F(WebFrameTest, SaveImageAt)
webView->resize(WebSize(400, 400));
webView->updateAllLifecyclePhases();
- WebLocalFrame* localFrame = webView->mainFrame()->toWebLocalFrame();
+ WebLocalFrame* localFrame = webView->mainFrameImpl();
client.reset();
localFrame->saveImageAt(WebPoint(1, 1));
@@ -8718,10 +8718,10 @@ TEST_F(WebFrameTest, SaveImageWithImageMap)
FrameTestHelpers::WebViewHelper helper;
SaveImageFromDataURLWebFrameClient client;
- WebView* webView = helper.initializeAndLoad(url, true, &client);
+ WebViewImpl* webView = helper.initializeAndLoad(url, true, &client);
webView->resize(WebSize(400, 400));
- WebLocalFrame* localFrame = webView->mainFrame()->toWebLocalFrame();
+ WebLocalFrame* localFrame = webView->mainFrameImpl();
client.reset();
localFrame->saveImageAt(WebPoint(25, 25));
@@ -8746,12 +8746,12 @@ TEST_F(WebFrameTest, CopyImageAt)
URLTestHelpers::registerMockedURLLoad(toKURL(url), "canvas-copy-image.html");
FrameTestHelpers::WebViewHelper helper;
- WebView* webView = helper.initializeAndLoad(url, true, 0);
+ WebViewImpl* webView = helper.initializeAndLoad(url, true, 0);
webView->resize(WebSize(400, 400));
uint64_t sequence = Platform::current()->clipboard()->sequenceNumber(WebClipboard::BufferStandard);
- WebLocalFrame* localFrame = webView->mainFrame()->toWebLocalFrame();
+ WebLocalFrame* localFrame = webView->mainFrameImpl();
localFrame->copyImageAt(WebPoint(50, 50));
EXPECT_NE(sequence, Platform::current()->clipboard()->sequenceNumber(WebClipboard::BufferStandard));
@@ -8776,7 +8776,7 @@ TEST_F(WebFrameTest, CopyImageAtWithPinchZoom)
uint64_t sequence = Platform::current()->clipboard()->sequenceNumber(WebClipboard::BufferStandard);
- WebLocalFrame* localFrame = webView->mainFrame()->toWebLocalFrame();
+ WebLocalFrame* localFrame = webView->mainFrameImpl();
localFrame->copyImageAt(WebPoint(0, 0));
EXPECT_NE(sequence, Platform::current()->clipboard()->sequenceNumber(WebClipboard::BufferStandard));
@@ -8795,11 +8795,11 @@ TEST_F(WebFrameTest, CopyImageWithImageMap)
URLTestHelpers::registerMockedURLLoad(toKURL(url), "image-map.html");
FrameTestHelpers::WebViewHelper helper;
- WebView* webView = helper.initializeAndLoad(url, true, &client);
+ WebViewImpl* webView = helper.initializeAndLoad(url, true, &client);
webView->resize(WebSize(400, 400));
client.reset();
- WebLocalFrame* localFrame = webView->mainFrame()->toWebLocalFrame();
+ WebLocalFrame* localFrame = webView->mainFrameImpl();
localFrame->saveImageAt(WebPoint(25, 25));
EXPECT_EQ(WebString::fromUTF8("data:image/gif;base64"
",R0lGODlhAQABAIAAAAUEBAAAACwAAAAAAQABAAACAkQBADs="), client.result());
@@ -8826,12 +8826,12 @@ TEST_F(WebFrameTest, LoadJavascriptURLInNewFrame)
URLTestHelpers::registerMockedURLLoad(toKURL(redirectURL), "foo.html");
request.setURL(toKURL("javascript:location='" + redirectURL + "'"));
request.setRequestorOrigin(WebSecurityOrigin::createUnique());
- helper.webViewImpl()->mainFrame()->toWebLocalFrame()->loadRequest(request);
+ helper.webView()->mainFrameImpl()->loadRequest(request);
// 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.webViewImpl()->page()->mainFrame())->document()->documentElement()->innerText());
+ EXPECT_EQ("", toLocalFrame(helper.webView()->page()->mainFrame())->document()->documentElement()->innerText());
}
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698