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 2354 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2365 // Test for Non-doubletap scaling | 2365 // Test for Non-doubletap scaling |
2366 // Test zooming into div. | 2366 // Test zooming into div. |
2367 webViewHelper.webViewImpl()->computeScaleAndScrollForBlockRect(WebPoint(250,
250), webViewHelper.webViewImpl()->computeBlockBounds(WebRect(250, 250, 10, 10)
, true), 0, doubleTapZoomAlreadyLegibleScale, scale, scroll); | 2367 webViewHelper.webViewImpl()->computeScaleAndScrollForBlockRect(WebPoint(250,
250), webViewHelper.webViewImpl()->computeBlockBounds(WebRect(250, 250, 10, 10)
, true), 0, doubleTapZoomAlreadyLegibleScale, scale, scroll); |
2368 EXPECT_NEAR(viewportWidth / (float) wideDiv.width, scale, 0.1); | 2368 EXPECT_NEAR(viewportWidth / (float) wideDiv.width, scale, 0.1); |
2369 } | 2369 } |
2370 | 2370 |
2371 void simulatePageScale(WebViewImpl* webViewImpl, float& scale) | 2371 void simulatePageScale(WebViewImpl* webViewImpl, float& scale) |
2372 { | 2372 { |
2373 blink::IntSize scrollDelta = webViewImpl->fakePageScaleAnimationTargetPositi
onForTesting() - webViewImpl->mainFrameImpl()->frameView()->scrollPosition(); | 2373 blink::IntSize scrollDelta = webViewImpl->fakePageScaleAnimationTargetPositi
onForTesting() - webViewImpl->mainFrameImpl()->frameView()->scrollPosition(); |
2374 float scaleDelta = webViewImpl->fakePageScaleAnimationPageScaleForTesting()
/ webViewImpl->pageScaleFactor(); | 2374 float scaleDelta = webViewImpl->fakePageScaleAnimationPageScaleForTesting()
/ webViewImpl->pageScaleFactor(); |
2375 webViewImpl->applyScrollAndScale(scrollDelta, scaleDelta); | 2375 webViewImpl->applyViewportDeltas(scrollDelta, scaleDelta, 0); |
2376 scale = webViewImpl->pageScaleFactor(); | 2376 scale = webViewImpl->pageScaleFactor(); |
2377 } | 2377 } |
2378 | 2378 |
2379 void simulateMultiTargetZoom(WebViewImpl* webViewImpl, const WebRect& rect, floa
t& scale) | 2379 void simulateMultiTargetZoom(WebViewImpl* webViewImpl, const WebRect& rect, floa
t& scale) |
2380 { | 2380 { |
2381 if (webViewImpl->zoomToMultipleTargetsRect(rect)) | 2381 if (webViewImpl->zoomToMultipleTargetsRect(rect)) |
2382 simulatePageScale(webViewImpl, scale); | 2382 simulatePageScale(webViewImpl, scale); |
2383 } | 2383 } |
2384 | 2384 |
2385 void simulateDoubleTap(WebViewImpl* webViewImpl, WebPoint& point, float& scale) | 2385 void simulateDoubleTap(WebViewImpl* webViewImpl, WebPoint& point, float& scale) |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2477 // Test double tap on two different divs | 2477 // Test double tap on two different divs |
2478 // After first zoom, we should go back to minimum page scale with a second d
ouble tap. | 2478 // After first zoom, we should go back to minimum page scale with a second d
ouble tap. |
2479 simulateDoubleTap(webViewHelper.webViewImpl(), topPoint, scale); | 2479 simulateDoubleTap(webViewHelper.webViewImpl(), topPoint, scale); |
2480 EXPECT_FLOAT_EQ(1, scale); | 2480 EXPECT_FLOAT_EQ(1, scale); |
2481 simulateDoubleTap(webViewHelper.webViewImpl(), bottomPoint, scale); | 2481 simulateDoubleTap(webViewHelper.webViewImpl(), bottomPoint, scale); |
2482 EXPECT_FLOAT_EQ(webViewHelper.webViewImpl()->minimumPageScaleFactor(), scale
); | 2482 EXPECT_FLOAT_EQ(webViewHelper.webViewImpl()->minimumPageScaleFactor(), scale
); |
2483 | 2483 |
2484 // If the user pinch zooms after double tap, a second double tap should zoom
back to the div. | 2484 // If the user pinch zooms after double tap, a second double tap should zoom
back to the div. |
2485 simulateDoubleTap(webViewHelper.webViewImpl(), topPoint, scale); | 2485 simulateDoubleTap(webViewHelper.webViewImpl(), topPoint, scale); |
2486 EXPECT_FLOAT_EQ(1, scale); | 2486 EXPECT_FLOAT_EQ(1, scale); |
2487 webViewHelper.webViewImpl()->applyScrollAndScale(WebSize(), 0.6f); | 2487 webViewHelper.webViewImpl()->applyViewportDeltas(WebSize(), 0.6f, 0); |
2488 simulateDoubleTap(webViewHelper.webViewImpl(), bottomPoint, scale); | 2488 simulateDoubleTap(webViewHelper.webViewImpl(), bottomPoint, scale); |
2489 EXPECT_FLOAT_EQ(1, scale); | 2489 EXPECT_FLOAT_EQ(1, scale); |
2490 simulateDoubleTap(webViewHelper.webViewImpl(), bottomPoint, scale); | 2490 simulateDoubleTap(webViewHelper.webViewImpl(), bottomPoint, scale); |
2491 EXPECT_FLOAT_EQ(webViewHelper.webViewImpl()->minimumPageScaleFactor(), scale
); | 2491 EXPECT_FLOAT_EQ(webViewHelper.webViewImpl()->minimumPageScaleFactor(), scale
); |
2492 | 2492 |
2493 // If we didn't yet get an auto-zoom update and a second double-tap arrives,
should go back to minimum scale. | 2493 // If we didn't yet get an auto-zoom update and a second double-tap arrives,
should go back to minimum scale. |
2494 webViewHelper.webViewImpl()->applyScrollAndScale(WebSize(), 1.1f); | 2494 webViewHelper.webViewImpl()->applyViewportDeltas(WebSize(), 1.1f, 0); |
2495 webViewHelper.webViewImpl()->animateDoubleTapZoom(topPoint); | 2495 webViewHelper.webViewImpl()->animateDoubleTapZoom(topPoint); |
2496 EXPECT_TRUE(webViewHelper.webViewImpl()->fakeDoubleTapAnimationPendingForTes
ting()); | 2496 EXPECT_TRUE(webViewHelper.webViewImpl()->fakeDoubleTapAnimationPendingForTes
ting()); |
2497 simulateDoubleTap(webViewHelper.webViewImpl(), bottomPoint, scale); | 2497 simulateDoubleTap(webViewHelper.webViewImpl(), bottomPoint, scale); |
2498 EXPECT_FLOAT_EQ(webViewHelper.webViewImpl()->minimumPageScaleFactor(), scale
); | 2498 EXPECT_FLOAT_EQ(webViewHelper.webViewImpl()->minimumPageScaleFactor(), scale
); |
2499 } | 2499 } |
2500 | 2500 |
2501 TEST_F(WebFrameTest, DivAutoZoomScaleBoundsTest) | 2501 TEST_F(WebFrameTest, DivAutoZoomScaleBoundsTest) |
2502 { | 2502 { |
2503 registerMockedHttpURLLoad("get_scale_bounds_check_for_auto_zoom_test.html"); | 2503 registerMockedHttpURLLoad("get_scale_bounds_check_for_auto_zoom_test.html"); |
2504 | 2504 |
(...skipping 19 matching lines...) Expand all Loading... |
2524 float doubleTapZoomAlreadyLegibleScale = webViewHelper.webViewImpl()->minimu
mPageScaleFactor() * doubleTapZoomAlreadyLegibleRatio; | 2524 float doubleTapZoomAlreadyLegibleScale = webViewHelper.webViewImpl()->minimu
mPageScaleFactor() * doubleTapZoomAlreadyLegibleRatio; |
2525 setScaleAndScrollAndLayout(webViewHelper.webViewImpl(), WebPoint(0, 0), (web
ViewHelper.webViewImpl()->minimumPageScaleFactor()) * (1 + doubleTapZoomAlreadyL
egibleRatio) / 2); | 2525 setScaleAndScrollAndLayout(webViewHelper.webViewImpl(), WebPoint(0, 0), (web
ViewHelper.webViewImpl()->minimumPageScaleFactor()) * (1 + doubleTapZoomAlreadyL
egibleRatio) / 2); |
2526 simulateDoubleTap(webViewHelper.webViewImpl(), doubleTapPoint, scale); | 2526 simulateDoubleTap(webViewHelper.webViewImpl(), doubleTapPoint, scale); |
2527 EXPECT_FLOAT_EQ(1, scale); | 2527 EXPECT_FLOAT_EQ(1, scale); |
2528 simulateDoubleTap(webViewHelper.webViewImpl(), doubleTapPoint, scale); | 2528 simulateDoubleTap(webViewHelper.webViewImpl(), doubleTapPoint, scale); |
2529 EXPECT_FLOAT_EQ(webViewHelper.webViewImpl()->minimumPageScaleFactor(), scale
); | 2529 EXPECT_FLOAT_EQ(webViewHelper.webViewImpl()->minimumPageScaleFactor(), scale
); |
2530 simulateDoubleTap(webViewHelper.webViewImpl(), doubleTapPoint, scale); | 2530 simulateDoubleTap(webViewHelper.webViewImpl(), doubleTapPoint, scale); |
2531 EXPECT_FLOAT_EQ(1, scale); | 2531 EXPECT_FLOAT_EQ(1, scale); |
2532 | 2532 |
2533 // Zoom in to reset double_tap_zoom_in_effect flag. | 2533 // Zoom in to reset double_tap_zoom_in_effect flag. |
2534 webViewHelper.webViewImpl()->applyScrollAndScale(WebSize(), 1.1f); | 2534 webViewHelper.webViewImpl()->applyViewportDeltas(WebSize(), 1.1f, 0); |
2535 // 1 < minimumPageScale < doubleTapZoomAlreadyLegibleScale | 2535 // 1 < minimumPageScale < doubleTapZoomAlreadyLegibleScale |
2536 webViewHelper.webView()->setPageScaleFactorLimits(1.1f, 4); | 2536 webViewHelper.webView()->setPageScaleFactorLimits(1.1f, 4); |
2537 webViewHelper.webView()->layout(); | 2537 webViewHelper.webView()->layout(); |
2538 doubleTapZoomAlreadyLegibleScale = webViewHelper.webViewImpl()->minimumPageS
caleFactor() * doubleTapZoomAlreadyLegibleRatio; | 2538 doubleTapZoomAlreadyLegibleScale = webViewHelper.webViewImpl()->minimumPageS
caleFactor() * doubleTapZoomAlreadyLegibleRatio; |
2539 setScaleAndScrollAndLayout(webViewHelper.webViewImpl(), WebPoint(0, 0), (web
ViewHelper.webViewImpl()->minimumPageScaleFactor()) * (1 + doubleTapZoomAlreadyL
egibleRatio) / 2); | 2539 setScaleAndScrollAndLayout(webViewHelper.webViewImpl(), WebPoint(0, 0), (web
ViewHelper.webViewImpl()->minimumPageScaleFactor()) * (1 + doubleTapZoomAlreadyL
egibleRatio) / 2); |
2540 simulateDoubleTap(webViewHelper.webViewImpl(), doubleTapPoint, scale); | 2540 simulateDoubleTap(webViewHelper.webViewImpl(), doubleTapPoint, scale); |
2541 EXPECT_FLOAT_EQ(doubleTapZoomAlreadyLegibleScale, scale); | 2541 EXPECT_FLOAT_EQ(doubleTapZoomAlreadyLegibleScale, scale); |
2542 simulateDoubleTap(webViewHelper.webViewImpl(), doubleTapPoint, scale); | 2542 simulateDoubleTap(webViewHelper.webViewImpl(), doubleTapPoint, scale); |
2543 EXPECT_FLOAT_EQ(webViewHelper.webViewImpl()->minimumPageScaleFactor(), scale
); | 2543 EXPECT_FLOAT_EQ(webViewHelper.webViewImpl()->minimumPageScaleFactor(), scale
); |
2544 simulateDoubleTap(webViewHelper.webViewImpl(), doubleTapPoint, scale); | 2544 simulateDoubleTap(webViewHelper.webViewImpl(), doubleTapPoint, scale); |
2545 EXPECT_FLOAT_EQ(doubleTapZoomAlreadyLegibleScale, scale); | 2545 EXPECT_FLOAT_EQ(doubleTapZoomAlreadyLegibleScale, scale); |
2546 | 2546 |
2547 // Zoom in to reset double_tap_zoom_in_effect flag. | 2547 // Zoom in to reset double_tap_zoom_in_effect flag. |
2548 webViewHelper.webViewImpl()->applyScrollAndScale(WebSize(), 1.1f); | 2548 webViewHelper.webViewImpl()->applyViewportDeltas(WebSize(), 1.1f, 0); |
2549 // minimumPageScale < 1 < doubleTapZoomAlreadyLegibleScale | 2549 // minimumPageScale < 1 < doubleTapZoomAlreadyLegibleScale |
2550 webViewHelper.webView()->setPageScaleFactorLimits(0.95f, 4); | 2550 webViewHelper.webView()->setPageScaleFactorLimits(0.95f, 4); |
2551 webViewHelper.webView()->layout(); | 2551 webViewHelper.webView()->layout(); |
2552 doubleTapZoomAlreadyLegibleScale = webViewHelper.webViewImpl()->minimumPageS
caleFactor() * doubleTapZoomAlreadyLegibleRatio; | 2552 doubleTapZoomAlreadyLegibleScale = webViewHelper.webViewImpl()->minimumPageS
caleFactor() * doubleTapZoomAlreadyLegibleRatio; |
2553 setScaleAndScrollAndLayout(webViewHelper.webViewImpl(), WebPoint(0, 0), (web
ViewHelper.webViewImpl()->minimumPageScaleFactor()) * (1 + doubleTapZoomAlreadyL
egibleRatio) / 2); | 2553 setScaleAndScrollAndLayout(webViewHelper.webViewImpl(), WebPoint(0, 0), (web
ViewHelper.webViewImpl()->minimumPageScaleFactor()) * (1 + doubleTapZoomAlreadyL
egibleRatio) / 2); |
2554 simulateDoubleTap(webViewHelper.webViewImpl(), doubleTapPoint, scale); | 2554 simulateDoubleTap(webViewHelper.webViewImpl(), doubleTapPoint, scale); |
2555 EXPECT_FLOAT_EQ(doubleTapZoomAlreadyLegibleScale, scale); | 2555 EXPECT_FLOAT_EQ(doubleTapZoomAlreadyLegibleScale, scale); |
2556 simulateDoubleTap(webViewHelper.webViewImpl(), doubleTapPoint, scale); | 2556 simulateDoubleTap(webViewHelper.webViewImpl(), doubleTapPoint, scale); |
2557 EXPECT_FLOAT_EQ(webViewHelper.webViewImpl()->minimumPageScaleFactor(), scale
); | 2557 EXPECT_FLOAT_EQ(webViewHelper.webViewImpl()->minimumPageScaleFactor(), scale
); |
2558 simulateDoubleTap(webViewHelper.webViewImpl(), doubleTapPoint, scale); | 2558 simulateDoubleTap(webViewHelper.webViewImpl(), doubleTapPoint, scale); |
(...skipping 29 matching lines...) Expand all Loading... |
2588 webViewHelper.webView()->setPageScaleFactorLimits(0.5f, 4); | 2588 webViewHelper.webView()->setPageScaleFactorLimits(0.5f, 4); |
2589 webViewHelper.webView()->layout(); | 2589 webViewHelper.webView()->layout(); |
2590 simulateDoubleTap(webViewHelper.webViewImpl(), doubleTapPoint, scale); | 2590 simulateDoubleTap(webViewHelper.webViewImpl(), doubleTapPoint, scale); |
2591 EXPECT_FLOAT_EQ(legibleScale, scale); | 2591 EXPECT_FLOAT_EQ(legibleScale, scale); |
2592 simulateDoubleTap(webViewHelper.webViewImpl(), doubleTapPoint, scale); | 2592 simulateDoubleTap(webViewHelper.webViewImpl(), doubleTapPoint, scale); |
2593 EXPECT_FLOAT_EQ(webViewHelper.webViewImpl()->minimumPageScaleFactor(), scale
); | 2593 EXPECT_FLOAT_EQ(webViewHelper.webViewImpl()->minimumPageScaleFactor(), scale
); |
2594 simulateDoubleTap(webViewHelper.webViewImpl(), doubleTapPoint, scale); | 2594 simulateDoubleTap(webViewHelper.webViewImpl(), doubleTapPoint, scale); |
2595 EXPECT_FLOAT_EQ(legibleScale, scale); | 2595 EXPECT_FLOAT_EQ(legibleScale, scale); |
2596 | 2596 |
2597 // Zoom in to reset double_tap_zoom_in_effect flag. | 2597 // Zoom in to reset double_tap_zoom_in_effect flag. |
2598 webViewHelper.webViewImpl()->applyScrollAndScale(WebSize(), 1.1f); | 2598 webViewHelper.webViewImpl()->applyViewportDeltas(WebSize(), 1.1f, 0); |
2599 // 1 < accessibilityFontScaleFactor < minimumPageScale < doubleTapZoomAlread
yLegibleScale | 2599 // 1 < accessibilityFontScaleFactor < minimumPageScale < doubleTapZoomAlread
yLegibleScale |
2600 webViewHelper.webView()->setPageScaleFactorLimits(1.0f, 4); | 2600 webViewHelper.webView()->setPageScaleFactorLimits(1.0f, 4); |
2601 webViewHelper.webView()->layout(); | 2601 webViewHelper.webView()->layout(); |
2602 doubleTapZoomAlreadyLegibleScale = webViewHelper.webViewImpl()->minimumPageS
caleFactor() * doubleTapZoomAlreadyLegibleRatio; | 2602 doubleTapZoomAlreadyLegibleScale = webViewHelper.webViewImpl()->minimumPageS
caleFactor() * doubleTapZoomAlreadyLegibleRatio; |
2603 setScaleAndScrollAndLayout(webViewHelper.webViewImpl(), WebPoint(0, 0), (web
ViewHelper.webViewImpl()->minimumPageScaleFactor()) * (1 + doubleTapZoomAlreadyL
egibleRatio) / 2); | 2603 setScaleAndScrollAndLayout(webViewHelper.webViewImpl(), WebPoint(0, 0), (web
ViewHelper.webViewImpl()->minimumPageScaleFactor()) * (1 + doubleTapZoomAlreadyL
egibleRatio) / 2); |
2604 simulateDoubleTap(webViewHelper.webViewImpl(), doubleTapPoint, scale); | 2604 simulateDoubleTap(webViewHelper.webViewImpl(), doubleTapPoint, scale); |
2605 EXPECT_FLOAT_EQ(doubleTapZoomAlreadyLegibleScale, scale); | 2605 EXPECT_FLOAT_EQ(doubleTapZoomAlreadyLegibleScale, scale); |
2606 simulateDoubleTap(webViewHelper.webViewImpl(), doubleTapPoint, scale); | 2606 simulateDoubleTap(webViewHelper.webViewImpl(), doubleTapPoint, scale); |
2607 EXPECT_FLOAT_EQ(webViewHelper.webViewImpl()->minimumPageScaleFactor(), scale
); | 2607 EXPECT_FLOAT_EQ(webViewHelper.webViewImpl()->minimumPageScaleFactor(), scale
); |
2608 simulateDoubleTap(webViewHelper.webViewImpl(), doubleTapPoint, scale); | 2608 simulateDoubleTap(webViewHelper.webViewImpl(), doubleTapPoint, scale); |
2609 EXPECT_FLOAT_EQ(doubleTapZoomAlreadyLegibleScale, scale); | 2609 EXPECT_FLOAT_EQ(doubleTapZoomAlreadyLegibleScale, scale); |
2610 | 2610 |
2611 // Zoom in to reset double_tap_zoom_in_effect flag. | 2611 // Zoom in to reset double_tap_zoom_in_effect flag. |
2612 webViewHelper.webViewImpl()->applyScrollAndScale(WebSize(), 1.1f); | 2612 webViewHelper.webViewImpl()->applyViewportDeltas(WebSize(), 1.1f, 0); |
2613 // minimumPageScale < 1 < accessibilityFontScaleFactor < doubleTapZoomAlread
yLegibleScale | 2613 // minimumPageScale < 1 < accessibilityFontScaleFactor < doubleTapZoomAlread
yLegibleScale |
2614 webViewHelper.webView()->setPageScaleFactorLimits(0.95f, 4); | 2614 webViewHelper.webView()->setPageScaleFactorLimits(0.95f, 4); |
2615 webViewHelper.webView()->layout(); | 2615 webViewHelper.webView()->layout(); |
2616 doubleTapZoomAlreadyLegibleScale = webViewHelper.webViewImpl()->minimumPageS
caleFactor() * doubleTapZoomAlreadyLegibleRatio; | 2616 doubleTapZoomAlreadyLegibleScale = webViewHelper.webViewImpl()->minimumPageS
caleFactor() * doubleTapZoomAlreadyLegibleRatio; |
2617 setScaleAndScrollAndLayout(webViewHelper.webViewImpl(), WebPoint(0, 0), (web
ViewHelper.webViewImpl()->minimumPageScaleFactor()) * (1 + doubleTapZoomAlreadyL
egibleRatio) / 2); | 2617 setScaleAndScrollAndLayout(webViewHelper.webViewImpl(), WebPoint(0, 0), (web
ViewHelper.webViewImpl()->minimumPageScaleFactor()) * (1 + doubleTapZoomAlreadyL
egibleRatio) / 2); |
2618 simulateDoubleTap(webViewHelper.webViewImpl(), doubleTapPoint, scale); | 2618 simulateDoubleTap(webViewHelper.webViewImpl(), doubleTapPoint, scale); |
2619 EXPECT_FLOAT_EQ(doubleTapZoomAlreadyLegibleScale, scale); | 2619 EXPECT_FLOAT_EQ(doubleTapZoomAlreadyLegibleScale, scale); |
2620 simulateDoubleTap(webViewHelper.webViewImpl(), doubleTapPoint, scale); | 2620 simulateDoubleTap(webViewHelper.webViewImpl(), doubleTapPoint, scale); |
2621 EXPECT_FLOAT_EQ(webViewHelper.webViewImpl()->minimumPageScaleFactor(), scale
); | 2621 EXPECT_FLOAT_EQ(webViewHelper.webViewImpl()->minimumPageScaleFactor(), scale
); |
2622 simulateDoubleTap(webViewHelper.webViewImpl(), doubleTapPoint, scale); | 2622 simulateDoubleTap(webViewHelper.webViewImpl(), doubleTapPoint, scale); |
2623 EXPECT_FLOAT_EQ(doubleTapZoomAlreadyLegibleScale, scale); | 2623 EXPECT_FLOAT_EQ(doubleTapZoomAlreadyLegibleScale, scale); |
2624 | 2624 |
2625 // Zoom in to reset double_tap_zoom_in_effect flag. | 2625 // Zoom in to reset double_tap_zoom_in_effect flag. |
2626 webViewHelper.webViewImpl()->applyScrollAndScale(WebSize(), 1.1f); | 2626 webViewHelper.webViewImpl()->applyViewportDeltas(WebSize(), 1.1f, 0); |
2627 // minimumPageScale < 1 < doubleTapZoomAlreadyLegibleScale < accessibilityFo
ntScaleFactor | 2627 // minimumPageScale < 1 < doubleTapZoomAlreadyLegibleScale < accessibilityFo
ntScaleFactor |
2628 webViewHelper.webView()->setPageScaleFactorLimits(0.9f, 4); | 2628 webViewHelper.webView()->setPageScaleFactorLimits(0.9f, 4); |
2629 webViewHelper.webView()->layout(); | 2629 webViewHelper.webView()->layout(); |
2630 doubleTapZoomAlreadyLegibleScale = webViewHelper.webViewImpl()->minimumPageS
caleFactor() * doubleTapZoomAlreadyLegibleRatio; | 2630 doubleTapZoomAlreadyLegibleScale = webViewHelper.webViewImpl()->minimumPageS
caleFactor() * doubleTapZoomAlreadyLegibleRatio; |
2631 setScaleAndScrollAndLayout(webViewHelper.webViewImpl(), WebPoint(0, 0), (web
ViewHelper.webViewImpl()->minimumPageScaleFactor()) * (1 + doubleTapZoomAlreadyL
egibleRatio) / 2); | 2631 setScaleAndScrollAndLayout(webViewHelper.webViewImpl(), WebPoint(0, 0), (web
ViewHelper.webViewImpl()->minimumPageScaleFactor()) * (1 + doubleTapZoomAlreadyL
egibleRatio) / 2); |
2632 simulateDoubleTap(webViewHelper.webViewImpl(), doubleTapPoint, scale); | 2632 simulateDoubleTap(webViewHelper.webViewImpl(), doubleTapPoint, scale); |
2633 EXPECT_FLOAT_EQ(legibleScale, scale); | 2633 EXPECT_FLOAT_EQ(legibleScale, scale); |
2634 simulateDoubleTap(webViewHelper.webViewImpl(), doubleTapPoint, scale); | 2634 simulateDoubleTap(webViewHelper.webViewImpl(), doubleTapPoint, scale); |
2635 EXPECT_FLOAT_EQ(webViewHelper.webViewImpl()->minimumPageScaleFactor(), scale
); | 2635 EXPECT_FLOAT_EQ(webViewHelper.webViewImpl()->minimumPageScaleFactor(), scale
); |
2636 simulateDoubleTap(webViewHelper.webViewImpl(), doubleTapPoint, scale); | 2636 simulateDoubleTap(webViewHelper.webViewImpl(), doubleTapPoint, scale); |
(...skipping 2324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4961 // only becomes available after the load begins. | 4961 // only becomes available after the load begins. |
4962 FrameTestHelpers::WebViewHelper webViewHelper; | 4962 FrameTestHelpers::WebViewHelper webViewHelper; |
4963 webViewHelper.initializeAndLoad(m_baseURL + "long_scroll.html", true, &clien
t); | 4963 webViewHelper.initializeAndLoad(m_baseURL + "long_scroll.html", true, &clien
t); |
4964 webViewHelper.webView()->resize(WebSize(1000, 1000)); | 4964 webViewHelper.webView()->resize(WebSize(1000, 1000)); |
4965 webViewHelper.webView()->layout(); | 4965 webViewHelper.webView()->layout(); |
4966 | 4966 |
4967 EXPECT_FALSE(client.wasUserScroll()); | 4967 EXPECT_FALSE(client.wasUserScroll()); |
4968 EXPECT_FALSE(client.wasProgrammaticScroll()); | 4968 EXPECT_FALSE(client.wasProgrammaticScroll()); |
4969 | 4969 |
4970 // Do a compositor scroll, verify that this is counted as a user scroll. | 4970 // Do a compositor scroll, verify that this is counted as a user scroll. |
4971 webViewHelper.webViewImpl()->applyScrollAndScale(WebSize(0, 1), 1.1f); | 4971 webViewHelper.webViewImpl()->applyViewportDeltas(WebSize(0, 1), 1.1f, 0); |
4972 EXPECT_TRUE(client.wasUserScroll()); | 4972 EXPECT_TRUE(client.wasUserScroll()); |
4973 client.reset(); | 4973 client.reset(); |
4974 | 4974 |
4975 EXPECT_FALSE(client.wasUserScroll()); | 4975 EXPECT_FALSE(client.wasUserScroll()); |
4976 EXPECT_FALSE(client.wasProgrammaticScroll()); | 4976 EXPECT_FALSE(client.wasProgrammaticScroll()); |
4977 | 4977 |
4978 // The page scale 1.0f and scroll. | 4978 // The page scale 1.0f and scroll. |
4979 webViewHelper.webViewImpl()->applyScrollAndScale(WebSize(0, 1), 1.0f); | 4979 webViewHelper.webViewImpl()->applyViewportDeltas(WebSize(0, 1), 1.0f, 0); |
4980 EXPECT_TRUE(client.wasUserScroll()); | 4980 EXPECT_TRUE(client.wasUserScroll()); |
4981 client.reset(); | 4981 client.reset(); |
4982 | 4982 |
4983 // No scroll event if there is no scroll delta. | 4983 // No scroll event if there is no scroll delta. |
4984 webViewHelper.webViewImpl()->applyScrollAndScale(WebSize(), 1.0f); | 4984 webViewHelper.webViewImpl()->applyViewportDeltas(WebSize(), 1.0f, 0); |
4985 EXPECT_FALSE(client.wasUserScroll()); | 4985 EXPECT_FALSE(client.wasUserScroll()); |
4986 EXPECT_FALSE(client.wasProgrammaticScroll()); | 4986 EXPECT_FALSE(client.wasProgrammaticScroll()); |
4987 client.reset(); | 4987 client.reset(); |
4988 | 4988 |
4989 // Non zero page scale and scroll. | 4989 // Non zero page scale and scroll. |
4990 webViewHelper.webViewImpl()->applyScrollAndScale(WebSize(9, 13), 0.6f); | 4990 webViewHelper.webViewImpl()->applyViewportDeltas(WebSize(9, 13), 0.6f, 0); |
4991 EXPECT_TRUE(client.wasUserScroll()); | 4991 EXPECT_TRUE(client.wasUserScroll()); |
4992 client.reset(); | 4992 client.reset(); |
4993 | 4993 |
4994 // Programmatic scroll. | 4994 // Programmatic scroll. |
4995 WebLocalFrameImpl* frameImpl = webViewHelper.webViewImpl()->mainFrameImpl(); | 4995 WebLocalFrameImpl* frameImpl = webViewHelper.webViewImpl()->mainFrameImpl(); |
4996 frameImpl->executeScript(WebScriptSource("window.scrollTo(0, 20);")); | 4996 frameImpl->executeScript(WebScriptSource("window.scrollTo(0, 20);")); |
4997 EXPECT_FALSE(client.wasUserScroll()); | 4997 EXPECT_FALSE(client.wasUserScroll()); |
4998 EXPECT_TRUE(client.wasProgrammaticScroll()); | 4998 EXPECT_TRUE(client.wasProgrammaticScroll()); |
4999 client.reset(); | 4999 client.reset(); |
5000 | 5000 |
(...skipping 14 matching lines...) Expand all Loading... |
5015 FrameTestHelpers::WebViewHelper webViewHelper; | 5015 FrameTestHelpers::WebViewHelper webViewHelper; |
5016 webViewHelper.initializeAndLoad(m_baseURL + "short_scroll.html", true, &clie
nt); | 5016 webViewHelper.initializeAndLoad(m_baseURL + "short_scroll.html", true, &clie
nt); |
5017 | 5017 |
5018 webViewHelper.webView()->resize(WebSize(1000, 1000)); | 5018 webViewHelper.webView()->resize(WebSize(1000, 1000)); |
5019 webViewHelper.webView()->layout(); | 5019 webViewHelper.webView()->layout(); |
5020 | 5020 |
5021 EXPECT_FALSE(client.wasUserScroll()); | 5021 EXPECT_FALSE(client.wasUserScroll()); |
5022 EXPECT_FALSE(client.wasProgrammaticScroll()); | 5022 EXPECT_FALSE(client.wasProgrammaticScroll()); |
5023 | 5023 |
5024 // Non zero page scale and scroll. | 5024 // Non zero page scale and scroll. |
5025 webViewHelper.webViewImpl()->applyScrollAndScale(WebSize(9, 13), 2.0f); | 5025 webViewHelper.webViewImpl()->applyViewportDeltas(WebSize(9, 13), 2.0f, 0); |
5026 EXPECT_FALSE(client.wasProgrammaticScroll()); | 5026 EXPECT_FALSE(client.wasProgrammaticScroll()); |
5027 EXPECT_TRUE(client.wasUserScroll()); | 5027 EXPECT_TRUE(client.wasUserScroll()); |
5028 client.reset(); | 5028 client.reset(); |
5029 } | 5029 } |
5030 | 5030 |
5031 TEST_F(WebFrameTest, FirstPartyForCookiesForRedirect) | 5031 TEST_F(WebFrameTest, FirstPartyForCookiesForRedirect) |
5032 { | 5032 { |
5033 WTF::String filePath = Platform::current()->unitTestSupport()->webKitRootDir
(); | 5033 WTF::String filePath = Platform::current()->unitTestSupport()->webKitRootDir
(); |
5034 filePath.append("/Source/web/tests/data/first_party.html"); | 5034 filePath.append("/Source/web/tests/data/first_party.html"); |
5035 | 5035 |
(...skipping 1146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6182 EXPECT_EQ(1u, frameClient.navigationalDataReceivedCount()); | 6182 EXPECT_EQ(1u, frameClient.navigationalDataReceivedCount()); |
6183 | 6183 |
6184 // Neither should a page reload. | 6184 // Neither should a page reload. |
6185 localFrame->reload(); | 6185 localFrame->reload(); |
6186 EXPECT_EQ(4u, frameClient.provisionalLoadCount()); | 6186 EXPECT_EQ(4u, frameClient.provisionalLoadCount()); |
6187 EXPECT_FALSE(frameClient.wasLastProvisionalLoadATransition()); | 6187 EXPECT_FALSE(frameClient.wasLastProvisionalLoadATransition()); |
6188 EXPECT_EQ(1u, frameClient.navigationalDataReceivedCount()); | 6188 EXPECT_EQ(1u, frameClient.navigationalDataReceivedCount()); |
6189 } | 6189 } |
6190 | 6190 |
6191 } // namespace | 6191 } // namespace |
OLD | NEW |