| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2010 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 160 const int touchPointPadding = 32; | 160 const int touchPointPadding = 32; |
| 161 | 161 |
| 162 #define EXPECT_RECT_EQ(expected, actual) \ | 162 #define EXPECT_RECT_EQ(expected, actual) \ |
| 163 do { \ | 163 do { \ |
| 164 EXPECT_EQ(expected.x(), actual.x()); \ | 164 EXPECT_EQ(expected.x(), actual.x()); \ |
| 165 EXPECT_EQ(expected.y(), actual.y()); \ | 165 EXPECT_EQ(expected.y(), actual.y()); \ |
| 166 EXPECT_EQ(expected.width(), actual.width()); \ | 166 EXPECT_EQ(expected.width(), actual.width()); \ |
| 167 EXPECT_EQ(expected.height(), actual.height()); \ | 167 EXPECT_EQ(expected.height(), actual.height()); \ |
| 168 } while (false) | 168 } while (false) |
| 169 | 169 |
| 170 #define EXPECT_POINT_EQ(expected, actual) \ | 170 #define EXPECT_SIZE_EQ(expected, actual) \ |
| 171 do { \ | 171 do { \ |
| 172 EXPECT_EQ(expected.x(), actual.x()); \ | 172 EXPECT_EQ(expected.width(), actual.width()); \ |
| 173 EXPECT_EQ(expected.y(), actual.y()); \ | 173 EXPECT_EQ(expected.height(), actual.height()); \ |
| 174 } while (false) | 174 } while (false) |
| 175 | 175 |
| 176 #define EXPECT_FLOAT_POINT_EQ(expected, actual) \ | 176 #define EXPECT_FLOAT_POINT_EQ(expected, actual) \ |
| 177 do { \ | 177 do { \ |
| 178 EXPECT_FLOAT_EQ(expected.x(), actual.x()); \ | 178 EXPECT_FLOAT_EQ(expected.x(), actual.x()); \ |
| 179 EXPECT_FLOAT_EQ(expected.y(), actual.y()); \ | 179 EXPECT_FLOAT_EQ(expected.y(), actual.y()); \ |
| 180 } while (false) | 180 } while (false) |
| 181 | 181 |
| 182 class WebFrameTest : public ::testing::Test { | 182 class WebFrameTest : public ::testing::Test { |
| 183 protected: | 183 protected: |
| (...skipping 2735 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2919 | 2919 |
| 2920 void setScaleAndScrollAndLayout(WebViewImpl* webView, | 2920 void setScaleAndScrollAndLayout(WebViewImpl* webView, |
| 2921 WebPoint scroll, | 2921 WebPoint scroll, |
| 2922 float scale) { | 2922 float scale) { |
| 2923 webView->setPageScaleFactor(scale); | 2923 webView->setPageScaleFactor(scale); |
| 2924 webView->mainFrame()->setScrollOffset(WebSize(scroll.x, scroll.y)); | 2924 webView->mainFrame()->setScrollOffset(WebSize(scroll.x, scroll.y)); |
| 2925 webView->updateAllLifecyclePhases(); | 2925 webView->updateAllLifecyclePhases(); |
| 2926 } | 2926 } |
| 2927 | 2927 |
| 2928 void simulatePageScale(WebViewImpl* webViewImpl, float& scale) { | 2928 void simulatePageScale(WebViewImpl* webViewImpl, float& scale) { |
| 2929 IntSize scrollDelta = | 2929 ScrollOffset scrollDelta = |
| 2930 webViewImpl->fakePageScaleAnimationTargetPositionForTesting() - | 2930 toScrollOffset( |
| 2931 webViewImpl->mainFrameImpl()->frameView()->scrollPosition(); | 2931 webViewImpl->fakePageScaleAnimationTargetPositionForTesting()) - |
| 2932 webViewImpl->mainFrameImpl()->frameView()->scrollOffset(); |
| 2932 float scaleDelta = webViewImpl->fakePageScaleAnimationPageScaleForTesting() / | 2933 float scaleDelta = webViewImpl->fakePageScaleAnimationPageScaleForTesting() / |
| 2933 webViewImpl->pageScaleFactor(); | 2934 webViewImpl->pageScaleFactor(); |
| 2934 webViewImpl->applyViewportDeltas(WebFloatSize(), FloatSize(scrollDelta), | 2935 webViewImpl->applyViewportDeltas(WebFloatSize(), FloatSize(scrollDelta), |
| 2935 WebFloatSize(), scaleDelta, 0); | 2936 WebFloatSize(), scaleDelta, 0); |
| 2936 scale = webViewImpl->pageScaleFactor(); | 2937 scale = webViewImpl->pageScaleFactor(); |
| 2937 } | 2938 } |
| 2938 | 2939 |
| 2939 void simulateMultiTargetZoom(WebViewImpl* webViewImpl, | 2940 void simulateMultiTargetZoom(WebViewImpl* webViewImpl, |
| 2940 const WebRect& rect, | 2941 const WebRect& rect, |
| 2941 float& scale) { | 2942 float& scale) { |
| (...skipping 2756 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5698 | 5699 |
| 5699 WebViewImpl* webViewImpl = webViewHelper.webView(); | 5700 WebViewImpl* webViewImpl = webViewHelper.webView(); |
| 5700 ASSERT_TRUE(webViewImpl); | 5701 ASSERT_TRUE(webViewImpl); |
| 5701 LocalFrame* frame = webViewImpl->mainFrameImpl()->frame(); | 5702 LocalFrame* frame = webViewImpl->mainFrameImpl()->frame(); |
| 5702 ASSERT_TRUE(frame); | 5703 ASSERT_TRUE(frame); |
| 5703 | 5704 |
| 5704 webViewHelper.resize(WebSize(100, 200)); | 5705 webViewHelper.resize(WebSize(100, 200)); |
| 5705 | 5706 |
| 5706 // Scroll main frame to the bottom of the document | 5707 // Scroll main frame to the bottom of the document |
| 5707 webViewImpl->mainFrame()->setScrollOffset(WebSize(0, 400)); | 5708 webViewImpl->mainFrame()->setScrollOffset(WebSize(0, 400)); |
| 5708 EXPECT_POINT_EQ(IntPoint(0, 400), frame->view()->scrollPosition()); | 5709 EXPECT_SIZE_EQ(ScrollOffset(0, 400), frame->view()->scrollOffset()); |
| 5709 | 5710 |
| 5710 webViewImpl->setPageScaleFactor(2.0); | 5711 webViewImpl->setPageScaleFactor(2.0); |
| 5711 | 5712 |
| 5712 // Scroll visual viewport to the top of the main frame. | 5713 // Scroll visual viewport to the top of the main frame. |
| 5713 VisualViewport& visualViewport = frame->page()->frameHost().visualViewport(); | 5714 VisualViewport& visualViewport = frame->page()->frameHost().visualViewport(); |
| 5714 visualViewport.setLocation(FloatPoint(0, 0)); | 5715 visualViewport.setLocation(FloatPoint(0, 0)); |
| 5715 EXPECT_FLOAT_POINT_EQ(FloatPoint(0, 0), visualViewport.location()); | 5716 EXPECT_FLOAT_POINT_EQ(FloatPoint(0, 0), visualViewport.location()); |
| 5716 | 5717 |
| 5717 // Tap at the top: there is nothing there. | 5718 // Tap at the top: there is nothing there. |
| 5718 client.resetTriggered(); | 5719 client.resetTriggered(); |
| (...skipping 730 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6449 | 6450 |
| 6450 WebLocalFrameImpl* frameImpl = webViewHelper.webView()->mainFrameImpl(); | 6451 WebLocalFrameImpl* frameImpl = webViewHelper.webView()->mainFrameImpl(); |
| 6451 DocumentLoader::InitialScrollState& initialScrollState = | 6452 DocumentLoader::InitialScrollState& initialScrollState = |
| 6452 frameImpl->frame()->loader().documentLoader()->initialScrollState(); | 6453 frameImpl->frame()->loader().documentLoader()->initialScrollState(); |
| 6453 GraphicsLayer* frameViewLayer = frameImpl->frameView()->layerForScrolling(); | 6454 GraphicsLayer* frameViewLayer = frameImpl->frameView()->layerForScrolling(); |
| 6454 | 6455 |
| 6455 EXPECT_FALSE(client.wasFrameScrolled()); | 6456 EXPECT_FALSE(client.wasFrameScrolled()); |
| 6456 EXPECT_FALSE(initialScrollState.wasScrolledByUser); | 6457 EXPECT_FALSE(initialScrollState.wasScrolledByUser); |
| 6457 | 6458 |
| 6458 // Do a compositor scroll, verify that this is counted as a user scroll. | 6459 // Do a compositor scroll, verify that this is counted as a user scroll. |
| 6459 frameViewLayer->platformLayer()->setScrollPositionDouble( | 6460 frameViewLayer->platformLayer()->setScrollOffset(WebFloatSize(0, 1)); |
| 6460 WebDoublePoint(0, 1)); | |
| 6461 frameViewLayer->didScroll(); | 6461 frameViewLayer->didScroll(); |
| 6462 webViewHelper.webView()->applyViewportDeltas(WebFloatSize(), WebFloatSize(), | 6462 webViewHelper.webView()->applyViewportDeltas(WebFloatSize(), WebFloatSize(), |
| 6463 WebFloatSize(), 1.7f, 0); | 6463 WebFloatSize(), 1.7f, 0); |
| 6464 EXPECT_TRUE(client.wasFrameScrolled()); | 6464 EXPECT_TRUE(client.wasFrameScrolled()); |
| 6465 EXPECT_TRUE(initialScrollState.wasScrolledByUser); | 6465 EXPECT_TRUE(initialScrollState.wasScrolledByUser); |
| 6466 | 6466 |
| 6467 client.reset(); | 6467 client.reset(); |
| 6468 initialScrollState.wasScrolledByUser = false; | 6468 initialScrollState.wasScrolledByUser = false; |
| 6469 | 6469 |
| 6470 // The page scale 1.0f and scroll. | 6470 // The page scale 1.0f and scroll. |
| 6471 frameViewLayer->platformLayer()->setScrollPositionDouble( | 6471 frameViewLayer->platformLayer()->setScrollOffset(WebFloatSize(0, 2)); |
| 6472 WebDoublePoint(0, 2)); | |
| 6473 frameViewLayer->didScroll(); | 6472 frameViewLayer->didScroll(); |
| 6474 webViewHelper.webView()->applyViewportDeltas(WebFloatSize(), WebFloatSize(), | 6473 webViewHelper.webView()->applyViewportDeltas(WebFloatSize(), WebFloatSize(), |
| 6475 WebFloatSize(), 1.0f, 0); | 6474 WebFloatSize(), 1.0f, 0); |
| 6476 EXPECT_TRUE(client.wasFrameScrolled()); | 6475 EXPECT_TRUE(client.wasFrameScrolled()); |
| 6477 EXPECT_TRUE(initialScrollState.wasScrolledByUser); | 6476 EXPECT_TRUE(initialScrollState.wasScrolledByUser); |
| 6478 client.reset(); | 6477 client.reset(); |
| 6479 initialScrollState.wasScrolledByUser = false; | 6478 initialScrollState.wasScrolledByUser = false; |
| 6480 | 6479 |
| 6481 // No scroll event if there is no scroll delta. | 6480 // No scroll event if there is no scroll delta. |
| 6482 frameViewLayer->didScroll(); | 6481 frameViewLayer->didScroll(); |
| 6483 webViewHelper.webView()->applyViewportDeltas(WebFloatSize(), WebFloatSize(), | 6482 webViewHelper.webView()->applyViewportDeltas(WebFloatSize(), WebFloatSize(), |
| 6484 WebFloatSize(), 1.0f, 0); | 6483 WebFloatSize(), 1.0f, 0); |
| 6485 EXPECT_FALSE(client.wasFrameScrolled()); | 6484 EXPECT_FALSE(client.wasFrameScrolled()); |
| 6486 EXPECT_FALSE(initialScrollState.wasScrolledByUser); | 6485 EXPECT_FALSE(initialScrollState.wasScrolledByUser); |
| 6487 client.reset(); | 6486 client.reset(); |
| 6488 | 6487 |
| 6489 // Non zero page scale and scroll. | 6488 // Non zero page scale and scroll. |
| 6490 frameViewLayer->platformLayer()->setScrollPositionDouble( | 6489 frameViewLayer->platformLayer()->setScrollOffset(WebFloatSize(9, 15)); |
| 6491 WebDoublePoint(9, 15)); | |
| 6492 frameViewLayer->didScroll(); | 6490 frameViewLayer->didScroll(); |
| 6493 webViewHelper.webView()->applyViewportDeltas(WebFloatSize(), WebFloatSize(), | 6491 webViewHelper.webView()->applyViewportDeltas(WebFloatSize(), WebFloatSize(), |
| 6494 WebFloatSize(), 0.6f, 0); | 6492 WebFloatSize(), 0.6f, 0); |
| 6495 EXPECT_TRUE(client.wasFrameScrolled()); | 6493 EXPECT_TRUE(client.wasFrameScrolled()); |
| 6496 EXPECT_TRUE(initialScrollState.wasScrolledByUser); | 6494 EXPECT_TRUE(initialScrollState.wasScrolledByUser); |
| 6497 client.reset(); | 6495 client.reset(); |
| 6498 initialScrollState.wasScrolledByUser = false; | 6496 initialScrollState.wasScrolledByUser = false; |
| 6499 | 6497 |
| 6500 // Programmatic scroll. | 6498 // Programmatic scroll. |
| 6501 frameImpl->executeScript(WebScriptSource("window.scrollTo(0, 20);")); | 6499 frameImpl->executeScript(WebScriptSource("window.scrollTo(0, 20);")); |
| (...skipping 737 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7239 | 7237 |
| 7240 WebViewImpl* webView = webViewHelper.webView(); | 7238 WebViewImpl* webView = webViewHelper.webView(); |
| 7241 FrameView* frameView = webViewHelper.webView()->mainFrameImpl()->frameView(); | 7239 FrameView* frameView = webViewHelper.webView()->mainFrameImpl()->frameView(); |
| 7242 | 7240 |
| 7243 float topControlsHeight = 40; | 7241 float topControlsHeight = 40; |
| 7244 webView->resizeWithTopControls(WebSize(100, 100), topControlsHeight, false); | 7242 webView->resizeWithTopControls(WebSize(100, 100), topControlsHeight, false); |
| 7245 webView->setPageScaleFactor(2.0f); | 7243 webView->setPageScaleFactor(2.0f); |
| 7246 webView->updateAllLifecyclePhases(); | 7244 webView->updateAllLifecyclePhases(); |
| 7247 | 7245 |
| 7248 webView->mainFrame()->setScrollOffset(WebSize(0, 2000)); | 7246 webView->mainFrame()->setScrollOffset(WebSize(0, 2000)); |
| 7249 EXPECT_POINT_EQ(IntPoint(0, 1900), IntPoint(frameView->scrollOffset())); | 7247 EXPECT_SIZE_EQ(ScrollOffset(0, 1900), frameView->scrollOffset()); |
| 7250 | 7248 |
| 7251 // Simulate the top controls showing by 20px, thus shrinking the viewport | 7249 // Simulate the top controls showing by 20px, thus shrinking the viewport |
| 7252 // and allowing it to scroll an additional 20px. | 7250 // and allowing it to scroll an additional 20px. |
| 7253 webView->applyViewportDeltas(WebFloatSize(), WebFloatSize(), WebFloatSize(), | 7251 webView->applyViewportDeltas(WebFloatSize(), WebFloatSize(), WebFloatSize(), |
| 7254 1.0f, 20.0f / topControlsHeight); | 7252 1.0f, 20.0f / topControlsHeight); |
| 7255 EXPECT_POINT_EQ(IntPoint(0, 1920), frameView->maximumScrollPosition()); | 7253 EXPECT_SIZE_EQ(ScrollOffset(0, 1920), frameView->maximumScrollOffset()); |
| 7256 | 7254 |
| 7257 // Show more, make sure the scroll actually gets clamped. | 7255 // Show more, make sure the scroll actually gets clamped. |
| 7258 webView->applyViewportDeltas(WebFloatSize(), WebFloatSize(), WebFloatSize(), | 7256 webView->applyViewportDeltas(WebFloatSize(), WebFloatSize(), WebFloatSize(), |
| 7259 1.0f, 20.0f / topControlsHeight); | 7257 1.0f, 20.0f / topControlsHeight); |
| 7260 webView->mainFrame()->setScrollOffset(WebSize(0, 2000)); | 7258 webView->mainFrame()->setScrollOffset(WebSize(0, 2000)); |
| 7261 EXPECT_POINT_EQ(IntPoint(0, 1940), IntPoint(frameView->scrollOffset())); | 7259 EXPECT_SIZE_EQ(ScrollOffset(0, 1940), frameView->scrollOffset()); |
| 7262 | 7260 |
| 7263 // Hide until there's 10px showing. | 7261 // Hide until there's 10px showing. |
| 7264 webView->applyViewportDeltas(WebFloatSize(), WebFloatSize(), WebFloatSize(), | 7262 webView->applyViewportDeltas(WebFloatSize(), WebFloatSize(), WebFloatSize(), |
| 7265 1.0f, -30.0f / topControlsHeight); | 7263 1.0f, -30.0f / topControlsHeight); |
| 7266 EXPECT_POINT_EQ(IntPoint(0, 1910), frameView->maximumScrollPosition()); | 7264 EXPECT_SIZE_EQ(ScrollOffset(0, 1910), frameView->maximumScrollOffset()); |
| 7267 | 7265 |
| 7268 // Simulate a LayoutPart::resize. The frame is resized to accomodate | 7266 // Simulate a LayoutPart::resize. The frame is resized to accomodate |
| 7269 // the top controls and Blink's view of the top controls matches that of | 7267 // the top controls and Blink's view of the top controls matches that of |
| 7270 // the CC | 7268 // the CC |
| 7271 webView->applyViewportDeltas(WebFloatSize(), WebFloatSize(), WebFloatSize(), | 7269 webView->applyViewportDeltas(WebFloatSize(), WebFloatSize(), WebFloatSize(), |
| 7272 1.0f, 30.0f / topControlsHeight); | 7270 1.0f, 30.0f / topControlsHeight); |
| 7273 webView->resizeWithTopControls(WebSize(100, 60), 40.0f, true); | 7271 webView->resizeWithTopControls(WebSize(100, 60), 40.0f, true); |
| 7274 webView->updateAllLifecyclePhases(); | 7272 webView->updateAllLifecyclePhases(); |
| 7275 EXPECT_POINT_EQ(IntPoint(0, 1940), frameView->maximumScrollPosition()); | 7273 EXPECT_SIZE_EQ(ScrollOffset(0, 1940), frameView->maximumScrollOffset()); |
| 7276 | 7274 |
| 7277 // Now simulate hiding. | 7275 // Now simulate hiding. |
| 7278 webView->applyViewportDeltas(WebFloatSize(), WebFloatSize(), WebFloatSize(), | 7276 webView->applyViewportDeltas(WebFloatSize(), WebFloatSize(), WebFloatSize(), |
| 7279 1.0f, -10.0f / topControlsHeight); | 7277 1.0f, -10.0f / topControlsHeight); |
| 7280 EXPECT_POINT_EQ(IntPoint(0, 1930), frameView->maximumScrollPosition()); | 7278 EXPECT_SIZE_EQ(ScrollOffset(0, 1930), frameView->maximumScrollOffset()); |
| 7281 | 7279 |
| 7282 // Reset to original state: 100px widget height, top controls fully hidden. | 7280 // Reset to original state: 100px widget height, top controls fully hidden. |
| 7283 webView->applyViewportDeltas(WebFloatSize(), WebFloatSize(), WebFloatSize(), | 7281 webView->applyViewportDeltas(WebFloatSize(), WebFloatSize(), WebFloatSize(), |
| 7284 1.0f, -30.0f / topControlsHeight); | 7282 1.0f, -30.0f / topControlsHeight); |
| 7285 webView->resizeWithTopControls(WebSize(100, 100), topControlsHeight, false); | 7283 webView->resizeWithTopControls(WebSize(100, 100), topControlsHeight, false); |
| 7286 webView->updateAllLifecyclePhases(); | 7284 webView->updateAllLifecyclePhases(); |
| 7287 EXPECT_POINT_EQ(IntPoint(0, 1900), frameView->maximumScrollPosition()); | 7285 EXPECT_SIZE_EQ(ScrollOffset(0, 1900), frameView->maximumScrollOffset()); |
| 7288 | 7286 |
| 7289 // Show the top controls by just 1px, since we're zoomed in to 2X, that | 7287 // Show the top controls by just 1px, since we're zoomed in to 2X, that |
| 7290 // should allow an extra 0.5px of scrolling in the visual viewport. Make | 7288 // should allow an extra 0.5px of scrolling in the visual viewport. Make |
| 7291 // sure we're not losing any pixels when applying the adjustment on the | 7289 // sure we're not losing any pixels when applying the adjustment on the |
| 7292 // main frame. | 7290 // main frame. |
| 7293 webView->applyViewportDeltas(WebFloatSize(), WebFloatSize(), WebFloatSize(), | 7291 webView->applyViewportDeltas(WebFloatSize(), WebFloatSize(), WebFloatSize(), |
| 7294 1.0f, 1.0f / topControlsHeight); | 7292 1.0f, 1.0f / topControlsHeight); |
| 7295 EXPECT_POINT_EQ(IntPoint(0, 1901), frameView->maximumScrollPosition()); | 7293 EXPECT_SIZE_EQ(ScrollOffset(0, 1901), frameView->maximumScrollOffset()); |
| 7296 | 7294 |
| 7297 webView->applyViewportDeltas(WebFloatSize(), WebFloatSize(), WebFloatSize(), | 7295 webView->applyViewportDeltas(WebFloatSize(), WebFloatSize(), WebFloatSize(), |
| 7298 1.0f, 2.0f / topControlsHeight); | 7296 1.0f, 2.0f / topControlsHeight); |
| 7299 EXPECT_POINT_EQ(IntPoint(0, 1903), frameView->maximumScrollPosition()); | 7297 EXPECT_SIZE_EQ(ScrollOffset(0, 1903), frameView->maximumScrollOffset()); |
| 7300 } | 7298 } |
| 7301 | 7299 |
| 7302 TEST_F(WebFrameTest, MaximumScrollPositionCanBeNegative) { | 7300 TEST_F(WebFrameTest, MaximumScrollPositionCanBeNegative) { |
| 7303 registerMockedHttpURLLoad("rtl-overview-mode.html"); | 7301 registerMockedHttpURLLoad("rtl-overview-mode.html"); |
| 7304 | 7302 |
| 7305 FixedLayoutTestWebViewClient client; | 7303 FixedLayoutTestWebViewClient client; |
| 7306 client.m_screenInfo.deviceScaleFactor = 1; | 7304 client.m_screenInfo.deviceScaleFactor = 1; |
| 7307 int viewportWidth = 640; | 7305 int viewportWidth = 640; |
| 7308 int viewportHeight = 480; | 7306 int viewportHeight = 480; |
| 7309 | 7307 |
| 7310 FrameTestHelpers::WebViewHelper webViewHelper; | 7308 FrameTestHelpers::WebViewHelper webViewHelper; |
| 7311 webViewHelper.initializeAndLoad(m_baseURL + "rtl-overview-mode.html", true, | 7309 webViewHelper.initializeAndLoad(m_baseURL + "rtl-overview-mode.html", true, |
| 7312 nullptr, &client, nullptr, | 7310 nullptr, &client, nullptr, |
| 7313 enableViewportSettings); | 7311 enableViewportSettings); |
| 7314 webViewHelper.webView()->setInitialPageScaleOverride(-1); | 7312 webViewHelper.webView()->setInitialPageScaleOverride(-1); |
| 7315 webViewHelper.webView()->settings()->setWideViewportQuirkEnabled(true); | 7313 webViewHelper.webView()->settings()->setWideViewportQuirkEnabled(true); |
| 7316 webViewHelper.webView()->settings()->setLoadWithOverviewMode(true); | 7314 webViewHelper.webView()->settings()->setLoadWithOverviewMode(true); |
| 7317 webViewHelper.webView()->settings()->setUseWideViewport(true); | 7315 webViewHelper.webView()->settings()->setUseWideViewport(true); |
| 7318 webViewHelper.resize(WebSize(viewportWidth, viewportHeight)); | 7316 webViewHelper.resize(WebSize(viewportWidth, viewportHeight)); |
| 7319 webViewHelper.webView()->updateAllLifecyclePhases(); | 7317 webViewHelper.webView()->updateAllLifecyclePhases(); |
| 7320 | 7318 |
| 7321 FrameView* frameView = webViewHelper.webView()->mainFrameImpl()->frameView(); | 7319 FrameView* frameView = webViewHelper.webView()->mainFrameImpl()->frameView(); |
| 7322 EXPECT_LT(frameView->maximumScrollPosition().x(), 0); | 7320 EXPECT_LT(frameView->maximumScrollOffset().width(), 0); |
| 7323 } | 7321 } |
| 7324 | 7322 |
| 7325 TEST_P(ParameterizedWebFrameTest, FullscreenLayerSize) { | 7323 TEST_P(ParameterizedWebFrameTest, FullscreenLayerSize) { |
| 7326 FakeCompositingWebViewClient client; | 7324 FakeCompositingWebViewClient client; |
| 7327 registerMockedHttpURLLoad("fullscreen_div.html"); | 7325 registerMockedHttpURLLoad("fullscreen_div.html"); |
| 7328 FrameTestHelpers::WebViewHelper webViewHelper; | 7326 FrameTestHelpers::WebViewHelper webViewHelper; |
| 7329 int viewportWidth = 640; | 7327 int viewportWidth = 640; |
| 7330 int viewportHeight = 480; | 7328 int viewportHeight = 480; |
| 7331 client.m_screenInfo.rect.width = viewportWidth; | 7329 client.m_screenInfo.rect.width = viewportWidth; |
| 7332 client.m_screenInfo.rect.height = viewportHeight; | 7330 client.m_screenInfo.rect.height = viewportHeight; |
| (...skipping 2757 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10090 Platform::current()->getURLLoaderMockFactory()->setLoaderDelegate(nullptr); | 10088 Platform::current()->getURLLoaderMockFactory()->setLoaderDelegate(nullptr); |
| 10091 | 10089 |
| 10092 Document* document = | 10090 Document* document = |
| 10093 toLocalFrame(helper.webView()->page()->mainFrame())->document(); | 10091 toLocalFrame(helper.webView()->page()->mainFrame())->document(); |
| 10094 EXPECT_TRUE(document->isImageDocument()); | 10092 EXPECT_TRUE(document->isImageDocument()); |
| 10095 EXPECT_EQ(Resource::DecodeError, | 10093 EXPECT_EQ(Resource::DecodeError, |
| 10096 toImageDocument(document)->cachedImage()->getStatus()); | 10094 toImageDocument(document)->cachedImage()->getStatus()); |
| 10097 } | 10095 } |
| 10098 | 10096 |
| 10099 } // namespace blink | 10097 } // namespace blink |
| OLD | NEW |