| 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 7680 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7691 WebViewImpl* webViewImpl = webViewHelper.initializeAndLoad( | 7691 WebViewImpl* webViewImpl = webViewHelper.initializeAndLoad( |
| 7692 m_baseURL + "fullscreen_div.html", true, nullptr, &client, nullptr, | 7692 m_baseURL + "fullscreen_div.html", true, nullptr, &client, nullptr, |
| 7693 configureAndroid); | 7693 configureAndroid); |
| 7694 webViewHelper.resize(WebSize(viewportWidth, viewportHeight)); | 7694 webViewHelper.resize(WebSize(viewportWidth, viewportHeight)); |
| 7695 webViewImpl->updateAllLifecyclePhases(); | 7695 webViewImpl->updateAllLifecyclePhases(); |
| 7696 | 7696 |
| 7697 Document* document = webViewImpl->mainFrameImpl()->frame()->document(); | 7697 Document* document = webViewImpl->mainFrameImpl()->frame()->document(); |
| 7698 UserGestureIndicator gesture(DocumentUserGestureToken::create(document)); | 7698 UserGestureIndicator gesture(DocumentUserGestureToken::create(document)); |
| 7699 Element* divFullscreen = document->getElementById("div1"); | 7699 Element* divFullscreen = document->getElementById("div1"); |
| 7700 Fullscreen::requestFullscreen(*divFullscreen); | 7700 Fullscreen::requestFullscreen(*divFullscreen); |
| 7701 EXPECT_EQ(nullptr, Fullscreen::currentFullScreenElementFrom(*document)); | |
| 7702 EXPECT_EQ(divFullscreen, Fullscreen::fullscreenElementFrom(*document)); | |
| 7703 webViewImpl->didEnterFullscreen(); | 7701 webViewImpl->didEnterFullscreen(); |
| 7704 EXPECT_EQ(divFullscreen, Fullscreen::currentFullScreenElementFrom(*document)); | 7702 EXPECT_EQ(nullptr, Fullscreen::fullscreenElementFrom(*document)); |
| 7703 webViewImpl->beginFrame(WTF::monotonicallyIncreasingTime()); |
| 7705 EXPECT_EQ(divFullscreen, Fullscreen::fullscreenElementFrom(*document)); | 7704 EXPECT_EQ(divFullscreen, Fullscreen::fullscreenElementFrom(*document)); |
| 7706 webViewImpl->updateAllLifecyclePhases(); | 7705 webViewImpl->updateAllLifecyclePhases(); |
| 7707 EXPECT_EQ(divFullscreen, Fullscreen::currentFullScreenElementFrom(*document)); | |
| 7708 EXPECT_EQ(divFullscreen, Fullscreen::fullscreenElementFrom(*document)); | |
| 7709 | 7706 |
| 7710 // Verify that the element is sized to the viewport. | 7707 // Verify that the element is sized to the viewport. |
| 7711 LayoutFullScreen* fullscreenLayoutObject = | 7708 LayoutFullScreen* fullscreenLayoutObject = |
| 7712 Fullscreen::from(*document).fullScreenLayoutObject(); | 7709 Fullscreen::from(*document).fullScreenLayoutObject(); |
| 7713 EXPECT_EQ(viewportWidth, fullscreenLayoutObject->logicalWidth().toInt()); | 7710 EXPECT_EQ(viewportWidth, fullscreenLayoutObject->logicalWidth().toInt()); |
| 7714 EXPECT_EQ(viewportHeight, fullscreenLayoutObject->logicalHeight().toInt()); | 7711 EXPECT_EQ(viewportHeight, fullscreenLayoutObject->logicalHeight().toInt()); |
| 7715 | 7712 |
| 7716 // Verify it's updated after a device rotation. | 7713 // Verify it's updated after a device rotation. |
| 7717 client.m_screenInfo.rect.width = viewportHeight; | 7714 client.m_screenInfo.rect.width = viewportHeight; |
| 7718 client.m_screenInfo.rect.height = viewportWidth; | 7715 client.m_screenInfo.rect.height = viewportWidth; |
| (...skipping 12 matching lines...) Expand all Loading... |
| 7731 WebViewImpl* webViewImpl = webViewHelper.initializeAndLoad( | 7728 WebViewImpl* webViewImpl = webViewHelper.initializeAndLoad( |
| 7732 m_baseURL + "fullscreen_div.html", true, nullptr, &client, nullptr, | 7729 m_baseURL + "fullscreen_div.html", true, nullptr, &client, nullptr, |
| 7733 configureAndroid); | 7730 configureAndroid); |
| 7734 webViewHelper.resize(WebSize(viewportWidth, viewportHeight)); | 7731 webViewHelper.resize(WebSize(viewportWidth, viewportHeight)); |
| 7735 webViewImpl->updateAllLifecyclePhases(); | 7732 webViewImpl->updateAllLifecyclePhases(); |
| 7736 | 7733 |
| 7737 Document* document = webViewImpl->mainFrameImpl()->frame()->document(); | 7734 Document* document = webViewImpl->mainFrameImpl()->frame()->document(); |
| 7738 UserGestureIndicator gesture(DocumentUserGestureToken::create(document)); | 7735 UserGestureIndicator gesture(DocumentUserGestureToken::create(document)); |
| 7739 Element* divFullscreen = document->getElementById("div1"); | 7736 Element* divFullscreen = document->getElementById("div1"); |
| 7740 Fullscreen::requestFullscreen(*divFullscreen); | 7737 Fullscreen::requestFullscreen(*divFullscreen); |
| 7741 EXPECT_EQ(nullptr, Fullscreen::currentFullScreenElementFrom(*document)); | |
| 7742 EXPECT_EQ(divFullscreen, Fullscreen::fullscreenElementFrom(*document)); | |
| 7743 webViewImpl->didEnterFullscreen(); | 7738 webViewImpl->didEnterFullscreen(); |
| 7744 EXPECT_EQ(divFullscreen, Fullscreen::currentFullScreenElementFrom(*document)); | 7739 EXPECT_EQ(nullptr, Fullscreen::fullscreenElementFrom(*document)); |
| 7740 webViewImpl->beginFrame(WTF::monotonicallyIncreasingTime()); |
| 7745 EXPECT_EQ(divFullscreen, Fullscreen::fullscreenElementFrom(*document)); | 7741 EXPECT_EQ(divFullscreen, Fullscreen::fullscreenElementFrom(*document)); |
| 7746 webViewImpl->updateAllLifecyclePhases(); | 7742 webViewImpl->updateAllLifecyclePhases(); |
| 7747 EXPECT_EQ(divFullscreen, Fullscreen::currentFullScreenElementFrom(*document)); | |
| 7748 EXPECT_EQ(divFullscreen, Fullscreen::fullscreenElementFrom(*document)); | |
| 7749 | 7743 |
| 7750 // Verify that the viewports are nonscrollable. | 7744 // Verify that the viewports are nonscrollable. |
| 7751 FrameView* frameView = webViewHelper.webView()->mainFrameImpl()->frameView(); | 7745 FrameView* frameView = webViewHelper.webView()->mainFrameImpl()->frameView(); |
| 7752 WebLayer* layoutViewportScrollLayer = | 7746 WebLayer* layoutViewportScrollLayer = |
| 7753 webViewImpl->compositor()->scrollLayer()->platformLayer(); | 7747 webViewImpl->compositor()->scrollLayer()->platformLayer(); |
| 7754 WebLayer* visualViewportScrollLayer = frameView->page() | 7748 WebLayer* visualViewportScrollLayer = frameView->page() |
| 7755 ->frameHost() | 7749 ->frameHost() |
| 7756 .visualViewport() | 7750 .visualViewport() |
| 7757 .scrollLayer() | 7751 .scrollLayer() |
| 7758 ->platformLayer(); | 7752 ->platformLayer(); |
| 7759 ASSERT_FALSE(layoutViewportScrollLayer->userScrollableHorizontal()); | 7753 ASSERT_FALSE(layoutViewportScrollLayer->userScrollableHorizontal()); |
| 7760 ASSERT_FALSE(layoutViewportScrollLayer->userScrollableVertical()); | 7754 ASSERT_FALSE(layoutViewportScrollLayer->userScrollableVertical()); |
| 7761 ASSERT_FALSE(visualViewportScrollLayer->userScrollableHorizontal()); | 7755 ASSERT_FALSE(visualViewportScrollLayer->userScrollableHorizontal()); |
| 7762 ASSERT_FALSE(visualViewportScrollLayer->userScrollableVertical()); | 7756 ASSERT_FALSE(visualViewportScrollLayer->userScrollableVertical()); |
| 7763 | 7757 |
| 7764 // Verify that the viewports are scrollable upon exiting fullscreen. | 7758 // Verify that the viewports are scrollable upon exiting fullscreen. |
| 7765 EXPECT_EQ(divFullscreen, Fullscreen::currentFullScreenElementFrom(*document)); | 7759 webViewImpl->didExitFullscreen(); |
| 7766 EXPECT_EQ(divFullscreen, Fullscreen::fullscreenElementFrom(*document)); | 7760 EXPECT_EQ(divFullscreen, Fullscreen::fullscreenElementFrom(*document)); |
| 7767 webViewImpl->didExitFullscreen(); | 7761 webViewImpl->beginFrame(WTF::monotonicallyIncreasingTime()); |
| 7768 EXPECT_EQ(nullptr, Fullscreen::currentFullScreenElementFrom(*document)); | |
| 7769 EXPECT_EQ(nullptr, Fullscreen::fullscreenElementFrom(*document)); | 7762 EXPECT_EQ(nullptr, Fullscreen::fullscreenElementFrom(*document)); |
| 7770 webViewImpl->updateAllLifecyclePhases(); | 7763 webViewImpl->updateAllLifecyclePhases(); |
| 7771 EXPECT_EQ(nullptr, Fullscreen::currentFullScreenElementFrom(*document)); | |
| 7772 EXPECT_EQ(nullptr, Fullscreen::fullscreenElementFrom(*document)); | |
| 7773 ASSERT_TRUE(layoutViewportScrollLayer->userScrollableHorizontal()); | 7764 ASSERT_TRUE(layoutViewportScrollLayer->userScrollableHorizontal()); |
| 7774 ASSERT_TRUE(layoutViewportScrollLayer->userScrollableVertical()); | 7765 ASSERT_TRUE(layoutViewportScrollLayer->userScrollableVertical()); |
| 7775 ASSERT_TRUE(visualViewportScrollLayer->userScrollableHorizontal()); | 7766 ASSERT_TRUE(visualViewportScrollLayer->userScrollableHorizontal()); |
| 7776 ASSERT_TRUE(visualViewportScrollLayer->userScrollableVertical()); | 7767 ASSERT_TRUE(visualViewportScrollLayer->userScrollableVertical()); |
| 7777 } | 7768 } |
| 7778 | 7769 |
| 7779 TEST_P(ParameterizedWebFrameTest, FullscreenMainFrame) { | 7770 TEST_P(ParameterizedWebFrameTest, FullscreenMainFrame) { |
| 7780 FakeCompositingWebViewClient client; | 7771 FakeCompositingWebViewClient client; |
| 7781 registerMockedHttpURLLoad("fullscreen_div.html"); | 7772 registerMockedHttpURLLoad("fullscreen_div.html"); |
| 7782 FrameTestHelpers::WebViewHelper webViewHelper; | 7773 FrameTestHelpers::WebViewHelper webViewHelper; |
| 7783 int viewportWidth = 640; | 7774 int viewportWidth = 640; |
| 7784 int viewportHeight = 480; | 7775 int viewportHeight = 480; |
| 7785 WebViewImpl* webViewImpl = webViewHelper.initializeAndLoad( | 7776 WebViewImpl* webViewImpl = webViewHelper.initializeAndLoad( |
| 7786 m_baseURL + "fullscreen_div.html", true, nullptr, &client, nullptr, | 7777 m_baseURL + "fullscreen_div.html", true, nullptr, &client, nullptr, |
| 7787 configureAndroid); | 7778 configureAndroid); |
| 7788 webViewHelper.resize(WebSize(viewportWidth, viewportHeight)); | 7779 webViewHelper.resize(WebSize(viewportWidth, viewportHeight)); |
| 7789 webViewImpl->updateAllLifecyclePhases(); | 7780 webViewImpl->updateAllLifecyclePhases(); |
| 7790 | 7781 |
| 7791 Document* document = webViewImpl->mainFrameImpl()->frame()->document(); | 7782 Document* document = webViewImpl->mainFrameImpl()->frame()->document(); |
| 7792 UserGestureIndicator gesture(DocumentUserGestureToken::create(document)); | 7783 UserGestureIndicator gesture(DocumentUserGestureToken::create(document)); |
| 7793 Fullscreen::requestFullscreen(*document->documentElement()); | 7784 Fullscreen::requestFullscreen(*document->documentElement()); |
| 7794 EXPECT_EQ(nullptr, Fullscreen::currentFullScreenElementFrom(*document)); | 7785 webViewImpl->didEnterFullscreen(); |
| 7786 EXPECT_EQ(nullptr, Fullscreen::fullscreenElementFrom(*document)); |
| 7787 webViewImpl->beginFrame(WTF::monotonicallyIncreasingTime()); |
| 7795 EXPECT_EQ(document->documentElement(), | 7788 EXPECT_EQ(document->documentElement(), |
| 7796 Fullscreen::fullscreenElementFrom(*document)); | 7789 Fullscreen::fullscreenElementFrom(*document)); |
| 7797 webViewImpl->didEnterFullscreen(); | |
| 7798 EXPECT_EQ(document->documentElement(), | |
| 7799 Fullscreen::currentFullScreenElementFrom(*document)); | |
| 7800 EXPECT_EQ(document->documentElement(), | |
| 7801 Fullscreen::fullscreenElementFrom(*document)); | |
| 7802 | |
| 7803 webViewImpl->updateAllLifecyclePhases(); | 7790 webViewImpl->updateAllLifecyclePhases(); |
| 7804 EXPECT_EQ(document->documentElement(), | |
| 7805 Fullscreen::currentFullScreenElementFrom(*document)); | |
| 7806 EXPECT_EQ(document->documentElement(), | |
| 7807 Fullscreen::fullscreenElementFrom(*document)); | |
| 7808 | 7791 |
| 7809 // Verify that the main frame is still scrollable. | 7792 // Verify that the main frame is still scrollable. |
| 7810 WebLayer* webScrollLayer = | 7793 WebLayer* webScrollLayer = |
| 7811 webViewImpl->compositor()->scrollLayer()->platformLayer(); | 7794 webViewImpl->compositor()->scrollLayer()->platformLayer(); |
| 7812 ASSERT_TRUE(webScrollLayer->scrollable()); | 7795 ASSERT_TRUE(webScrollLayer->scrollable()); |
| 7813 ASSERT_TRUE(webScrollLayer->userScrollableHorizontal()); | 7796 ASSERT_TRUE(webScrollLayer->userScrollableHorizontal()); |
| 7814 ASSERT_TRUE(webScrollLayer->userScrollableVertical()); | 7797 ASSERT_TRUE(webScrollLayer->userScrollableVertical()); |
| 7815 | 7798 |
| 7816 // Verify the main frame still behaves correctly after a resize. | 7799 // Verify the main frame still behaves correctly after a resize. |
| 7817 webViewHelper.resize(WebSize(viewportHeight, viewportWidth)); | 7800 webViewHelper.resize(WebSize(viewportHeight, viewportWidth)); |
| (...skipping 18 matching lines...) Expand all Loading... |
| 7836 webViewImpl->updateAllLifecyclePhases(); | 7819 webViewImpl->updateAllLifecyclePhases(); |
| 7837 | 7820 |
| 7838 Document* document = | 7821 Document* document = |
| 7839 toWebLocalFrameImpl(webViewHelper.webView()->mainFrame()->firstChild()) | 7822 toWebLocalFrameImpl(webViewHelper.webView()->mainFrame()->firstChild()) |
| 7840 ->frame() | 7823 ->frame() |
| 7841 ->document(); | 7824 ->document(); |
| 7842 UserGestureIndicator gesture(DocumentUserGestureToken::create(document)); | 7825 UserGestureIndicator gesture(DocumentUserGestureToken::create(document)); |
| 7843 Element* divFullscreen = document->getElementById("div1"); | 7826 Element* divFullscreen = document->getElementById("div1"); |
| 7844 Fullscreen::requestFullscreen(*divFullscreen); | 7827 Fullscreen::requestFullscreen(*divFullscreen); |
| 7845 webViewImpl->didEnterFullscreen(); | 7828 webViewImpl->didEnterFullscreen(); |
| 7829 webViewImpl->beginFrame(WTF::monotonicallyIncreasingTime()); |
| 7846 webViewImpl->updateAllLifecyclePhases(); | 7830 webViewImpl->updateAllLifecyclePhases(); |
| 7847 | 7831 |
| 7848 // Verify that the element is sized to the viewport. | 7832 // Verify that the element is sized to the viewport. |
| 7849 LayoutFullScreen* fullscreenLayoutObject = | 7833 LayoutFullScreen* fullscreenLayoutObject = |
| 7850 Fullscreen::from(*document).fullScreenLayoutObject(); | 7834 Fullscreen::from(*document).fullScreenLayoutObject(); |
| 7851 EXPECT_EQ(viewportWidth, fullscreenLayoutObject->logicalWidth().toInt()); | 7835 EXPECT_EQ(viewportWidth, fullscreenLayoutObject->logicalWidth().toInt()); |
| 7852 EXPECT_EQ(viewportHeight, fullscreenLayoutObject->logicalHeight().toInt()); | 7836 EXPECT_EQ(viewportHeight, fullscreenLayoutObject->logicalHeight().toInt()); |
| 7853 | 7837 |
| 7854 // Verify it's updated after a device rotation. | 7838 // Verify it's updated after a device rotation. |
| 7855 client.m_screenInfo.rect.width = viewportHeight; | 7839 client.m_screenInfo.rect.width = viewportHeight; |
| (...skipping 21 matching lines...) Expand all Loading... |
| 7877 HTMLIFrameElement* iframe = | 7861 HTMLIFrameElement* iframe = |
| 7878 toHTMLIFrameElement(topDoc->querySelector("iframe")); | 7862 toHTMLIFrameElement(topDoc->querySelector("iframe")); |
| 7879 Document* iframeDoc = iframe->contentDocument(); | 7863 Document* iframeDoc = iframe->contentDocument(); |
| 7880 Element* iframeBody = iframeDoc->body(); | 7864 Element* iframeBody = iframeDoc->body(); |
| 7881 | 7865 |
| 7882 { | 7866 { |
| 7883 UserGestureIndicator gesture(DocumentUserGestureToken::create(topDoc)); | 7867 UserGestureIndicator gesture(DocumentUserGestureToken::create(topDoc)); |
| 7884 Fullscreen::requestFullscreen(*topBody); | 7868 Fullscreen::requestFullscreen(*topBody); |
| 7885 } | 7869 } |
| 7886 webViewImpl->didEnterFullscreen(); | 7870 webViewImpl->didEnterFullscreen(); |
| 7871 EXPECT_EQ(nullptr, Fullscreen::fullscreenElementFrom(*topDoc)); |
| 7872 EXPECT_EQ(nullptr, Fullscreen::fullscreenElementFrom(*iframeDoc)); |
| 7873 webViewImpl->beginFrame(WTF::monotonicallyIncreasingTime()); |
| 7874 EXPECT_EQ(topBody, Fullscreen::fullscreenElementFrom(*topDoc)); |
| 7875 EXPECT_EQ(nullptr, Fullscreen::fullscreenElementFrom(*iframeDoc)); |
| 7887 webViewImpl->updateAllLifecyclePhases(); | 7876 webViewImpl->updateAllLifecyclePhases(); |
| 7888 | 7877 |
| 7889 { | 7878 { |
| 7890 UserGestureIndicator gesture(DocumentUserGestureToken::create(iframeDoc)); | 7879 UserGestureIndicator gesture(DocumentUserGestureToken::create(iframeDoc)); |
| 7891 Fullscreen::requestFullscreen(*iframeBody); | 7880 Fullscreen::requestFullscreen(*iframeBody); |
| 7892 } | 7881 } |
| 7893 webViewImpl->didEnterFullscreen(); | 7882 webViewImpl->didEnterFullscreen(); |
| 7883 EXPECT_EQ(topBody, Fullscreen::fullscreenElementFrom(*topDoc)); |
| 7884 EXPECT_EQ(nullptr, Fullscreen::fullscreenElementFrom(*iframeDoc)); |
| 7885 webViewImpl->beginFrame(WTF::monotonicallyIncreasingTime()); |
| 7886 EXPECT_EQ(iframe, Fullscreen::fullscreenElementFrom(*topDoc)); |
| 7887 EXPECT_EQ(iframeBody, Fullscreen::fullscreenElementFrom(*iframeDoc)); |
| 7894 webViewImpl->updateAllLifecyclePhases(); | 7888 webViewImpl->updateAllLifecyclePhases(); |
| 7895 | 7889 |
| 7896 // We are now in nested fullscreen, with both documents having a non-empty | 7890 // We are now in nested fullscreen, with both documents having a non-empty |
| 7897 // fullscreen element stack. | 7891 // fullscreen element stack. |
| 7898 EXPECT_EQ(topBody, Fullscreen::currentFullScreenElementFrom(*topDoc)); | |
| 7899 EXPECT_EQ(iframe, Fullscreen::fullscreenElementFrom(*topDoc)); | |
| 7900 EXPECT_EQ(iframeBody, Fullscreen::currentFullScreenElementFrom(*iframeDoc)); | |
| 7901 EXPECT_EQ(iframeBody, Fullscreen::fullscreenElementFrom(*iframeDoc)); | |
| 7902 | 7892 |
| 7903 webViewImpl->didExitFullscreen(); | 7893 webViewImpl->didExitFullscreen(); |
| 7894 EXPECT_EQ(iframe, Fullscreen::fullscreenElementFrom(*topDoc)); |
| 7895 EXPECT_EQ(iframeBody, Fullscreen::fullscreenElementFrom(*iframeDoc)); |
| 7896 webViewImpl->beginFrame(WTF::monotonicallyIncreasingTime()); |
| 7897 EXPECT_EQ(nullptr, Fullscreen::fullscreenElementFrom(*topDoc)); |
| 7898 EXPECT_EQ(nullptr, Fullscreen::fullscreenElementFrom(*iframeDoc)); |
| 7904 webViewImpl->updateAllLifecyclePhases(); | 7899 webViewImpl->updateAllLifecyclePhases(); |
| 7905 | 7900 |
| 7906 // We should now have fully exited fullscreen. | 7901 // We have now fully exited fullscreen. |
| 7907 EXPECT_EQ(nullptr, Fullscreen::currentFullScreenElementFrom(*topDoc)); | |
| 7908 EXPECT_EQ(nullptr, Fullscreen::fullscreenElementFrom(*topDoc)); | |
| 7909 EXPECT_EQ(nullptr, Fullscreen::currentFullScreenElementFrom(*iframeDoc)); | |
| 7910 EXPECT_EQ(nullptr, Fullscreen::fullscreenElementFrom(*iframeDoc)); | |
| 7911 } | 7902 } |
| 7912 | 7903 |
| 7913 TEST_P(ParameterizedWebFrameTest, FullscreenWithTinyViewport) { | 7904 TEST_P(ParameterizedWebFrameTest, FullscreenWithTinyViewport) { |
| 7914 FakeCompositingWebViewClient client; | 7905 FakeCompositingWebViewClient client; |
| 7915 registerMockedHttpURLLoad("viewport-tiny.html"); | 7906 registerMockedHttpURLLoad("viewport-tiny.html"); |
| 7916 FrameTestHelpers::WebViewHelper webViewHelper; | 7907 FrameTestHelpers::WebViewHelper webViewHelper; |
| 7917 WebViewImpl* webViewImpl = webViewHelper.initializeAndLoad( | 7908 WebViewImpl* webViewImpl = webViewHelper.initializeAndLoad( |
| 7918 m_baseURL + "viewport-tiny.html", true, nullptr, &client, nullptr, | 7909 m_baseURL + "viewport-tiny.html", true, nullptr, &client, nullptr, |
| 7919 configureAndroid); | 7910 configureAndroid); |
| 7920 int viewportWidth = 384; | 7911 int viewportWidth = 384; |
| 7921 int viewportHeight = 640; | 7912 int viewportHeight = 640; |
| 7922 client.m_screenInfo.rect.width = viewportWidth; | 7913 client.m_screenInfo.rect.width = viewportWidth; |
| 7923 client.m_screenInfo.rect.height = viewportHeight; | 7914 client.m_screenInfo.rect.height = viewportHeight; |
| 7924 webViewHelper.resize(WebSize(viewportWidth, viewportHeight)); | 7915 webViewHelper.resize(WebSize(viewportWidth, viewportHeight)); |
| 7925 webViewImpl->updateAllLifecyclePhases(); | 7916 webViewImpl->updateAllLifecyclePhases(); |
| 7926 | 7917 |
| 7927 LayoutViewItem layoutViewItem = | 7918 LayoutViewItem layoutViewItem = |
| 7928 webViewHelper.webView()->mainFrameImpl()->frameView()->layoutViewItem(); | 7919 webViewHelper.webView()->mainFrameImpl()->frameView()->layoutViewItem(); |
| 7929 EXPECT_EQ(320, layoutViewItem.logicalWidth().floor()); | 7920 EXPECT_EQ(320, layoutViewItem.logicalWidth().floor()); |
| 7930 EXPECT_EQ(533, layoutViewItem.logicalHeight().floor()); | 7921 EXPECT_EQ(533, layoutViewItem.logicalHeight().floor()); |
| 7931 EXPECT_FLOAT_EQ(1.2, webViewImpl->pageScaleFactor()); | 7922 EXPECT_FLOAT_EQ(1.2, webViewImpl->pageScaleFactor()); |
| 7932 EXPECT_FLOAT_EQ(1.2, webViewImpl->minimumPageScaleFactor()); | 7923 EXPECT_FLOAT_EQ(1.2, webViewImpl->minimumPageScaleFactor()); |
| 7933 EXPECT_FLOAT_EQ(5.0, webViewImpl->maximumPageScaleFactor()); | 7924 EXPECT_FLOAT_EQ(5.0, webViewImpl->maximumPageScaleFactor()); |
| 7934 | 7925 |
| 7935 Document* document = webViewImpl->mainFrameImpl()->frame()->document(); | 7926 Document* document = webViewImpl->mainFrameImpl()->frame()->document(); |
| 7936 UserGestureIndicator gesture(DocumentUserGestureToken::create(document)); | 7927 UserGestureIndicator gesture(DocumentUserGestureToken::create(document)); |
| 7937 Fullscreen::requestFullscreen(*document->documentElement()); | 7928 Fullscreen::requestFullscreen(*document->documentElement()); |
| 7938 webViewImpl->didEnterFullscreen(); | 7929 webViewImpl->didEnterFullscreen(); |
| 7930 webViewImpl->beginFrame(WTF::monotonicallyIncreasingTime()); |
| 7939 webViewImpl->updateAllLifecyclePhases(); | 7931 webViewImpl->updateAllLifecyclePhases(); |
| 7940 EXPECT_EQ(384, layoutViewItem.logicalWidth().floor()); | 7932 EXPECT_EQ(384, layoutViewItem.logicalWidth().floor()); |
| 7941 EXPECT_EQ(640, layoutViewItem.logicalHeight().floor()); | 7933 EXPECT_EQ(640, layoutViewItem.logicalHeight().floor()); |
| 7942 EXPECT_FLOAT_EQ(1.0, webViewImpl->pageScaleFactor()); | 7934 EXPECT_FLOAT_EQ(1.0, webViewImpl->pageScaleFactor()); |
| 7943 EXPECT_FLOAT_EQ(1.0, webViewImpl->minimumPageScaleFactor()); | 7935 EXPECT_FLOAT_EQ(1.0, webViewImpl->minimumPageScaleFactor()); |
| 7944 EXPECT_FLOAT_EQ(1.0, webViewImpl->maximumPageScaleFactor()); | 7936 EXPECT_FLOAT_EQ(1.0, webViewImpl->maximumPageScaleFactor()); |
| 7945 | 7937 |
| 7946 webViewImpl->didExitFullscreen(); | 7938 webViewImpl->didExitFullscreen(); |
| 7939 webViewImpl->beginFrame(WTF::monotonicallyIncreasingTime()); |
| 7947 webViewImpl->updateAllLifecyclePhases(); | 7940 webViewImpl->updateAllLifecyclePhases(); |
| 7948 EXPECT_EQ(320, layoutViewItem.logicalWidth().floor()); | 7941 EXPECT_EQ(320, layoutViewItem.logicalWidth().floor()); |
| 7949 EXPECT_EQ(533, layoutViewItem.logicalHeight().floor()); | 7942 EXPECT_EQ(533, layoutViewItem.logicalHeight().floor()); |
| 7950 EXPECT_FLOAT_EQ(1.2, webViewImpl->pageScaleFactor()); | 7943 EXPECT_FLOAT_EQ(1.2, webViewImpl->pageScaleFactor()); |
| 7951 EXPECT_FLOAT_EQ(1.2, webViewImpl->minimumPageScaleFactor()); | 7944 EXPECT_FLOAT_EQ(1.2, webViewImpl->minimumPageScaleFactor()); |
| 7952 EXPECT_FLOAT_EQ(5.0, webViewImpl->maximumPageScaleFactor()); | 7945 EXPECT_FLOAT_EQ(5.0, webViewImpl->maximumPageScaleFactor()); |
| 7953 } | 7946 } |
| 7954 | 7947 |
| 7955 TEST_P(ParameterizedWebFrameTest, FullscreenResizeWithTinyViewport) { | 7948 TEST_P(ParameterizedWebFrameTest, FullscreenResizeWithTinyViewport) { |
| 7956 FakeCompositingWebViewClient client; | 7949 FakeCompositingWebViewClient client; |
| 7957 registerMockedHttpURLLoad("viewport-tiny.html"); | 7950 registerMockedHttpURLLoad("viewport-tiny.html"); |
| 7958 FrameTestHelpers::WebViewHelper webViewHelper; | 7951 FrameTestHelpers::WebViewHelper webViewHelper; |
| 7959 WebViewImpl* webViewImpl = webViewHelper.initializeAndLoad( | 7952 WebViewImpl* webViewImpl = webViewHelper.initializeAndLoad( |
| 7960 m_baseURL + "viewport-tiny.html", true, nullptr, &client, nullptr, | 7953 m_baseURL + "viewport-tiny.html", true, nullptr, &client, nullptr, |
| 7961 configureAndroid); | 7954 configureAndroid); |
| 7962 int viewportWidth = 384; | 7955 int viewportWidth = 384; |
| 7963 int viewportHeight = 640; | 7956 int viewportHeight = 640; |
| 7964 client.m_screenInfo.rect.width = viewportWidth; | 7957 client.m_screenInfo.rect.width = viewportWidth; |
| 7965 client.m_screenInfo.rect.height = viewportHeight; | 7958 client.m_screenInfo.rect.height = viewportHeight; |
| 7966 webViewHelper.resize(WebSize(viewportWidth, viewportHeight)); | 7959 webViewHelper.resize(WebSize(viewportWidth, viewportHeight)); |
| 7967 webViewImpl->updateAllLifecyclePhases(); | 7960 webViewImpl->updateAllLifecyclePhases(); |
| 7968 | 7961 |
| 7969 LayoutViewItem layoutViewItem = | 7962 LayoutViewItem layoutViewItem = |
| 7970 webViewHelper.webView()->mainFrameImpl()->frameView()->layoutViewItem(); | 7963 webViewHelper.webView()->mainFrameImpl()->frameView()->layoutViewItem(); |
| 7971 Document* document = webViewImpl->mainFrameImpl()->frame()->document(); | 7964 Document* document = webViewImpl->mainFrameImpl()->frame()->document(); |
| 7972 UserGestureIndicator gesture(DocumentUserGestureToken::create(document)); | 7965 UserGestureIndicator gesture(DocumentUserGestureToken::create(document)); |
| 7973 Fullscreen::requestFullscreen(*document->documentElement()); | 7966 Fullscreen::requestFullscreen(*document->documentElement()); |
| 7974 webViewImpl->didEnterFullscreen(); | 7967 webViewImpl->didEnterFullscreen(); |
| 7968 webViewImpl->beginFrame(WTF::monotonicallyIncreasingTime()); |
| 7975 webViewImpl->updateAllLifecyclePhases(); | 7969 webViewImpl->updateAllLifecyclePhases(); |
| 7976 EXPECT_EQ(384, layoutViewItem.logicalWidth().floor()); | 7970 EXPECT_EQ(384, layoutViewItem.logicalWidth().floor()); |
| 7977 EXPECT_EQ(640, layoutViewItem.logicalHeight().floor()); | 7971 EXPECT_EQ(640, layoutViewItem.logicalHeight().floor()); |
| 7978 EXPECT_FLOAT_EQ(1.0, webViewImpl->pageScaleFactor()); | 7972 EXPECT_FLOAT_EQ(1.0, webViewImpl->pageScaleFactor()); |
| 7979 EXPECT_FLOAT_EQ(1.0, webViewImpl->minimumPageScaleFactor()); | 7973 EXPECT_FLOAT_EQ(1.0, webViewImpl->minimumPageScaleFactor()); |
| 7980 EXPECT_FLOAT_EQ(1.0, webViewImpl->maximumPageScaleFactor()); | 7974 EXPECT_FLOAT_EQ(1.0, webViewImpl->maximumPageScaleFactor()); |
| 7981 | 7975 |
| 7982 viewportWidth = 640; | 7976 viewportWidth = 640; |
| 7983 viewportHeight = 384; | 7977 viewportHeight = 384; |
| 7984 client.m_screenInfo.rect.width = viewportWidth; | 7978 client.m_screenInfo.rect.width = viewportWidth; |
| 7985 client.m_screenInfo.rect.height = viewportHeight; | 7979 client.m_screenInfo.rect.height = viewportHeight; |
| 7986 webViewHelper.resize(WebSize(viewportWidth, viewportHeight)); | 7980 webViewHelper.resize(WebSize(viewportWidth, viewportHeight)); |
| 7987 webViewImpl->updateAllLifecyclePhases(); | 7981 webViewImpl->updateAllLifecyclePhases(); |
| 7988 EXPECT_EQ(640, layoutViewItem.logicalWidth().floor()); | 7982 EXPECT_EQ(640, layoutViewItem.logicalWidth().floor()); |
| 7989 EXPECT_EQ(384, layoutViewItem.logicalHeight().floor()); | 7983 EXPECT_EQ(384, layoutViewItem.logicalHeight().floor()); |
| 7990 EXPECT_FLOAT_EQ(1.0, webViewImpl->pageScaleFactor()); | 7984 EXPECT_FLOAT_EQ(1.0, webViewImpl->pageScaleFactor()); |
| 7991 EXPECT_FLOAT_EQ(1.0, webViewImpl->minimumPageScaleFactor()); | 7985 EXPECT_FLOAT_EQ(1.0, webViewImpl->minimumPageScaleFactor()); |
| 7992 EXPECT_FLOAT_EQ(1.0, webViewImpl->maximumPageScaleFactor()); | 7986 EXPECT_FLOAT_EQ(1.0, webViewImpl->maximumPageScaleFactor()); |
| 7993 | 7987 |
| 7994 webViewImpl->didExitFullscreen(); | 7988 webViewImpl->didExitFullscreen(); |
| 7989 webViewImpl->beginFrame(WTF::monotonicallyIncreasingTime()); |
| 7995 webViewImpl->updateAllLifecyclePhases(); | 7990 webViewImpl->updateAllLifecyclePhases(); |
| 7996 EXPECT_EQ(320, layoutViewItem.logicalWidth().floor()); | 7991 EXPECT_EQ(320, layoutViewItem.logicalWidth().floor()); |
| 7997 EXPECT_EQ(192, layoutViewItem.logicalHeight().floor()); | 7992 EXPECT_EQ(192, layoutViewItem.logicalHeight().floor()); |
| 7998 EXPECT_FLOAT_EQ(2, webViewImpl->pageScaleFactor()); | 7993 EXPECT_FLOAT_EQ(2, webViewImpl->pageScaleFactor()); |
| 7999 EXPECT_FLOAT_EQ(2, webViewImpl->minimumPageScaleFactor()); | 7994 EXPECT_FLOAT_EQ(2, webViewImpl->minimumPageScaleFactor()); |
| 8000 EXPECT_FLOAT_EQ(5.0, webViewImpl->maximumPageScaleFactor()); | 7995 EXPECT_FLOAT_EQ(5.0, webViewImpl->maximumPageScaleFactor()); |
| 8001 } | 7996 } |
| 8002 | 7997 |
| 8003 TEST_P(ParameterizedWebFrameTest, FullscreenRestoreScaleFactorUponExiting) { | 7998 TEST_P(ParameterizedWebFrameTest, FullscreenRestoreScaleFactorUponExiting) { |
| 8004 // The purpose of this test is to more precisely simulate the sequence of | 7999 // The purpose of this test is to more precisely simulate the sequence of |
| (...skipping 23 matching lines...) Expand all Loading... |
| 8028 EXPECT_FLOAT_EQ(1.0, webViewImpl->minimumPageScaleFactor()); | 8023 EXPECT_FLOAT_EQ(1.0, webViewImpl->minimumPageScaleFactor()); |
| 8029 EXPECT_FLOAT_EQ(5.0, webViewImpl->maximumPageScaleFactor()); | 8024 EXPECT_FLOAT_EQ(5.0, webViewImpl->maximumPageScaleFactor()); |
| 8030 | 8025 |
| 8031 { | 8026 { |
| 8032 Document* document = webViewImpl->mainFrameImpl()->frame()->document(); | 8027 Document* document = webViewImpl->mainFrameImpl()->frame()->document(); |
| 8033 UserGestureIndicator gesture(DocumentUserGestureToken::create(document)); | 8028 UserGestureIndicator gesture(DocumentUserGestureToken::create(document)); |
| 8034 Fullscreen::requestFullscreen(*document->body()); | 8029 Fullscreen::requestFullscreen(*document->body()); |
| 8035 } | 8030 } |
| 8036 | 8031 |
| 8037 webViewImpl->didEnterFullscreen(); | 8032 webViewImpl->didEnterFullscreen(); |
| 8033 webViewImpl->beginFrame(WTF::monotonicallyIncreasingTime()); |
| 8038 webViewImpl->updateAllLifecyclePhases(); | 8034 webViewImpl->updateAllLifecyclePhases(); |
| 8039 client.m_screenInfo.rect.width = screenSizeMinusStatusBars.width; | 8035 client.m_screenInfo.rect.width = screenSizeMinusStatusBars.width; |
| 8040 client.m_screenInfo.rect.height = screenSizeMinusStatusBars.height; | 8036 client.m_screenInfo.rect.height = screenSizeMinusStatusBars.height; |
| 8041 webViewHelper.resize(screenSizeMinusStatusBars); | 8037 webViewHelper.resize(screenSizeMinusStatusBars); |
| 8042 client.m_screenInfo.rect.width = screenSize.width; | 8038 client.m_screenInfo.rect.width = screenSize.width; |
| 8043 client.m_screenInfo.rect.height = screenSize.height; | 8039 client.m_screenInfo.rect.height = screenSize.height; |
| 8044 webViewHelper.resize(screenSize); | 8040 webViewHelper.resize(screenSize); |
| 8045 EXPECT_EQ(screenSize.width, layoutViewItem.logicalWidth().floor()); | 8041 EXPECT_EQ(screenSize.width, layoutViewItem.logicalWidth().floor()); |
| 8046 EXPECT_EQ(screenSize.height, layoutViewItem.logicalHeight().floor()); | 8042 EXPECT_EQ(screenSize.height, layoutViewItem.logicalHeight().floor()); |
| 8047 EXPECT_FLOAT_EQ(1.0, webViewImpl->pageScaleFactor()); | 8043 EXPECT_FLOAT_EQ(1.0, webViewImpl->pageScaleFactor()); |
| 8048 EXPECT_FLOAT_EQ(1.0, webViewImpl->minimumPageScaleFactor()); | 8044 EXPECT_FLOAT_EQ(1.0, webViewImpl->minimumPageScaleFactor()); |
| 8049 EXPECT_FLOAT_EQ(1.0, webViewImpl->maximumPageScaleFactor()); | 8045 EXPECT_FLOAT_EQ(1.0, webViewImpl->maximumPageScaleFactor()); |
| 8050 | 8046 |
| 8051 webViewImpl->didExitFullscreen(); | 8047 webViewImpl->didExitFullscreen(); |
| 8048 webViewImpl->beginFrame(WTF::monotonicallyIncreasingTime()); |
| 8052 webViewImpl->updateAllLifecyclePhases(); | 8049 webViewImpl->updateAllLifecyclePhases(); |
| 8053 client.m_screenInfo.rect.width = screenSizeMinusStatusBars.width; | 8050 client.m_screenInfo.rect.width = screenSizeMinusStatusBars.width; |
| 8054 client.m_screenInfo.rect.height = screenSizeMinusStatusBars.height; | 8051 client.m_screenInfo.rect.height = screenSizeMinusStatusBars.height; |
| 8055 webViewHelper.resize(screenSizeMinusStatusBars); | 8052 webViewHelper.resize(screenSizeMinusStatusBars); |
| 8056 client.m_screenInfo.rect.width = screenSizeMinusStatusBarsMinusUrlBar.width; | 8053 client.m_screenInfo.rect.width = screenSizeMinusStatusBarsMinusUrlBar.width; |
| 8057 client.m_screenInfo.rect.height = screenSizeMinusStatusBarsMinusUrlBar.height; | 8054 client.m_screenInfo.rect.height = screenSizeMinusStatusBarsMinusUrlBar.height; |
| 8058 webViewHelper.resize(screenSizeMinusStatusBarsMinusUrlBar); | 8055 webViewHelper.resize(screenSizeMinusStatusBarsMinusUrlBar); |
| 8059 EXPECT_EQ(screenSizeMinusStatusBarsMinusUrlBar.width, | 8056 EXPECT_EQ(screenSizeMinusStatusBarsMinusUrlBar.width, |
| 8060 layoutViewItem.logicalWidth().floor()); | 8057 layoutViewItem.logicalWidth().floor()); |
| 8061 EXPECT_EQ(screenSizeMinusStatusBarsMinusUrlBar.height, | 8058 EXPECT_EQ(screenSizeMinusStatusBarsMinusUrlBar.height, |
| (...skipping 25 matching lines...) Expand all Loading... |
| 8087 EXPECT_EQ(640, layoutViewItem.logicalHeight().floor()); | 8084 EXPECT_EQ(640, layoutViewItem.logicalHeight().floor()); |
| 8088 EXPECT_FLOAT_EQ(0.3125, webViewImpl->pageScaleFactor()); | 8085 EXPECT_FLOAT_EQ(0.3125, webViewImpl->pageScaleFactor()); |
| 8089 EXPECT_FLOAT_EQ(0.3125, webViewImpl->minimumPageScaleFactor()); | 8086 EXPECT_FLOAT_EQ(0.3125, webViewImpl->minimumPageScaleFactor()); |
| 8090 EXPECT_FLOAT_EQ(5.0, webViewImpl->maximumPageScaleFactor()); | 8087 EXPECT_FLOAT_EQ(5.0, webViewImpl->maximumPageScaleFactor()); |
| 8091 | 8088 |
| 8092 Document* document = webViewImpl->mainFrameImpl()->frame()->document(); | 8089 Document* document = webViewImpl->mainFrameImpl()->frame()->document(); |
| 8093 UserGestureIndicator gesture( | 8090 UserGestureIndicator gesture( |
| 8094 DocumentUserGestureToken::create(document, UserGestureToken::NewGesture)); | 8091 DocumentUserGestureToken::create(document, UserGestureToken::NewGesture)); |
| 8095 Fullscreen::requestFullscreen(*document->documentElement()); | 8092 Fullscreen::requestFullscreen(*document->documentElement()); |
| 8096 webViewImpl->didEnterFullscreen(); | 8093 webViewImpl->didEnterFullscreen(); |
| 8094 webViewImpl->beginFrame(WTF::monotonicallyIncreasingTime()); |
| 8097 webViewImpl->updateAllLifecyclePhases(); | 8095 webViewImpl->updateAllLifecyclePhases(); |
| 8098 | 8096 |
| 8099 // Entering fullscreen causes layout size and page scale limits to be | 8097 // Entering fullscreen causes layout size and page scale limits to be |
| 8100 // overridden. | 8098 // overridden. |
| 8101 EXPECT_EQ(100, layoutViewItem.logicalWidth().floor()); | 8099 EXPECT_EQ(100, layoutViewItem.logicalWidth().floor()); |
| 8102 EXPECT_EQ(200, layoutViewItem.logicalHeight().floor()); | 8100 EXPECT_EQ(200, layoutViewItem.logicalHeight().floor()); |
| 8103 EXPECT_FLOAT_EQ(1.0, webViewImpl->pageScaleFactor()); | 8101 EXPECT_FLOAT_EQ(1.0, webViewImpl->pageScaleFactor()); |
| 8104 EXPECT_FLOAT_EQ(1.0, webViewImpl->minimumPageScaleFactor()); | 8102 EXPECT_FLOAT_EQ(1.0, webViewImpl->minimumPageScaleFactor()); |
| 8105 EXPECT_FLOAT_EQ(1.0, webViewImpl->maximumPageScaleFactor()); | 8103 EXPECT_FLOAT_EQ(1.0, webViewImpl->maximumPageScaleFactor()); |
| 8106 | 8104 |
| 8107 const char source[] = "<meta name=\"viewport\" content=\"width=200\">"; | 8105 const char source[] = "<meta name=\"viewport\" content=\"width=200\">"; |
| 8108 | 8106 |
| 8109 // Load a new page before exiting fullscreen. | 8107 // Load a new page before exiting fullscreen. |
| 8110 KURL testURL = toKURL("about:blank"); | 8108 KURL testURL = toKURL("about:blank"); |
| 8111 WebFrame* frame = webViewHelper.webView()->mainFrame(); | 8109 WebFrame* frame = webViewHelper.webView()->mainFrame(); |
| 8112 FrameTestHelpers::loadHTMLString(frame, source, testURL); | 8110 FrameTestHelpers::loadHTMLString(frame, source, testURL); |
| 8113 webViewImpl->didExitFullscreen(); | 8111 webViewImpl->didExitFullscreen(); |
| 8112 webViewImpl->beginFrame(WTF::monotonicallyIncreasingTime()); |
| 8114 webViewImpl->updateAllLifecyclePhases(); | 8113 webViewImpl->updateAllLifecyclePhases(); |
| 8115 | 8114 |
| 8116 // Make sure the new page's layout size and scale factor limits aren't | 8115 // Make sure the new page's layout size and scale factor limits aren't |
| 8117 // overridden. | 8116 // overridden. |
| 8118 layoutViewItem = webViewImpl->mainFrameImpl()->frameView()->layoutViewItem(); | 8117 layoutViewItem = webViewImpl->mainFrameImpl()->frameView()->layoutViewItem(); |
| 8119 EXPECT_EQ(200, layoutViewItem.logicalWidth().floor()); | 8118 EXPECT_EQ(200, layoutViewItem.logicalWidth().floor()); |
| 8120 EXPECT_EQ(400, layoutViewItem.logicalHeight().floor()); | 8119 EXPECT_EQ(400, layoutViewItem.logicalHeight().floor()); |
| 8121 EXPECT_FLOAT_EQ(0.5, webViewImpl->minimumPageScaleFactor()); | 8120 EXPECT_FLOAT_EQ(0.5, webViewImpl->minimumPageScaleFactor()); |
| 8122 EXPECT_FLOAT_EQ(5.0, webViewImpl->maximumPageScaleFactor()); | 8121 EXPECT_FLOAT_EQ(5.0, webViewImpl->maximumPageScaleFactor()); |
| 8123 } | 8122 } |
| (...skipping 27 matching lines...) Expand all Loading... |
| 8151 m_baseURL + "fullscreen_video.html", true, nullptr, &webViewClient); | 8150 m_baseURL + "fullscreen_video.html", true, nullptr, &webViewClient); |
| 8152 | 8151 |
| 8153 const TestFullscreenWebLayerTreeView& layerTreeView = | 8152 const TestFullscreenWebLayerTreeView& layerTreeView = |
| 8154 webViewClient.testFullscreenLayerTreeView; | 8153 webViewClient.testFullscreenLayerTreeView; |
| 8155 | 8154 |
| 8156 Document* document = webViewImpl->mainFrameImpl()->frame()->document(); | 8155 Document* document = webViewImpl->mainFrameImpl()->frame()->document(); |
| 8157 UserGestureIndicator gesture(DocumentUserGestureToken::create(document)); | 8156 UserGestureIndicator gesture(DocumentUserGestureToken::create(document)); |
| 8158 HTMLVideoElement* video = | 8157 HTMLVideoElement* video = |
| 8159 toHTMLVideoElement(document->getElementById("video")); | 8158 toHTMLVideoElement(document->getElementById("video")); |
| 8160 EXPECT_TRUE(video->usesOverlayFullscreenVideo()); | 8159 EXPECT_TRUE(video->usesOverlayFullscreenVideo()); |
| 8161 EXPECT_FALSE(video->isFullscreen()); | |
| 8162 EXPECT_FALSE(layerTreeView.hasTransparentBackground); | |
| 8163 | 8160 |
| 8164 video->webkitEnterFullscreen(); | 8161 video->webkitEnterFullscreen(); |
| 8165 webViewImpl->didEnterFullscreen(); | 8162 webViewImpl->didEnterFullscreen(); |
| 8166 webViewImpl->updateAllLifecyclePhases(); | 8163 EXPECT_FALSE(video->isFullscreen()); |
| 8164 EXPECT_FALSE(layerTreeView.hasTransparentBackground); |
| 8165 webViewImpl->beginFrame(WTF::monotonicallyIncreasingTime()); |
| 8167 EXPECT_TRUE(video->isFullscreen()); | 8166 EXPECT_TRUE(video->isFullscreen()); |
| 8168 EXPECT_TRUE(layerTreeView.hasTransparentBackground); | 8167 EXPECT_TRUE(layerTreeView.hasTransparentBackground); |
| 8168 webViewImpl->updateAllLifecyclePhases(); |
| 8169 | 8169 |
| 8170 webViewImpl->didExitFullscreen(); | 8170 webViewImpl->didExitFullscreen(); |
| 8171 webViewImpl->updateAllLifecyclePhases(); | 8171 EXPECT_TRUE(video->isFullscreen()); |
| 8172 EXPECT_TRUE(layerTreeView.hasTransparentBackground); |
| 8173 webViewImpl->beginFrame(WTF::monotonicallyIncreasingTime()); |
| 8172 EXPECT_FALSE(video->isFullscreen()); | 8174 EXPECT_FALSE(video->isFullscreen()); |
| 8173 EXPECT_FALSE(layerTreeView.hasTransparentBackground); | 8175 EXPECT_FALSE(layerTreeView.hasTransparentBackground); |
| 8176 webViewImpl->updateAllLifecyclePhases(); |
| 8174 } | 8177 } |
| 8175 | 8178 |
| 8176 TEST_P(ParameterizedWebFrameTest, LayoutBlockPercentHeightDescendants) { | 8179 TEST_P(ParameterizedWebFrameTest, LayoutBlockPercentHeightDescendants) { |
| 8177 registerMockedHttpURLLoad("percent-height-descendants.html"); | 8180 registerMockedHttpURLLoad("percent-height-descendants.html"); |
| 8178 FrameTestHelpers::WebViewHelper webViewHelper; | 8181 FrameTestHelpers::WebViewHelper webViewHelper; |
| 8179 webViewHelper.initializeAndLoad(m_baseURL + | 8182 webViewHelper.initializeAndLoad(m_baseURL + |
| 8180 "percent-height-descendants.html"); | 8183 "percent-height-descendants.html"); |
| 8181 | 8184 |
| 8182 WebViewImpl* webView = webViewHelper.webView(); | 8185 WebViewImpl* webView = webViewHelper.webView(); |
| 8183 webViewHelper.resize(WebSize(800, 800)); | 8186 webViewHelper.resize(WebSize(800, 800)); |
| (...skipping 2911 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 11095 | 11098 |
| 11096 EXPECT_TRUE(mainFrameClient.childClient().didCallFrameDetached()); | 11099 EXPECT_TRUE(mainFrameClient.childClient().didCallFrameDetached()); |
| 11097 EXPECT_TRUE(mainFrameClient.childClient().didCallDidStopLoading()); | 11100 EXPECT_TRUE(mainFrameClient.childClient().didCallDidStopLoading()); |
| 11098 EXPECT_TRUE(mainFrameClient.childClient().didCallDidFinishDocumentLoad()); | 11101 EXPECT_TRUE(mainFrameClient.childClient().didCallDidFinishDocumentLoad()); |
| 11099 EXPECT_TRUE(mainFrameClient.childClient().didCallDidHandleOnloadEvents()); | 11102 EXPECT_TRUE(mainFrameClient.childClient().didCallDidHandleOnloadEvents()); |
| 11100 | 11103 |
| 11101 webViewHelper.reset(); | 11104 webViewHelper.reset(); |
| 11102 } | 11105 } |
| 11103 | 11106 |
| 11104 } // namespace blink | 11107 } // namespace blink |
| OLD | NEW |