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

Unified Diff: Source/WebKit/chromium/tests/WebFrameTest.cpp

Issue 12330082: Merge 143355 (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1410/
Patch Set: Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/WebKit/chromium/src/WebViewImpl.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/WebKit/chromium/tests/WebFrameTest.cpp
===================================================================
--- Source/WebKit/chromium/tests/WebFrameTest.cpp (revision 143777)
+++ Source/WebKit/chromium/tests/WebFrameTest.cpp (working copy)
@@ -546,7 +546,7 @@
webView->layout();
}
-TEST_F(WebFrameTest, DivAutoZoomParamsTestCompositorScaling)
+TEST_F(WebFrameTest, DivAutoZoomParamsTest)
{
registerMockedHttpURLLoad("get_scale_for_auto_zoom_into_div_test.html");
@@ -607,11 +607,14 @@
void simulateDoubleTap(WebViewImpl* webViewImpl, WebPoint& point, float& scale)
{
webViewImpl->animateZoomAroundPoint(point, WebViewImpl::DoubleTap);
- webViewImpl->mainFrameImpl()->frameView()->layout();
+ EXPECT_TRUE(webViewImpl->fakeDoubleTapAnimationPendingForTesting());
+ WebCore::IntSize scrollDelta = webViewImpl->fakeDoubleTapTargetPositionForTesting() - webViewImpl->mainFrameImpl()->frameView()->scrollPosition();
+ float scaleDelta = webViewImpl->fakeDoubleTapPageScaleFactorForTesting() / webViewImpl->pageScaleFactor();
+ webViewImpl->applyScrollAndScale(scrollDelta, scaleDelta);
scale = webViewImpl->pageScaleFactor();
}
-TEST_F(WebFrameTest, DivAutoZoomMultipleDivsTestCompositorScaling)
+TEST_F(WebFrameTest, DivAutoZoomMultipleDivsTest)
{
registerMockedHttpURLLoad("get_multiple_divs_for_auto_zoom_test.html");
@@ -630,7 +633,7 @@
m_webView->layout();
WebViewImpl* webViewImpl = static_cast<WebViewImpl*>(m_webView);
- webViewImpl->shouldUseAnimateDoubleTapTimeZeroForTesting(true);
+ webViewImpl->enableFakeDoubleTapAnimationForTesting(true);
WebRect topDiv(200, 100, 200, 150);
WebRect bottomDiv(200, 300, 200, 150);
@@ -652,9 +655,18 @@
webViewImpl->applyScrollAndScale(WebSize(), 0.6f);
simulateDoubleTap(webViewImpl, bottomPoint, scale);
EXPECT_FLOAT_EQ(1, scale);
+ simulateDoubleTap(webViewImpl, bottomPoint, scale);
+ EXPECT_FLOAT_EQ(webViewImpl->minimumPageScaleFactor(), scale);
+
+ // If we didn't yet get an auto-zoom update and a second double-tap arrives, should go back to minimum scale.
+ webViewImpl->applyScrollAndScale(WebSize(), 1.1f);
+ webViewImpl->animateZoomAroundPoint(topPoint, WebViewImpl::DoubleTap);
+ EXPECT_TRUE(webViewImpl->fakeDoubleTapAnimationPendingForTesting());
+ simulateDoubleTap(webViewImpl, bottomPoint, scale);
+ EXPECT_FLOAT_EQ(webViewImpl->minimumPageScaleFactor(), scale);
}
-TEST_F(WebFrameTest, DivAutoZoomScaleBoundsTestCompositorScaling)
+TEST_F(WebFrameTest, DivAutoZoomScaleBoundsTest)
{
registerMockedHttpURLLoad("get_scale_bounds_check_for_auto_zoom_test.html");
@@ -670,7 +682,7 @@
m_webView->layout();
WebViewImpl* webViewImpl = static_cast<WebViewImpl*>(m_webView);
- webViewImpl->shouldUseAnimateDoubleTapTimeZeroForTesting(true);
+ webViewImpl->enableFakeDoubleTapAnimationForTesting(true);
WebRect div(200, 100, 200, 150);
WebPoint doubleTapPoint(div.x + 50, div.y + 50);
@@ -719,7 +731,7 @@
}
#if ENABLE(TEXT_AUTOSIZING)
-TEST_F(WebFrameTest, DivAutoZoomScaleFontScaleFactorTestCompositorScaling)
+TEST_F(WebFrameTest, DivAutoZoomScaleFontScaleFactorTest)
{
registerMockedHttpURLLoad("get_scale_bounds_check_for_auto_zoom_test.html");
@@ -735,7 +747,7 @@
m_webView->layout();
WebViewImpl* webViewImpl = static_cast<WebViewImpl*>(m_webView);
- webViewImpl->shouldUseAnimateDoubleTapTimeZeroForTesting(true);
+ webViewImpl->enableFakeDoubleTapAnimationForTesting(true);
webViewImpl->page()->settings()->setTextAutosizingFontScaleFactor(textAutosizingFontScaleFactor);
WebRect div(200, 100, 200, 150);
@@ -820,7 +832,7 @@
m_webView->settings()->setAutoZoomFocusedNodeToLegibleScale(true);
WebViewImpl* webViewImpl = static_cast<WebViewImpl*>(m_webView);
- webViewImpl->shouldUseAnimateDoubleTapTimeZeroForTesting(true);
+ webViewImpl->enableFakeDoubleTapAnimationForTesting(true);
WebRect editBoxWithText(200, 200, 250, 20);
WebRect editBoxWithNoText(200, 250, 250, 20);
« no previous file with comments | « Source/WebKit/chromium/src/WebViewImpl.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698