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

Side by Side Diff: third_party/WebKit/Source/web/tests/WebFrameTest.cpp

Issue 1772253002: Disable some flakily failing tests under Mac ASAN (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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 unified diff | Download patch
« no previous file with comments | « third_party/WebKit/Source/core/html/HTMLTextFormControlElementTest.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 292 matching lines...) Expand 10 before | Expand all | Expand 10 after
303 switch (config) { 303 switch (config) {
304 case Default: 304 case Default:
305 *os << "Default"; 305 *os << "Default";
306 break; 306 break;
307 case RootLayerScrolls: 307 case RootLayerScrolls:
308 *os << "RootLayerScrolls"; 308 *os << "RootLayerScrolls";
309 break; 309 break;
310 } 310 }
311 } 311 }
312 312
313 // Flakily failing on Mac ASAN.
314 // https://crbug.com/592771
315 #if OS(MACOSX) && defined(ADDRESS_SANITIZER)
316 #define MAYBE(test) DISABLED_##test
317 #else
318 #define MAYBE(test) test
319 #endif
320
313 INSTANTIATE_TEST_CASE_P(All, ParameterizedWebFrameTest, ::testing::Values( 321 INSTANTIATE_TEST_CASE_P(All, ParameterizedWebFrameTest, ::testing::Values(
314 ParameterizedWebFrameTestConfig::Default, 322 ParameterizedWebFrameTestConfig::Default,
315 ParameterizedWebFrameTestConfig::RootLayerScrolls)); 323 ParameterizedWebFrameTestConfig::RootLayerScrolls));
316 324
317 TEST_P(ParameterizedWebFrameTest, ContentText) 325 TEST_P(ParameterizedWebFrameTest, ContentText)
318 { 326 {
319 registerMockedHttpURLLoad("iframes_test.html"); 327 registerMockedHttpURLLoad("iframes_test.html");
320 registerMockedHttpURLLoad("visible_iframe.html"); 328 registerMockedHttpURLLoad("visible_iframe.html");
321 registerMockedHttpURLLoad("invisible_iframe.html"); 329 registerMockedHttpURLLoad("invisible_iframe.html");
322 registerMockedHttpURLLoad("zero_sized_iframe.html"); 330 registerMockedHttpURLLoad("zero_sized_iframe.html");
(...skipping 1053 matching lines...) Expand 10 before | Expand all | Expand 10 after
1376 float enforcedPageScaleFactor = 0.5f; 1384 float enforcedPageScaleFactor = 0.5f;
1377 1385
1378 FrameTestHelpers::WebViewHelper webViewHelper(this); 1386 FrameTestHelpers::WebViewHelper webViewHelper(this);
1379 webViewHelper.initializeAndLoad(m_baseURL + "viewport-wide-2x-initial-scale. html", true, 0, &client, enableViewportSettings); 1387 webViewHelper.initializeAndLoad(m_baseURL + "viewport-wide-2x-initial-scale. html", true, 0, &client, enableViewportSettings);
1380 webViewHelper.webView()->setInitialPageScaleOverride(enforcedPageScaleFactor ); 1388 webViewHelper.webView()->setInitialPageScaleOverride(enforcedPageScaleFactor );
1381 webViewHelper.resize(WebSize(viewportWidth, viewportHeight)); 1389 webViewHelper.resize(WebSize(viewportWidth, viewportHeight));
1382 1390
1383 EXPECT_EQ(enforcedPageScaleFactor, webViewHelper.webView()->pageScaleFactor( )); 1391 EXPECT_EQ(enforcedPageScaleFactor, webViewHelper.webView()->pageScaleFactor( ));
1384 } 1392 }
1385 1393
1386 TEST_P(ParameterizedWebFrameTest, SmallPermanentInitialPageScaleFactorIsClobbere d) 1394 TEST_P(ParameterizedWebFrameTest, MAYBE(SmallPermanentInitialPageScaleFactorIsCl obbered))
1387 { 1395 {
1388 const char* pages[] = { 1396 const char* pages[] = {
1389 // These pages trigger the clobbering condition. There must be a matchin g item in "pageScaleFactors" array. 1397 // These pages trigger the clobbering condition. There must be a matchin g item in "pageScaleFactors" array.
1390 "viewport-device-0.5x-initial-scale.html", 1398 "viewport-device-0.5x-initial-scale.html",
1391 "viewport-initial-scale-1.html", 1399 "viewport-initial-scale-1.html",
1392 // These ones do not. 1400 // These ones do not.
1393 "viewport-auto-initial-scale.html", 1401 "viewport-auto-initial-scale.html",
1394 "viewport-target-densitydpi-device-and-fixed-width.html" 1402 "viewport-target-densitydpi-device-and-fixed-width.html"
1395 }; 1403 };
1396 float pageScaleFactors[] = { 0.5f, 1.0f }; 1404 float pageScaleFactors[] = { 0.5f, 1.0f };
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after
1628 EXPECT_EQ(0, childDocument->firstBodyElement()->getIntegralAttribute(HTMLNam es::marginheightAttr)); 1636 EXPECT_EQ(0, childDocument->firstBodyElement()->getIntegralAttribute(HTMLNam es::marginheightAttr));
1629 1637
1630 FrameView* frameView = static_cast<WebLocalFrameImpl*>(localFrame)->frameVie w(); 1638 FrameView* frameView = static_cast<WebLocalFrameImpl*>(localFrame)->frameVie w();
1631 EXPECT_EQ(nullptr, frameView->horizontalScrollbar()); 1639 EXPECT_EQ(nullptr, frameView->horizontalScrollbar());
1632 EXPECT_EQ(nullptr, frameView->verticalScrollbar()); 1640 EXPECT_EQ(nullptr, frameView->verticalScrollbar());
1633 1641
1634 view->close(); 1642 view->close();
1635 } 1643 }
1636 1644
1637 1645
1638 TEST_P(ParameterizedWebFrameTest, SetForceZeroLayoutHeightWorksAcrossNavigations ) 1646 TEST_P(ParameterizedWebFrameTest, MAYBE(SetForceZeroLayoutHeightWorksAcrossNavig ations))
1639 { 1647 {
1640 registerMockedHttpURLLoad("200-by-300.html"); 1648 registerMockedHttpURLLoad("200-by-300.html");
1641 registerMockedHttpURLLoad("large-div.html"); 1649 registerMockedHttpURLLoad("large-div.html");
1642 1650
1643 FixedLayoutTestWebViewClient client; 1651 FixedLayoutTestWebViewClient client;
1644 client.m_screenInfo.deviceScaleFactor = 1; 1652 client.m_screenInfo.deviceScaleFactor = 1;
1645 int viewportWidth = 640; 1653 int viewportWidth = 640;
1646 int viewportHeight = 480; 1654 int viewportHeight = 480;
1647 1655
1648 FrameTestHelpers::WebViewHelper webViewHelper(this); 1656 FrameTestHelpers::WebViewHelper webViewHelper(this);
(...skipping 21 matching lines...) Expand all
1670 1678
1671 webViewHelper.initializeAndLoad(m_baseURL + "200-by-300.html", true, 0, &cli ent, enableViewportSettings); 1679 webViewHelper.initializeAndLoad(m_baseURL + "200-by-300.html", true, 0, &cli ent, enableViewportSettings);
1672 webViewHelper.webView()->settings()->setWideViewportQuirkEnabled(true); 1680 webViewHelper.webView()->settings()->setWideViewportQuirkEnabled(true);
1673 webViewHelper.webView()->settings()->setUseWideViewport(true); 1681 webViewHelper.webView()->settings()->setUseWideViewport(true);
1674 webViewHelper.webView()->settings()->setForceZeroLayoutHeight(true); 1682 webViewHelper.webView()->settings()->setForceZeroLayoutHeight(true);
1675 webViewHelper.resize(WebSize(viewportWidth, viewportHeight)); 1683 webViewHelper.resize(WebSize(viewportWidth, viewportHeight));
1676 1684
1677 EXPECT_EQ(0, webViewHelper.webViewImpl()->mainFrameImpl()->frameView()->layo utSize().height()); 1685 EXPECT_EQ(0, webViewHelper.webViewImpl()->mainFrameImpl()->frameView()->layo utSize().height());
1678 } 1686 }
1679 1687
1680 TEST_P(ParameterizedWebFrameTest, WideViewportAndWideContentWithInitialScale) 1688 TEST_P(ParameterizedWebFrameTest, MAYBE(WideViewportAndWideContentWithInitialSca le))
1681 { 1689 {
1682 registerMockedHttpURLLoad("wide_document_width_viewport.html"); 1690 registerMockedHttpURLLoad("wide_document_width_viewport.html");
1683 registerMockedHttpURLLoad("white-1x1.png"); 1691 registerMockedHttpURLLoad("white-1x1.png");
1684 1692
1685 FixedLayoutTestWebViewClient client; 1693 FixedLayoutTestWebViewClient client;
1686 client.m_screenInfo.deviceScaleFactor = 1; 1694 client.m_screenInfo.deviceScaleFactor = 1;
1687 int viewportWidth = 600; 1695 int viewportWidth = 600;
1688 int viewportHeight = 800; 1696 int viewportHeight = 800;
1689 1697
1690 FrameTestHelpers::WebViewHelper webViewHelper(this); 1698 FrameTestHelpers::WebViewHelper webViewHelper(this);
1691 webViewHelper.initializeAndLoad("about:blank", true, 0, &client, enableViewp ortSettings); 1699 webViewHelper.initializeAndLoad("about:blank", true, 0, &client, enableViewp ortSettings);
1692 webViewHelper.webView()->settings()->setWideViewportQuirkEnabled(true); 1700 webViewHelper.webView()->settings()->setWideViewportQuirkEnabled(true);
1693 webViewHelper.webView()->settings()->setUseWideViewport(true); 1701 webViewHelper.webView()->settings()->setUseWideViewport(true);
1694 webViewHelper.webView()->settings()->setViewportMetaLayoutSizeQuirk(true); 1702 webViewHelper.webView()->settings()->setViewportMetaLayoutSizeQuirk(true);
1695 webViewHelper.resize(WebSize(viewportWidth, viewportHeight)); 1703 webViewHelper.resize(WebSize(viewportWidth, viewportHeight));
1696 1704
1697 FrameTestHelpers::loadFrame(webViewHelper.webView()->mainFrame(), m_baseURL + "wide_document_width_viewport.html"); 1705 FrameTestHelpers::loadFrame(webViewHelper.webView()->mainFrame(), m_baseURL + "wide_document_width_viewport.html");
1698 webViewHelper.resize(WebSize(viewportWidth, viewportHeight)); 1706 webViewHelper.resize(WebSize(viewportWidth, viewportHeight));
1699 1707
1700 int wideDocumentWidth = 800; 1708 int wideDocumentWidth = 800;
1701 float minimumPageScaleFactor = viewportWidth / (float) wideDocumentWidth; 1709 float minimumPageScaleFactor = viewportWidth / (float) wideDocumentWidth;
1702 EXPECT_EQ(minimumPageScaleFactor, webViewHelper.webViewImpl()->pageScaleFact or()); 1710 EXPECT_EQ(minimumPageScaleFactor, webViewHelper.webViewImpl()->pageScaleFact or());
1703 EXPECT_EQ(minimumPageScaleFactor, webViewHelper.webViewImpl()->minimumPageSc aleFactor()); 1711 EXPECT_EQ(minimumPageScaleFactor, webViewHelper.webViewImpl()->minimumPageSc aleFactor());
1704 } 1712 }
1705 1713
1706 TEST_P(ParameterizedWebFrameTest, WideViewportQuirkClobbersHeight) 1714 TEST_P(ParameterizedWebFrameTest, MAYBE(WideViewportQuirkClobbersHeight))
1707 { 1715 {
1708 registerMockedHttpURLLoad("viewport-height-1000.html"); 1716 registerMockedHttpURLLoad("viewport-height-1000.html");
1709 1717
1710 FixedLayoutTestWebViewClient client; 1718 FixedLayoutTestWebViewClient client;
1711 client.m_screenInfo.deviceScaleFactor = 1; 1719 client.m_screenInfo.deviceScaleFactor = 1;
1712 int viewportWidth = 600; 1720 int viewportWidth = 600;
1713 int viewportHeight = 800; 1721 int viewportHeight = 800;
1714 1722
1715 FrameTestHelpers::WebViewHelper webViewHelper(this); 1723 FrameTestHelpers::WebViewHelper webViewHelper(this);
1716 webViewHelper.initializeAndLoad("about:blank", true, 0, &client, enableViewp ortSettings); 1724 webViewHelper.initializeAndLoad("about:blank", true, 0, &client, enableViewp ortSettings);
1717 webViewHelper.webView()->settings()->setWideViewportQuirkEnabled(true); 1725 webViewHelper.webView()->settings()->setWideViewportQuirkEnabled(true);
1718 webViewHelper.webView()->settings()->setUseWideViewport(false); 1726 webViewHelper.webView()->settings()->setUseWideViewport(false);
1719 webViewHelper.webView()->settings()->setViewportMetaLayoutSizeQuirk(true); 1727 webViewHelper.webView()->settings()->setViewportMetaLayoutSizeQuirk(true);
1720 webViewHelper.resize(WebSize(viewportWidth, viewportHeight)); 1728 webViewHelper.resize(WebSize(viewportWidth, viewportHeight));
1721 1729
1722 FrameTestHelpers::loadFrame(webViewHelper.webView()->mainFrame(), m_baseURL + "viewport-height-1000.html"); 1730 FrameTestHelpers::loadFrame(webViewHelper.webView()->mainFrame(), m_baseURL + "viewport-height-1000.html");
1723 webViewHelper.resize(WebSize(viewportWidth, viewportHeight)); 1731 webViewHelper.resize(WebSize(viewportWidth, viewportHeight));
1724 1732
1725 EXPECT_EQ(800, webViewHelper.webViewImpl()->mainFrameImpl()->frameView()->la youtSize().height()); 1733 EXPECT_EQ(800, webViewHelper.webViewImpl()->mainFrameImpl()->frameView()->la youtSize().height());
1726 EXPECT_EQ(1, webViewHelper.webView()->pageScaleFactor()); 1734 EXPECT_EQ(1, webViewHelper.webView()->pageScaleFactor());
1727 } 1735 }
1728 1736
1729 TEST_P(ParameterizedWebFrameTest, LayoutSize320Quirk) 1737 TEST_P(ParameterizedWebFrameTest, MAYBE(LayoutSize320Quirk))
1730 { 1738 {
1731 registerMockedHttpURLLoad("viewport/viewport-30.html"); 1739 registerMockedHttpURLLoad("viewport/viewport-30.html");
1732 1740
1733 FixedLayoutTestWebViewClient client; 1741 FixedLayoutTestWebViewClient client;
1734 client.m_screenInfo.deviceScaleFactor = 1; 1742 client.m_screenInfo.deviceScaleFactor = 1;
1735 int viewportWidth = 600; 1743 int viewportWidth = 600;
1736 int viewportHeight = 800; 1744 int viewportHeight = 800;
1737 1745
1738 FrameTestHelpers::WebViewHelper webViewHelper(this); 1746 FrameTestHelpers::WebViewHelper webViewHelper(this);
1739 webViewHelper.initializeAndLoad("about:blank", true, 0, &client, enableViewp ortSettings); 1747 webViewHelper.initializeAndLoad("about:blank", true, 0, &client, enableViewp ortSettings);
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after
2018 FrameTestHelpers::WebViewHelper webViewHelper(this); 2026 FrameTestHelpers::WebViewHelper webViewHelper(this);
2019 webViewHelper.initializeAndLoad(m_baseURL + "fixed_layout.html", true, 0, &c lient, enableViewportSettings); 2027 webViewHelper.initializeAndLoad(m_baseURL + "fixed_layout.html", true, 0, &c lient, enableViewportSettings);
2020 webViewHelper.resize(WebSize(viewportWidth, viewportHeight)); 2028 webViewHelper.resize(WebSize(viewportWidth, viewportHeight));
2021 2029
2022 webViewHelper.webView()->setPageScaleFactor(2); 2030 webViewHelper.webView()->setPageScaleFactor(2);
2023 2031
2024 EXPECT_EQ(980, toLocalFrame(webViewHelper.webViewImpl()->page()->mainFrame() )->contentLayoutObject()->documentRect().width()); 2032 EXPECT_EQ(980, toLocalFrame(webViewHelper.webViewImpl()->page()->mainFrame() )->contentLayoutObject()->documentRect().width());
2025 EXPECT_EQ(980, webViewHelper.webViewImpl()->mainFrameImpl()->frameView()->co ntentsSize().width()); 2033 EXPECT_EQ(980, webViewHelper.webViewImpl()->mainFrameImpl()->frameView()->co ntentsSize().width());
2026 } 2034 }
2027 2035
2028 TEST_P(ParameterizedWebFrameTest, targetDensityDpiHigh) 2036 TEST_P(ParameterizedWebFrameTest, MAYBE(targetDensityDpiHigh))
2029 { 2037 {
2030 registerMockedHttpURLLoad("viewport-target-densitydpi-high.html"); 2038 registerMockedHttpURLLoad("viewport-target-densitydpi-high.html");
2031 2039
2032 FixedLayoutTestWebViewClient client; 2040 FixedLayoutTestWebViewClient client;
2033 // high-dpi = 240 2041 // high-dpi = 240
2034 float targetDpi = 240.0f; 2042 float targetDpi = 240.0f;
2035 float deviceScaleFactors[] = { 1.0f, 4.0f / 3.0f, 2.0f }; 2043 float deviceScaleFactors[] = { 1.0f, 4.0f / 3.0f, 2.0f };
2036 int viewportWidth = 640; 2044 int viewportWidth = 640;
2037 int viewportHeight = 480; 2045 int viewportHeight = 480;
2038 2046
(...skipping 10 matching lines...) Expand all
2049 2057
2050 // We need to account for the fact that logical pixels are unconditional ly multiplied by deviceScaleFactor to produce 2058 // We need to account for the fact that logical pixels are unconditional ly multiplied by deviceScaleFactor to produce
2051 // physical pixels. 2059 // physical pixels.
2052 float densityDpiScaleRatio = deviceScaleFactor * targetDpi / deviceDpi; 2060 float densityDpiScaleRatio = deviceScaleFactor * targetDpi / deviceDpi;
2053 EXPECT_NEAR(viewportWidth * densityDpiScaleRatio, webViewHelper.webViewI mpl()->mainFrameImpl()->frameView()->layoutSize().width(), 1.0f); 2061 EXPECT_NEAR(viewportWidth * densityDpiScaleRatio, webViewHelper.webViewI mpl()->mainFrameImpl()->frameView()->layoutSize().width(), 1.0f);
2054 EXPECT_NEAR(viewportHeight * densityDpiScaleRatio, webViewHelper.webView Impl()->mainFrameImpl()->frameView()->layoutSize().height(), 1.0f); 2062 EXPECT_NEAR(viewportHeight * densityDpiScaleRatio, webViewHelper.webView Impl()->mainFrameImpl()->frameView()->layoutSize().height(), 1.0f);
2055 EXPECT_NEAR(1.0f / densityDpiScaleRatio, webViewHelper.webView()->pageSc aleFactor(), 0.01f); 2063 EXPECT_NEAR(1.0f / densityDpiScaleRatio, webViewHelper.webView()->pageSc aleFactor(), 0.01f);
2056 } 2064 }
2057 } 2065 }
2058 2066
2059 TEST_P(ParameterizedWebFrameTest, targetDensityDpiDevice) 2067 TEST_P(ParameterizedWebFrameTest, MAYBE(targetDensityDpiDevice))
2060 { 2068 {
2061 registerMockedHttpURLLoad("viewport-target-densitydpi-device.html"); 2069 registerMockedHttpURLLoad("viewport-target-densitydpi-device.html");
2062 2070
2063 float deviceScaleFactors[] = { 1.0f, 4.0f / 3.0f, 2.0f }; 2071 float deviceScaleFactors[] = { 1.0f, 4.0f / 3.0f, 2.0f };
2064 2072
2065 FixedLayoutTestWebViewClient client; 2073 FixedLayoutTestWebViewClient client;
2066 int viewportWidth = 640; 2074 int viewportWidth = 640;
2067 int viewportHeight = 480; 2075 int viewportHeight = 480;
2068 2076
2069 for (size_t i = 0; i < WTF_ARRAY_LENGTH(deviceScaleFactors); ++i) { 2077 for (size_t i = 0; i < WTF_ARRAY_LENGTH(deviceScaleFactors); ++i) {
2070 client.m_screenInfo.deviceScaleFactor = deviceScaleFactors[i]; 2078 client.m_screenInfo.deviceScaleFactor = deviceScaleFactors[i];
2071 2079
2072 FrameTestHelpers::WebViewHelper webViewHelper(this); 2080 FrameTestHelpers::WebViewHelper webViewHelper(this);
2073 webViewHelper.initializeAndLoad(m_baseURL + "viewport-target-densitydpi- device.html", true, 0, &client, enableViewportSettings); 2081 webViewHelper.initializeAndLoad(m_baseURL + "viewport-target-densitydpi- device.html", true, 0, &client, enableViewportSettings);
2074 webViewHelper.webView()->settings()->setWideViewportQuirkEnabled(true); 2082 webViewHelper.webView()->settings()->setWideViewportQuirkEnabled(true);
2075 webViewHelper.webView()->settings()->setSupportDeprecatedTargetDensityDP I(true); 2083 webViewHelper.webView()->settings()->setSupportDeprecatedTargetDensityDP I(true);
2076 webViewHelper.resize(WebSize(viewportWidth, viewportHeight)); 2084 webViewHelper.resize(WebSize(viewportWidth, viewportHeight));
2077 2085
2078 EXPECT_NEAR(viewportWidth * client.m_screenInfo.deviceScaleFactor, webVi ewHelper.webViewImpl()->mainFrameImpl()->frameView()->layoutSize().width(), 1.0f ); 2086 EXPECT_NEAR(viewportWidth * client.m_screenInfo.deviceScaleFactor, webVi ewHelper.webViewImpl()->mainFrameImpl()->frameView()->layoutSize().width(), 1.0f );
2079 EXPECT_NEAR(viewportHeight * client.m_screenInfo.deviceScaleFactor, webV iewHelper.webViewImpl()->mainFrameImpl()->frameView()->layoutSize().height(), 1. 0f); 2087 EXPECT_NEAR(viewportHeight * client.m_screenInfo.deviceScaleFactor, webV iewHelper.webViewImpl()->mainFrameImpl()->frameView()->layoutSize().height(), 1. 0f);
2080 EXPECT_NEAR(1.0f / client.m_screenInfo.deviceScaleFactor, webViewHelper. webView()->pageScaleFactor(), 0.01f); 2088 EXPECT_NEAR(1.0f / client.m_screenInfo.deviceScaleFactor, webViewHelper. webView()->pageScaleFactor(), 0.01f);
2081 } 2089 }
2082 } 2090 }
2083 2091
2084 TEST_P(ParameterizedWebFrameTest, targetDensityDpiDeviceAndFixedWidth) 2092 TEST_P(ParameterizedWebFrameTest, MAYBE(targetDensityDpiDeviceAndFixedWidth))
2085 { 2093 {
2086 registerMockedHttpURLLoad("viewport-target-densitydpi-device-and-fixed-width .html"); 2094 registerMockedHttpURLLoad("viewport-target-densitydpi-device-and-fixed-width .html");
2087 2095
2088 float deviceScaleFactors[] = { 1.0f, 4.0f / 3.0f, 2.0f }; 2096 float deviceScaleFactors[] = { 1.0f, 4.0f / 3.0f, 2.0f };
2089 2097
2090 FixedLayoutTestWebViewClient client; 2098 FixedLayoutTestWebViewClient client;
2091 int viewportWidth = 640; 2099 int viewportWidth = 640;
2092 int viewportHeight = 480; 2100 int viewportHeight = 480;
2093 2101
2094 for (size_t i = 0; i < WTF_ARRAY_LENGTH(deviceScaleFactors); ++i) { 2102 for (size_t i = 0; i < WTF_ARRAY_LENGTH(deviceScaleFactors); ++i) {
(...skipping 785 matching lines...) Expand 10 before | Expand all | Expand 10 after
2880 blockBound = IntRect(webViewHelper.webViewImpl()->computeBlockBound(WebPoint (90, 90), true)); 2888 blockBound = IntRect(webViewHelper.webViewImpl()->computeBlockBound(WebPoint (90, 90), true));
2881 EXPECT_RECT_EQ(rectBack, blockBound); 2889 EXPECT_RECT_EQ(rectBack, blockBound);
2882 2890
2883 blockBound = IntRect(webViewHelper.webViewImpl()->computeBlockBound(WebPoint (109, 109), true)); 2891 blockBound = IntRect(webViewHelper.webViewImpl()->computeBlockBound(WebPoint (109, 109), true));
2884 EXPECT_RECT_EQ(rectBack, blockBound); 2892 EXPECT_RECT_EQ(rectBack, blockBound);
2885 2893
2886 blockBound = IntRect(webViewHelper.webViewImpl()->computeBlockBound(WebPoint (110, 110), true)); 2894 blockBound = IntRect(webViewHelper.webViewImpl()->computeBlockBound(WebPoint (110, 110), true));
2887 EXPECT_RECT_EQ(rectRightBottom, blockBound); 2895 EXPECT_RECT_EQ(rectRightBottom, blockBound);
2888 } 2896 }
2889 2897
2890 TEST_P(ParameterizedWebFrameTest, DivMultipleTargetZoomMultipleDivsTest) 2898 TEST_P(ParameterizedWebFrameTest, MAYBE(DivMultipleTargetZoomMultipleDivsTest))
2891 { 2899 {
2892 registerMockedHttpURLLoad("get_multiple_divs_for_auto_zoom_test.html"); 2900 registerMockedHttpURLLoad("get_multiple_divs_for_auto_zoom_test.html");
2893 2901
2894 const float deviceScaleFactor = 2.0f; 2902 const float deviceScaleFactor = 2.0f;
2895 int viewportWidth = 640 / deviceScaleFactor; 2903 int viewportWidth = 640 / deviceScaleFactor;
2896 int viewportHeight = 1280 / deviceScaleFactor; 2904 int viewportHeight = 1280 / deviceScaleFactor;
2897 float doubleTapZoomAlreadyLegibleRatio = 1.2f; 2905 float doubleTapZoomAlreadyLegibleRatio = 1.2f;
2898 FrameTestHelpers::WebViewHelper webViewHelper(this); 2906 FrameTestHelpers::WebViewHelper webViewHelper(this);
2899 webViewHelper.initializeAndLoad(m_baseURL + "get_multiple_divs_for_auto_zoom _test.html"); 2907 webViewHelper.initializeAndLoad(m_baseURL + "get_multiple_divs_for_auto_zoom _test.html");
2900 webViewHelper.resize(WebSize(viewportWidth, viewportHeight)); 2908 webViewHelper.resize(WebSize(viewportWidth, viewportHeight));
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after
3156 webViewHelper.webView()->advanceFocus(true); 3164 webViewHelper.webView()->advanceFocus(true);
3157 WebRect rect, caret; 3165 WebRect rect, caret;
3158 webViewHelper.webViewImpl()->selectionBounds(caret, rect); 3166 webViewHelper.webViewImpl()->selectionBounds(caret, rect);
3159 webViewHelper.webViewImpl()->computeScaleAndScrollForFocusedNode(webViewHelp er.webViewImpl()->focusedElement(), autoZoomToLegibleScale, scale, scroll, needA nimation); 3167 webViewHelper.webViewImpl()->computeScaleAndScrollForFocusedNode(webViewHelp er.webViewImpl()->focusedElement(), autoZoomToLegibleScale, scale, scroll, needA nimation);
3160 3168
3161 // There should be no change at all since the textbox is fully visible alrea dy. 3169 // There should be no change at all since the textbox is fully visible alrea dy.
3162 EXPECT_EQ(initialScale, scale); 3170 EXPECT_EQ(initialScale, scale);
3163 EXPECT_FALSE(needAnimation); 3171 EXPECT_FALSE(needAnimation);
3164 } 3172 }
3165 3173
3166 TEST_P(ParameterizedWebFrameTest, CharacterIndexAtPointWithPinchZoom) 3174 TEST_P(ParameterizedWebFrameTest, MAYBE(CharacterIndexAtPointWithPinchZoom))
3167 { 3175 {
3168 registerMockedHttpURLLoad("sometext.html"); 3176 registerMockedHttpURLLoad("sometext.html");
3169 3177
3170 FrameTestHelpers::WebViewHelper webViewHelper(this); 3178 FrameTestHelpers::WebViewHelper webViewHelper(this);
3171 webViewHelper.initializeAndLoad(m_baseURL + "sometext.html"); 3179 webViewHelper.initializeAndLoad(m_baseURL + "sometext.html");
3172 webViewHelper.resize(WebSize(640, 480)); 3180 webViewHelper.resize(WebSize(640, 480));
3173 3181
3174 webViewHelper.webViewImpl()->setPageScaleFactor(2); 3182 webViewHelper.webViewImpl()->setPageScaleFactor(2);
3175 webViewHelper.webViewImpl()->setVisualViewportOffset(WebFloatPoint(50, 60)); 3183 webViewHelper.webViewImpl()->setVisualViewportOffset(WebFloatPoint(50, 60));
3176 3184
(...skipping 1234 matching lines...) Expand 10 before | Expand all | Expand 10 after
4411 4419
4412 // If the selection is editable text, we can't extend it into non-editable t ext. 4420 // If the selection is editable text, we can't extend it into non-editable t ext.
4413 frame->executeScript(WebScriptSource("selectElement('editable_1');")); 4421 frame->executeScript(WebScriptSource("selectElement('editable_1');"));
4414 EXPECT_EQ("Editable 1.", selectionAsString(frame)); 4422 EXPECT_EQ("Editable 1.", selectionAsString(frame));
4415 frame->selectRange(topLeft(elementBounds(frame, "editable_1")), bottomRightM inusOne(elementBounds(frame, "footer_1"))); 4423 frame->selectRange(topLeft(elementBounds(frame, "editable_1")), bottomRightM inusOne(elementBounds(frame, "footer_1")));
4416 // positionForPoint returns the wrong values for contenteditable spans. See 4424 // positionForPoint returns the wrong values for contenteditable spans. See
4417 // http://crbug.com/238334. 4425 // http://crbug.com/238334.
4418 // EXPECT_EQ("Editable 1. Editable 2. ]", selectionAsString(frame)); 4426 // EXPECT_EQ("Editable 1. Editable 2. ]", selectionAsString(frame));
4419 } 4427 }
4420 4428
4421 TEST_P(ParameterizedWebFrameTest, MoveRangeSelectionExtent) 4429 TEST_P(ParameterizedWebFrameTest, MAYBE(MoveRangeSelectionExtent))
4422 { 4430 {
4423 WebLocalFrameImpl* frame; 4431 WebLocalFrameImpl* frame;
4424 WebRect startWebRect; 4432 WebRect startWebRect;
4425 WebRect endWebRect; 4433 WebRect endWebRect;
4426 4434
4427 registerMockedHttpURLLoad("move_range_selection_extent.html"); 4435 registerMockedHttpURLLoad("move_range_selection_extent.html");
4428 4436
4429 FrameTestHelpers::WebViewHelper webViewHelper(this); 4437 FrameTestHelpers::WebViewHelper webViewHelper(this);
4430 initializeTextSelectionWebView(m_baseURL + "move_range_selection_extent.html ", &webViewHelper); 4438 initializeTextSelectionWebView(m_baseURL + "move_range_selection_extent.html ", &webViewHelper);
4431 frame = toWebLocalFrameImpl(webViewHelper.webView()->mainFrame()); 4439 frame = toWebLocalFrameImpl(webViewHelper.webView()->mainFrame());
(...skipping 13 matching lines...) Expand all
4445 frame->moveRangeSelectionExtent(WebPoint(640, 480)); 4453 frame->moveRangeSelectionExtent(WebPoint(640, 480));
4446 EXPECT_EQ(" 16-char footer.", selectionAsString(frame)); 4454 EXPECT_EQ(" 16-char footer.", selectionAsString(frame));
4447 4455
4448 frame->moveRangeSelectionExtent(WebPoint(0, 0)); 4456 frame->moveRangeSelectionExtent(WebPoint(0, 0));
4449 EXPECT_EQ("16-char header. This text is initially selected.", selectionAsStr ing(frame)); 4457 EXPECT_EQ("16-char header. This text is initially selected.", selectionAsStr ing(frame));
4450 4458
4451 frame->executeCommand(WebString::fromUTF8("Unselect")); 4459 frame->executeCommand(WebString::fromUTF8("Unselect"));
4452 EXPECT_EQ("", selectionAsString(frame)); 4460 EXPECT_EQ("", selectionAsString(frame));
4453 } 4461 }
4454 4462
4455 TEST_P(ParameterizedWebFrameTest, MoveRangeSelectionExtentCannotCollapse) 4463 TEST_P(ParameterizedWebFrameTest, MAYBE(MoveRangeSelectionExtentCannotCollapse))
4456 { 4464 {
4457 WebLocalFrameImpl* frame; 4465 WebLocalFrameImpl* frame;
4458 WebRect startWebRect; 4466 WebRect startWebRect;
4459 WebRect endWebRect; 4467 WebRect endWebRect;
4460 4468
4461 registerMockedHttpURLLoad("move_range_selection_extent.html"); 4469 registerMockedHttpURLLoad("move_range_selection_extent.html");
4462 4470
4463 FrameTestHelpers::WebViewHelper webViewHelper(this); 4471 FrameTestHelpers::WebViewHelper webViewHelper(this);
4464 initializeTextSelectionWebView(m_baseURL + "move_range_selection_extent.html ", &webViewHelper); 4472 initializeTextSelectionWebView(m_baseURL + "move_range_selection_extent.html ", &webViewHelper);
4465 frame = toWebLocalFrameImpl(webViewHelper.webView()->mainFrame()); 4473 frame = toWebLocalFrameImpl(webViewHelper.webView()->mainFrame());
4466 EXPECT_EQ("This text is initially selected.", selectionAsString(frame)); 4474 EXPECT_EQ("This text is initially selected.", selectionAsString(frame));
4467 webViewHelper.webView()->selectionBounds(startWebRect, endWebRect); 4475 webViewHelper.webView()->selectionBounds(startWebRect, endWebRect);
4468 4476
4469 frame->moveRangeSelectionExtent(bottomRightMinusOne(startWebRect)); 4477 frame->moveRangeSelectionExtent(bottomRightMinusOne(startWebRect));
4470 EXPECT_EQ("This text is initially selected.", selectionAsString(frame)); 4478 EXPECT_EQ("This text is initially selected.", selectionAsString(frame));
4471 4479
4472 // Reset with swapped base and extent. 4480 // Reset with swapped base and extent.
4473 frame->selectRange(topLeft(endWebRect), bottomRightMinusOne(startWebRect)); 4481 frame->selectRange(topLeft(endWebRect), bottomRightMinusOne(startWebRect));
4474 EXPECT_EQ("This text is initially selected.", selectionAsString(frame)); 4482 EXPECT_EQ("This text is initially selected.", selectionAsString(frame));
4475 4483
4476 frame->moveRangeSelectionExtent(bottomRightMinusOne(endWebRect)); 4484 frame->moveRangeSelectionExtent(bottomRightMinusOne(endWebRect));
4477 EXPECT_EQ("This text is initially selected.", selectionAsString(frame)); 4485 EXPECT_EQ("This text is initially selected.", selectionAsString(frame));
4478 } 4486 }
4479 4487
4480 TEST_P(ParameterizedWebFrameTest, MoveRangeSelectionExtentScollsInputField) 4488 TEST_P(ParameterizedWebFrameTest, MAYBE(MoveRangeSelectionExtentScollsInputField ))
4481 { 4489 {
4482 WebLocalFrameImpl* frame; 4490 WebLocalFrameImpl* frame;
4483 WebRect startWebRect; 4491 WebRect startWebRect;
4484 WebRect endWebRect; 4492 WebRect endWebRect;
4485 4493
4486 registerMockedHttpURLLoad("move_range_selection_extent_input_field.html"); 4494 registerMockedHttpURLLoad("move_range_selection_extent_input_field.html");
4487 4495
4488 FrameTestHelpers::WebViewHelper webViewHelper(this); 4496 FrameTestHelpers::WebViewHelper webViewHelper(this);
4489 initializeTextSelectionWebView(m_baseURL + "move_range_selection_extent_inpu t_field.html", &webViewHelper); 4497 initializeTextSelectionWebView(m_baseURL + "move_range_selection_extent_inpu t_field.html", &webViewHelper);
4490 frame = toWebLocalFrameImpl(webViewHelper.webView()->mainFrame()); 4498 frame = toWebLocalFrameImpl(webViewHelper.webView()->mainFrame());
(...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after
4832 WebGestureEvent event; 4840 WebGestureEvent event;
4833 event.type = WebInputEvent::GestureTap; 4841 event.type = WebInputEvent::GestureTap;
4834 event.sourceDevice = WebGestureDeviceTouchscreen; 4842 event.sourceDevice = WebGestureDeviceTouchscreen;
4835 event.x = x; 4843 event.x = x;
4836 event.y = y; 4844 event.y = y;
4837 event.data.tap.width = 50; 4845 event.data.tap.width = 50;
4838 event.data.tap.height = 50; 4846 event.data.tap.height = 50;
4839 return event; 4847 return event;
4840 } 4848 }
4841 4849
4842 TEST_P(ParameterizedWebFrameTest, DisambiguationPopup) 4850 TEST_P(ParameterizedWebFrameTest, MAYBE(DisambiguationPopup))
4843 { 4851 {
4844 const std::string htmlFile = "disambiguation_popup.html"; 4852 const std::string htmlFile = "disambiguation_popup.html";
4845 registerMockedHttpURLLoad(htmlFile); 4853 registerMockedHttpURLLoad(htmlFile);
4846 4854
4847 DisambiguationPopupTestWebViewClient client; 4855 DisambiguationPopupTestWebViewClient client;
4848 4856
4849 // Make sure we initialize to minimum scale, even if the window size 4857 // Make sure we initialize to minimum scale, even if the window size
4850 // only becomes available after the load begins. 4858 // only becomes available after the load begins.
4851 FrameTestHelpers::WebViewHelper webViewHelper(this); 4859 FrameTestHelpers::WebViewHelper webViewHelper(this);
4852 webViewHelper.initializeAndLoad(m_baseURL + htmlFile, true, 0, &client); 4860 webViewHelper.initializeAndLoad(m_baseURL + htmlFile, true, 0, &client);
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
4886 // multi-target-tap. 4894 // multi-target-tap.
4887 webViewHelper.webView()->settings()->setMultiTargetTapNotificationEnabled(fa lse); 4895 webViewHelper.webView()->settings()->setMultiTargetTapNotificationEnabled(fa lse);
4888 4896
4889 for (int i = 0; i <= 46; i++) { 4897 for (int i = 0; i <= 46; i++) {
4890 client.resetTriggered(); 4898 client.resetTriggered();
4891 webViewHelper.webView()->handleInputEvent(fatTap(10 + i * 5, 590)); 4899 webViewHelper.webView()->handleInputEvent(fatTap(10 + i * 5, 590));
4892 EXPECT_FALSE(client.triggered()); 4900 EXPECT_FALSE(client.triggered());
4893 } 4901 }
4894 } 4902 }
4895 4903
4896 TEST_P(ParameterizedWebFrameTest, DisambiguationPopupNoContainer) 4904 TEST_P(ParameterizedWebFrameTest, MAYBE(DisambiguationPopupNoContainer))
4897 { 4905 {
4898 registerMockedHttpURLLoad("disambiguation_popup_no_container.html"); 4906 registerMockedHttpURLLoad("disambiguation_popup_no_container.html");
4899 4907
4900 DisambiguationPopupTestWebViewClient client; 4908 DisambiguationPopupTestWebViewClient client;
4901 4909
4902 // Make sure we initialize to minimum scale, even if the window size 4910 // Make sure we initialize to minimum scale, even if the window size
4903 // only becomes available after the load begins. 4911 // only becomes available after the load begins.
4904 FrameTestHelpers::WebViewHelper webViewHelper(this); 4912 FrameTestHelpers::WebViewHelper webViewHelper(this);
4905 webViewHelper.initializeAndLoad(m_baseURL + "disambiguation_popup_no_contain er.html", true, 0, &client); 4913 webViewHelper.initializeAndLoad(m_baseURL + "disambiguation_popup_no_contain er.html", true, 0, &client);
4906 webViewHelper.resize(WebSize(1000, 1000)); 4914 webViewHelper.resize(WebSize(1000, 1000));
4907 4915
4908 client.resetTriggered(); 4916 client.resetTriggered();
4909 webViewHelper.webView()->handleInputEvent(fatTap(50, 50)); 4917 webViewHelper.webView()->handleInputEvent(fatTap(50, 50));
4910 EXPECT_FALSE(client.triggered()); 4918 EXPECT_FALSE(client.triggered());
4911 } 4919 }
4912 4920
4913 TEST_P(ParameterizedWebFrameTest, DisambiguationPopupMobileSite) 4921 TEST_P(ParameterizedWebFrameTest, MAYBE(DisambiguationPopupMobileSite))
4914 { 4922 {
4915 const std::string htmlFile = "disambiguation_popup_mobile_site.html"; 4923 const std::string htmlFile = "disambiguation_popup_mobile_site.html";
4916 registerMockedHttpURLLoad(htmlFile); 4924 registerMockedHttpURLLoad(htmlFile);
4917 4925
4918 DisambiguationPopupTestWebViewClient client; 4926 DisambiguationPopupTestWebViewClient client;
4919 4927
4920 // Make sure we initialize to minimum scale, even if the window size 4928 // Make sure we initialize to minimum scale, even if the window size
4921 // only becomes available after the load begins. 4929 // only becomes available after the load begins.
4922 FrameTestHelpers::WebViewHelper webViewHelper(this); 4930 FrameTestHelpers::WebViewHelper webViewHelper(this);
4923 webViewHelper.initializeAndLoad(m_baseURL + htmlFile, true, 0, &client, enab leViewportSettings); 4931 webViewHelper.initializeAndLoad(m_baseURL + htmlFile, true, 0, &client, enab leViewportSettings);
(...skipping 13 matching lines...) Expand all
4937 EXPECT_FALSE(client.triggered()); 4945 EXPECT_FALSE(client.triggered());
4938 } 4946 }
4939 4947
4940 for (int i = 0; i <= 46; i++) { 4948 for (int i = 0; i <= 46; i++) {
4941 client.resetTriggered(); 4949 client.resetTriggered();
4942 webViewHelper.webView()->handleInputEvent(fatTap(10 + i * 5, 590)); 4950 webViewHelper.webView()->handleInputEvent(fatTap(10 + i * 5, 590));
4943 EXPECT_FALSE(client.triggered()); 4951 EXPECT_FALSE(client.triggered());
4944 } 4952 }
4945 } 4953 }
4946 4954
4947 TEST_P(ParameterizedWebFrameTest, DisambiguationPopupViewportSite) 4955 TEST_P(ParameterizedWebFrameTest, MAYBE(DisambiguationPopupViewportSite))
4948 { 4956 {
4949 const std::string htmlFile = "disambiguation_popup_viewport_site.html"; 4957 const std::string htmlFile = "disambiguation_popup_viewport_site.html";
4950 registerMockedHttpURLLoad(htmlFile); 4958 registerMockedHttpURLLoad(htmlFile);
4951 4959
4952 DisambiguationPopupTestWebViewClient client; 4960 DisambiguationPopupTestWebViewClient client;
4953 4961
4954 // Make sure we initialize to minimum scale, even if the window size 4962 // Make sure we initialize to minimum scale, even if the window size
4955 // only becomes available after the load begins. 4963 // only becomes available after the load begins.
4956 FrameTestHelpers::WebViewHelper webViewHelper(this); 4964 FrameTestHelpers::WebViewHelper webViewHelper(this);
4957 webViewHelper.initializeAndLoad(m_baseURL + htmlFile, true, 0, &client, enab leViewportSettings); 4965 webViewHelper.initializeAndLoad(m_baseURL + htmlFile, true, 0, &client, enab leViewportSettings);
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
5021 EXPECT_TRUE(client.triggered()); 5029 EXPECT_TRUE(client.triggered());
5022 5030
5023 // The same tap shouldn't trigger didTapMultipleTargets() after disabling th e notification for 5031 // The same tap shouldn't trigger didTapMultipleTargets() after disabling th e notification for
5024 // multi-target-tap. 5032 // multi-target-tap.
5025 webViewHelper.webView()->settings()->setMultiTargetTapNotificationEnabled(fa lse); 5033 webViewHelper.webView()->settings()->setMultiTargetTapNotificationEnabled(fa lse);
5026 client.resetTriggered(); 5034 client.resetTriggered();
5027 webViewHelper.webView()->handleInputEvent(fatTap(10, 60)); 5035 webViewHelper.webView()->handleInputEvent(fatTap(10, 60));
5028 EXPECT_FALSE(client.triggered()); 5036 EXPECT_FALSE(client.triggered());
5029 } 5037 }
5030 5038
5031 TEST_P(ParameterizedWebFrameTest, DisambiguationPopupBlacklist) 5039 TEST_P(ParameterizedWebFrameTest, MAYBE(DisambiguationPopupBlacklist))
5032 { 5040 {
5033 const unsigned viewportWidth = 500; 5041 const unsigned viewportWidth = 500;
5034 const unsigned viewportHeight = 1000; 5042 const unsigned viewportHeight = 1000;
5035 const unsigned divHeight = 100; 5043 const unsigned divHeight = 100;
5036 const std::string htmlFile = "disambiguation_popup_blacklist.html"; 5044 const std::string htmlFile = "disambiguation_popup_blacklist.html";
5037 registerMockedHttpURLLoad(htmlFile); 5045 registerMockedHttpURLLoad(htmlFile);
5038 5046
5039 DisambiguationPopupTestWebViewClient client; 5047 DisambiguationPopupTestWebViewClient client;
5040 5048
5041 // Make sure we initialize to minimum scale, even if the window size 5049 // Make sure we initialize to minimum scale, even if the window size
(...skipping 11 matching lines...) Expand all
5053 client.resetTriggered(); 5061 client.resetTriggered();
5054 webViewHelper.webView()->handleInputEvent(fatTap(viewportWidth / 2, divHeigh t)); 5062 webViewHelper.webView()->handleInputEvent(fatTap(viewportWidth / 2, divHeigh t));
5055 EXPECT_TRUE(client.triggered()); 5063 EXPECT_TRUE(client.triggered());
5056 5064
5057 // The third div container should be blacklisted if you click on the link it contains. 5065 // The third div container should be blacklisted if you click on the link it contains.
5058 client.resetTriggered(); 5066 client.resetTriggered();
5059 webViewHelper.webView()->handleInputEvent(fatTap(viewportWidth / 2, divHeigh t * 3.25)); 5067 webViewHelper.webView()->handleInputEvent(fatTap(viewportWidth / 2, divHeigh t * 3.25));
5060 EXPECT_FALSE(client.triggered()); 5068 EXPECT_FALSE(client.triggered());
5061 } 5069 }
5062 5070
5063 TEST_P(ParameterizedWebFrameTest, DisambiguationPopupPageScale) 5071 TEST_P(ParameterizedWebFrameTest, MAYBE(DisambiguationPopupPageScale))
5064 { 5072 {
5065 registerMockedHttpURLLoad("disambiguation_popup_page_scale.html"); 5073 registerMockedHttpURLLoad("disambiguation_popup_page_scale.html");
5066 5074
5067 DisambiguationPopupTestWebViewClient client; 5075 DisambiguationPopupTestWebViewClient client;
5068 5076
5069 // Make sure we initialize to minimum scale, even if the window size 5077 // Make sure we initialize to minimum scale, even if the window size
5070 // only becomes available after the load begins. 5078 // only becomes available after the load begins.
5071 FrameTestHelpers::WebViewHelper webViewHelper(this); 5079 FrameTestHelpers::WebViewHelper webViewHelper(this);
5072 webViewHelper.initializeAndLoad(m_baseURL + "disambiguation_popup_page_scale .html", true, 0, &client); 5080 webViewHelper.initializeAndLoad(m_baseURL + "disambiguation_popup_page_scale .html", true, 0, &client);
5073 webViewHelper.resize(WebSize(1000, 1000)); 5081 webViewHelper.resize(WebSize(1000, 1000));
(...skipping 1340 matching lines...) Expand 10 before | Expand all | Expand 10 after
6414 webViewHelper.resize(WebSize(100, 200)); 6422 webViewHelper.resize(WebSize(100, 200));
6415 EXPECT_EQ(800, bottomFixed->offsetTop() + bottomFixed->offsetHeight()); 6423 EXPECT_EQ(800, bottomFixed->offsetTop() + bottomFixed->offsetHeight());
6416 EXPECT_EQ(800, topBottomFixed->offsetHeight()); 6424 EXPECT_EQ(800, topBottomFixed->offsetHeight());
6417 6425
6418 // Now the layout viewport hits the content width limit of 500px so it'll be 500x500. 6426 // Now the layout viewport hits the content width limit of 500px so it'll be 500x500.
6419 webViewHelper.resize(WebSize(200, 200)); 6427 webViewHelper.resize(WebSize(200, 200));
6420 EXPECT_EQ(500, rightFixed->offsetLeft() + rightFixed->offsetWidth()); 6428 EXPECT_EQ(500, rightFixed->offsetLeft() + rightFixed->offsetWidth());
6421 EXPECT_EQ(500, leftRightFixed->offsetWidth()); 6429 EXPECT_EQ(500, leftRightFixed->offsetWidth());
6422 } 6430 }
6423 6431
6424 TEST_P(ParameterizedWebFrameTest, FrameViewMoveWithSetFrameRect) 6432 TEST_P(ParameterizedWebFrameTest, MAYBE(FrameViewMoveWithSetFrameRect))
6425 { 6433 {
6426 FrameTestHelpers::WebViewHelper webViewHelper(this); 6434 FrameTestHelpers::WebViewHelper webViewHelper(this);
6427 webViewHelper.initializeAndLoad("about:blank"); 6435 webViewHelper.initializeAndLoad("about:blank");
6428 webViewHelper.resize(WebSize(200, 200)); 6436 webViewHelper.resize(WebSize(200, 200));
6429 webViewHelper.webViewImpl()->updateAllLifecyclePhases(); 6437 webViewHelper.webViewImpl()->updateAllLifecyclePhases();
6430 6438
6431 FrameView* frameView = webViewHelper.webViewImpl()->mainFrameImpl()->frameVi ew(); 6439 FrameView* frameView = webViewHelper.webViewImpl()->mainFrameImpl()->frameVi ew();
6432 EXPECT_RECT_EQ(IntRect(0, 0, 200, 200), frameView->frameRect()); 6440 EXPECT_RECT_EQ(IntRect(0, 0, 200, 200), frameView->frameRect());
6433 frameView->setFrameRect(IntRect(100, 100, 200, 200)); 6441 frameView->setFrameRect(IntRect(100, 100, 200, 200));
6434 EXPECT_RECT_EQ(IntRect(100, 100, 200, 200), frameView->frameRect()); 6442 EXPECT_RECT_EQ(IntRect(100, 100, 200, 200), frameView->frameRect());
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
6617 ASSERT_TRUE(webScrollLayer->userScrollableHorizontal()); 6625 ASSERT_TRUE(webScrollLayer->userScrollableHorizontal());
6618 ASSERT_TRUE(webScrollLayer->userScrollableVertical()); 6626 ASSERT_TRUE(webScrollLayer->userScrollableVertical());
6619 6627
6620 // Verify the main frame still behaves correctly after a resize. 6628 // Verify the main frame still behaves correctly after a resize.
6621 webViewHelper.resize(WebSize(viewportHeight, viewportWidth)); 6629 webViewHelper.resize(WebSize(viewportHeight, viewportWidth));
6622 ASSERT_TRUE(webScrollLayer->scrollable()); 6630 ASSERT_TRUE(webScrollLayer->scrollable());
6623 ASSERT_TRUE(webScrollLayer->userScrollableHorizontal()); 6631 ASSERT_TRUE(webScrollLayer->userScrollableHorizontal());
6624 ASSERT_TRUE(webScrollLayer->userScrollableVertical()); 6632 ASSERT_TRUE(webScrollLayer->userScrollableVertical());
6625 } 6633 }
6626 6634
6627 TEST_P(ParameterizedWebFrameTest, FullscreenSubframe) 6635 TEST_P(ParameterizedWebFrameTest, MAYBE(FullscreenSubframe))
6628 { 6636 {
6629 FakeCompositingWebViewClient client; 6637 FakeCompositingWebViewClient client;
6630 registerMockedHttpURLLoad("fullscreen_iframe.html"); 6638 registerMockedHttpURLLoad("fullscreen_iframe.html");
6631 registerMockedHttpURLLoad("fullscreen_div.html"); 6639 registerMockedHttpURLLoad("fullscreen_div.html");
6632 FrameTestHelpers::WebViewHelper webViewHelper(this); 6640 FrameTestHelpers::WebViewHelper webViewHelper(this);
6633 WebViewImpl* webViewImpl = webViewHelper.initializeAndLoad(m_baseURL + "full screen_iframe.html", true, 0, &client, configureAndroid); 6641 WebViewImpl* webViewImpl = webViewHelper.initializeAndLoad(m_baseURL + "full screen_iframe.html", true, 0, &client, configureAndroid);
6634 int viewportWidth = 640; 6642 int viewportWidth = 640;
6635 int viewportHeight = 480; 6643 int viewportHeight = 480;
6636 client.m_screenInfo.rect.width = viewportWidth; 6644 client.m_screenInfo.rect.width = viewportWidth;
6637 client.m_screenInfo.rect.height = viewportHeight; 6645 client.m_screenInfo.rect.height = viewportHeight;
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
6738 6746
6739 webViewImpl->didExitFullScreen(); 6747 webViewImpl->didExitFullScreen();
6740 webViewImpl->updateAllLifecyclePhases(); 6748 webViewImpl->updateAllLifecyclePhases();
6741 EXPECT_EQ(320, layoutView->logicalWidth().floor()); 6749 EXPECT_EQ(320, layoutView->logicalWidth().floor());
6742 EXPECT_EQ(192, layoutView->logicalHeight().floor()); 6750 EXPECT_EQ(192, layoutView->logicalHeight().floor());
6743 EXPECT_FLOAT_EQ(2, webViewImpl->pageScaleFactor()); 6751 EXPECT_FLOAT_EQ(2, webViewImpl->pageScaleFactor());
6744 EXPECT_FLOAT_EQ(2, webViewImpl->minimumPageScaleFactor()); 6752 EXPECT_FLOAT_EQ(2, webViewImpl->minimumPageScaleFactor());
6745 EXPECT_FLOAT_EQ(5.0, webViewImpl->maximumPageScaleFactor()); 6753 EXPECT_FLOAT_EQ(5.0, webViewImpl->maximumPageScaleFactor());
6746 } 6754 }
6747 6755
6748 TEST_P(ParameterizedWebFrameTest, LayoutBlockPercentHeightDescendants) 6756 TEST_P(ParameterizedWebFrameTest, MAYBE(LayoutBlockPercentHeightDescendants))
6749 { 6757 {
6750 registerMockedHttpURLLoad("percent-height-descendants.html"); 6758 registerMockedHttpURLLoad("percent-height-descendants.html");
6751 FrameTestHelpers::WebViewHelper webViewHelper(this); 6759 FrameTestHelpers::WebViewHelper webViewHelper(this);
6752 webViewHelper.initializeAndLoad(m_baseURL + "percent-height-descendants.html "); 6760 webViewHelper.initializeAndLoad(m_baseURL + "percent-height-descendants.html ");
6753 6761
6754 WebView* webView = webViewHelper.webView(); 6762 WebView* webView = webViewHelper.webView();
6755 webViewHelper.resize(WebSize(800, 800)); 6763 webViewHelper.resize(WebSize(800, 800));
6756 webView->updateAllLifecyclePhases(); 6764 webView->updateAllLifecyclePhases();
6757 6765
6758 Document* document = toWebLocalFrameImpl(webView->mainFrame())->frame()->doc ument(); 6766 Document* document = toWebLocalFrameImpl(webView->mainFrame())->frame()->doc ument();
(...skipping 1754 matching lines...) Expand 10 before | Expand all | Expand 10 after
8513 } 8521 }
8514 8522
8515 TEST_F(WebFrameVisibilityChangeTest, RemoteFrameParentVisibilityChange) 8523 TEST_F(WebFrameVisibilityChangeTest, RemoteFrameParentVisibilityChange)
8516 { 8524 {
8517 swapLocalFrameToRemoteFrame(); 8525 swapLocalFrameToRemoteFrame();
8518 executeScriptOnMainFrame(WebScriptSource("document.querySelector('iframe').p arentElement.style.display = 'none';")); 8526 executeScriptOnMainFrame(WebScriptSource("document.querySelector('iframe').p arentElement.style.display = 'none';"));
8519 EXPECT_FALSE(remoteFrameClient()->isVisible()); 8527 EXPECT_FALSE(remoteFrameClient()->isVisible());
8520 } 8528 }
8521 8529
8522 } // namespace blink 8530 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/html/HTMLTextFormControlElementTest.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698