| 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 7647 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7658 WebViewImpl* webViewImpl = webViewHelper.initializeAndLoad( | 7658 WebViewImpl* webViewImpl = webViewHelper.initializeAndLoad( |
| 7659 m_baseURL + "fullscreen_div.html", true, nullptr, &client, nullptr, | 7659 m_baseURL + "fullscreen_div.html", true, nullptr, &client, nullptr, |
| 7660 configureAndroid); | 7660 configureAndroid); |
| 7661 webViewHelper.resize(WebSize(viewportWidth, viewportHeight)); | 7661 webViewHelper.resize(WebSize(viewportWidth, viewportHeight)); |
| 7662 webViewImpl->updateAllLifecyclePhases(); | 7662 webViewImpl->updateAllLifecyclePhases(); |
| 7663 | 7663 |
| 7664 Document* document = webViewImpl->mainFrameImpl()->frame()->document(); | 7664 Document* document = webViewImpl->mainFrameImpl()->frame()->document(); |
| 7665 UserGestureIndicator gesture(DocumentUserGestureToken::create(document)); | 7665 UserGestureIndicator gesture(DocumentUserGestureToken::create(document)); |
| 7666 Element* divFullscreen = document->getElementById("div1"); | 7666 Element* divFullscreen = document->getElementById("div1"); |
| 7667 Fullscreen::requestFullscreen(*divFullscreen); | 7667 Fullscreen::requestFullscreen(*divFullscreen); |
| 7668 EXPECT_EQ(nullptr, Fullscreen::currentFullScreenElementFrom(*document)); |
| 7669 EXPECT_EQ(divFullscreen, Fullscreen::fullscreenElementFrom(*document)); |
| 7668 webViewImpl->didEnterFullscreen(); | 7670 webViewImpl->didEnterFullscreen(); |
| 7669 EXPECT_EQ(nullptr, Fullscreen::fullscreenElementFrom(*document)); | 7671 EXPECT_EQ(divFullscreen, Fullscreen::currentFullScreenElementFrom(*document)); |
| 7670 webViewImpl->beginFrame(WTF::monotonicallyIncreasingTime()); | |
| 7671 EXPECT_EQ(divFullscreen, Fullscreen::fullscreenElementFrom(*document)); | 7672 EXPECT_EQ(divFullscreen, Fullscreen::fullscreenElementFrom(*document)); |
| 7672 webViewImpl->updateAllLifecyclePhases(); | 7673 webViewImpl->updateAllLifecyclePhases(); |
| 7674 EXPECT_EQ(divFullscreen, Fullscreen::currentFullScreenElementFrom(*document)); |
| 7675 EXPECT_EQ(divFullscreen, Fullscreen::fullscreenElementFrom(*document)); |
| 7673 | 7676 |
| 7674 // Verify that the element is sized to the viewport. | 7677 // Verify that the element is sized to the viewport. |
| 7675 LayoutFullScreen* fullscreenLayoutObject = | 7678 LayoutFullScreen* fullscreenLayoutObject = |
| 7676 Fullscreen::from(*document).fullScreenLayoutObject(); | 7679 Fullscreen::from(*document).fullScreenLayoutObject(); |
| 7677 EXPECT_EQ(viewportWidth, fullscreenLayoutObject->logicalWidth().toInt()); | 7680 EXPECT_EQ(viewportWidth, fullscreenLayoutObject->logicalWidth().toInt()); |
| 7678 EXPECT_EQ(viewportHeight, fullscreenLayoutObject->logicalHeight().toInt()); | 7681 EXPECT_EQ(viewportHeight, fullscreenLayoutObject->logicalHeight().toInt()); |
| 7679 | 7682 |
| 7680 // Verify it's updated after a device rotation. | 7683 // Verify it's updated after a device rotation. |
| 7681 client.m_screenInfo.rect.width = viewportHeight; | 7684 client.m_screenInfo.rect.width = viewportHeight; |
| 7682 client.m_screenInfo.rect.height = viewportWidth; | 7685 client.m_screenInfo.rect.height = viewportWidth; |
| (...skipping 12 matching lines...) Expand all Loading... |
| 7695 WebViewImpl* webViewImpl = webViewHelper.initializeAndLoad( | 7698 WebViewImpl* webViewImpl = webViewHelper.initializeAndLoad( |
| 7696 m_baseURL + "fullscreen_div.html", true, nullptr, &client, nullptr, | 7699 m_baseURL + "fullscreen_div.html", true, nullptr, &client, nullptr, |
| 7697 configureAndroid); | 7700 configureAndroid); |
| 7698 webViewHelper.resize(WebSize(viewportWidth, viewportHeight)); | 7701 webViewHelper.resize(WebSize(viewportWidth, viewportHeight)); |
| 7699 webViewImpl->updateAllLifecyclePhases(); | 7702 webViewImpl->updateAllLifecyclePhases(); |
| 7700 | 7703 |
| 7701 Document* document = webViewImpl->mainFrameImpl()->frame()->document(); | 7704 Document* document = webViewImpl->mainFrameImpl()->frame()->document(); |
| 7702 UserGestureIndicator gesture(DocumentUserGestureToken::create(document)); | 7705 UserGestureIndicator gesture(DocumentUserGestureToken::create(document)); |
| 7703 Element* divFullscreen = document->getElementById("div1"); | 7706 Element* divFullscreen = document->getElementById("div1"); |
| 7704 Fullscreen::requestFullscreen(*divFullscreen); | 7707 Fullscreen::requestFullscreen(*divFullscreen); |
| 7708 EXPECT_EQ(nullptr, Fullscreen::currentFullScreenElementFrom(*document)); |
| 7709 EXPECT_EQ(divFullscreen, Fullscreen::fullscreenElementFrom(*document)); |
| 7705 webViewImpl->didEnterFullscreen(); | 7710 webViewImpl->didEnterFullscreen(); |
| 7706 EXPECT_EQ(nullptr, Fullscreen::fullscreenElementFrom(*document)); | 7711 EXPECT_EQ(divFullscreen, Fullscreen::currentFullScreenElementFrom(*document)); |
| 7707 webViewImpl->beginFrame(WTF::monotonicallyIncreasingTime()); | |
| 7708 EXPECT_EQ(divFullscreen, Fullscreen::fullscreenElementFrom(*document)); | 7712 EXPECT_EQ(divFullscreen, Fullscreen::fullscreenElementFrom(*document)); |
| 7709 webViewImpl->updateAllLifecyclePhases(); | 7713 webViewImpl->updateAllLifecyclePhases(); |
| 7714 EXPECT_EQ(divFullscreen, Fullscreen::currentFullScreenElementFrom(*document)); |
| 7715 EXPECT_EQ(divFullscreen, Fullscreen::fullscreenElementFrom(*document)); |
| 7710 | 7716 |
| 7711 // Verify that the viewports are nonscrollable. | 7717 // Verify that the viewports are nonscrollable. |
| 7712 FrameView* frameView = webViewHelper.webView()->mainFrameImpl()->frameView(); | 7718 FrameView* frameView = webViewHelper.webView()->mainFrameImpl()->frameView(); |
| 7713 WebLayer* layoutViewportScrollLayer = | 7719 WebLayer* layoutViewportScrollLayer = |
| 7714 webViewImpl->compositor()->scrollLayer()->platformLayer(); | 7720 webViewImpl->compositor()->scrollLayer()->platformLayer(); |
| 7715 WebLayer* visualViewportScrollLayer = frameView->page() | 7721 WebLayer* visualViewportScrollLayer = frameView->page() |
| 7716 ->frameHost() | 7722 ->frameHost() |
| 7717 .visualViewport() | 7723 .visualViewport() |
| 7718 .scrollLayer() | 7724 .scrollLayer() |
| 7719 ->platformLayer(); | 7725 ->platformLayer(); |
| 7720 ASSERT_FALSE(layoutViewportScrollLayer->userScrollableHorizontal()); | 7726 ASSERT_FALSE(layoutViewportScrollLayer->userScrollableHorizontal()); |
| 7721 ASSERT_FALSE(layoutViewportScrollLayer->userScrollableVertical()); | 7727 ASSERT_FALSE(layoutViewportScrollLayer->userScrollableVertical()); |
| 7722 ASSERT_FALSE(visualViewportScrollLayer->userScrollableHorizontal()); | 7728 ASSERT_FALSE(visualViewportScrollLayer->userScrollableHorizontal()); |
| 7723 ASSERT_FALSE(visualViewportScrollLayer->userScrollableVertical()); | 7729 ASSERT_FALSE(visualViewportScrollLayer->userScrollableVertical()); |
| 7724 | 7730 |
| 7725 // Verify that the viewports are scrollable upon exiting fullscreen. | 7731 // Verify that the viewports are scrollable upon exiting fullscreen. |
| 7732 EXPECT_EQ(divFullscreen, Fullscreen::currentFullScreenElementFrom(*document)); |
| 7733 EXPECT_EQ(divFullscreen, Fullscreen::fullscreenElementFrom(*document)); |
| 7726 webViewImpl->didExitFullscreen(); | 7734 webViewImpl->didExitFullscreen(); |
| 7727 EXPECT_EQ(divFullscreen, Fullscreen::fullscreenElementFrom(*document)); | 7735 EXPECT_EQ(nullptr, Fullscreen::currentFullScreenElementFrom(*document)); |
| 7728 webViewImpl->beginFrame(WTF::monotonicallyIncreasingTime()); | |
| 7729 EXPECT_EQ(nullptr, Fullscreen::fullscreenElementFrom(*document)); | 7736 EXPECT_EQ(nullptr, Fullscreen::fullscreenElementFrom(*document)); |
| 7730 webViewImpl->updateAllLifecyclePhases(); | 7737 webViewImpl->updateAllLifecyclePhases(); |
| 7738 EXPECT_EQ(nullptr, Fullscreen::currentFullScreenElementFrom(*document)); |
| 7739 EXPECT_EQ(nullptr, Fullscreen::fullscreenElementFrom(*document)); |
| 7731 ASSERT_TRUE(layoutViewportScrollLayer->userScrollableHorizontal()); | 7740 ASSERT_TRUE(layoutViewportScrollLayer->userScrollableHorizontal()); |
| 7732 ASSERT_TRUE(layoutViewportScrollLayer->userScrollableVertical()); | 7741 ASSERT_TRUE(layoutViewportScrollLayer->userScrollableVertical()); |
| 7733 ASSERT_TRUE(visualViewportScrollLayer->userScrollableHorizontal()); | 7742 ASSERT_TRUE(visualViewportScrollLayer->userScrollableHorizontal()); |
| 7734 ASSERT_TRUE(visualViewportScrollLayer->userScrollableVertical()); | 7743 ASSERT_TRUE(visualViewportScrollLayer->userScrollableVertical()); |
| 7735 } | 7744 } |
| 7736 | 7745 |
| 7737 TEST_P(ParameterizedWebFrameTest, FullscreenMainFrame) { | 7746 TEST_P(ParameterizedWebFrameTest, FullscreenMainFrame) { |
| 7738 FakeCompositingWebViewClient client; | 7747 FakeCompositingWebViewClient client; |
| 7739 registerMockedHttpURLLoad("fullscreen_div.html"); | 7748 registerMockedHttpURLLoad("fullscreen_div.html"); |
| 7740 FrameTestHelpers::WebViewHelper webViewHelper; | 7749 FrameTestHelpers::WebViewHelper webViewHelper; |
| 7741 int viewportWidth = 640; | 7750 int viewportWidth = 640; |
| 7742 int viewportHeight = 480; | 7751 int viewportHeight = 480; |
| 7743 WebViewImpl* webViewImpl = webViewHelper.initializeAndLoad( | 7752 WebViewImpl* webViewImpl = webViewHelper.initializeAndLoad( |
| 7744 m_baseURL + "fullscreen_div.html", true, nullptr, &client, nullptr, | 7753 m_baseURL + "fullscreen_div.html", true, nullptr, &client, nullptr, |
| 7745 configureAndroid); | 7754 configureAndroid); |
| 7746 webViewHelper.resize(WebSize(viewportWidth, viewportHeight)); | 7755 webViewHelper.resize(WebSize(viewportWidth, viewportHeight)); |
| 7747 webViewImpl->updateAllLifecyclePhases(); | 7756 webViewImpl->updateAllLifecyclePhases(); |
| 7748 | 7757 |
| 7749 Document* document = webViewImpl->mainFrameImpl()->frame()->document(); | 7758 Document* document = webViewImpl->mainFrameImpl()->frame()->document(); |
| 7750 UserGestureIndicator gesture(DocumentUserGestureToken::create(document)); | 7759 UserGestureIndicator gesture(DocumentUserGestureToken::create(document)); |
| 7751 Fullscreen::requestFullscreen(*document->documentElement()); | 7760 Fullscreen::requestFullscreen(*document->documentElement()); |
| 7752 webViewImpl->didEnterFullscreen(); | 7761 EXPECT_EQ(nullptr, Fullscreen::currentFullScreenElementFrom(*document)); |
| 7753 EXPECT_EQ(nullptr, Fullscreen::fullscreenElementFrom(*document)); | |
| 7754 webViewImpl->beginFrame(WTF::monotonicallyIncreasingTime()); | |
| 7755 EXPECT_EQ(document->documentElement(), | 7762 EXPECT_EQ(document->documentElement(), |
| 7756 Fullscreen::fullscreenElementFrom(*document)); | 7763 Fullscreen::fullscreenElementFrom(*document)); |
| 7764 webViewImpl->didEnterFullscreen(); |
| 7765 EXPECT_EQ(document->documentElement(), |
| 7766 Fullscreen::currentFullScreenElementFrom(*document)); |
| 7767 EXPECT_EQ(document->documentElement(), |
| 7768 Fullscreen::fullscreenElementFrom(*document)); |
| 7769 |
| 7757 webViewImpl->updateAllLifecyclePhases(); | 7770 webViewImpl->updateAllLifecyclePhases(); |
| 7771 EXPECT_EQ(document->documentElement(), |
| 7772 Fullscreen::currentFullScreenElementFrom(*document)); |
| 7773 EXPECT_EQ(document->documentElement(), |
| 7774 Fullscreen::fullscreenElementFrom(*document)); |
| 7758 | 7775 |
| 7759 // Verify that the main frame is still scrollable. | 7776 // Verify that the main frame is still scrollable. |
| 7760 WebLayer* webScrollLayer = | 7777 WebLayer* webScrollLayer = |
| 7761 webViewImpl->compositor()->scrollLayer()->platformLayer(); | 7778 webViewImpl->compositor()->scrollLayer()->platformLayer(); |
| 7762 ASSERT_TRUE(webScrollLayer->scrollable()); | 7779 ASSERT_TRUE(webScrollLayer->scrollable()); |
| 7763 ASSERT_TRUE(webScrollLayer->userScrollableHorizontal()); | 7780 ASSERT_TRUE(webScrollLayer->userScrollableHorizontal()); |
| 7764 ASSERT_TRUE(webScrollLayer->userScrollableVertical()); | 7781 ASSERT_TRUE(webScrollLayer->userScrollableVertical()); |
| 7765 | 7782 |
| 7766 // Verify the main frame still behaves correctly after a resize. | 7783 // Verify the main frame still behaves correctly after a resize. |
| 7767 webViewHelper.resize(WebSize(viewportHeight, viewportWidth)); | 7784 webViewHelper.resize(WebSize(viewportHeight, viewportWidth)); |
| (...skipping 18 matching lines...) Expand all Loading... |
| 7786 webViewImpl->updateAllLifecyclePhases(); | 7803 webViewImpl->updateAllLifecyclePhases(); |
| 7787 | 7804 |
| 7788 Document* document = | 7805 Document* document = |
| 7789 toWebLocalFrameImpl(webViewHelper.webView()->mainFrame()->firstChild()) | 7806 toWebLocalFrameImpl(webViewHelper.webView()->mainFrame()->firstChild()) |
| 7790 ->frame() | 7807 ->frame() |
| 7791 ->document(); | 7808 ->document(); |
| 7792 UserGestureIndicator gesture(DocumentUserGestureToken::create(document)); | 7809 UserGestureIndicator gesture(DocumentUserGestureToken::create(document)); |
| 7793 Element* divFullscreen = document->getElementById("div1"); | 7810 Element* divFullscreen = document->getElementById("div1"); |
| 7794 Fullscreen::requestFullscreen(*divFullscreen); | 7811 Fullscreen::requestFullscreen(*divFullscreen); |
| 7795 webViewImpl->didEnterFullscreen(); | 7812 webViewImpl->didEnterFullscreen(); |
| 7796 webViewImpl->beginFrame(WTF::monotonicallyIncreasingTime()); | |
| 7797 webViewImpl->updateAllLifecyclePhases(); | 7813 webViewImpl->updateAllLifecyclePhases(); |
| 7798 | 7814 |
| 7799 // Verify that the element is sized to the viewport. | 7815 // Verify that the element is sized to the viewport. |
| 7800 LayoutFullScreen* fullscreenLayoutObject = | 7816 LayoutFullScreen* fullscreenLayoutObject = |
| 7801 Fullscreen::from(*document).fullScreenLayoutObject(); | 7817 Fullscreen::from(*document).fullScreenLayoutObject(); |
| 7802 EXPECT_EQ(viewportWidth, fullscreenLayoutObject->logicalWidth().toInt()); | 7818 EXPECT_EQ(viewportWidth, fullscreenLayoutObject->logicalWidth().toInt()); |
| 7803 EXPECT_EQ(viewportHeight, fullscreenLayoutObject->logicalHeight().toInt()); | 7819 EXPECT_EQ(viewportHeight, fullscreenLayoutObject->logicalHeight().toInt()); |
| 7804 | 7820 |
| 7805 // Verify it's updated after a device rotation. | 7821 // Verify it's updated after a device rotation. |
| 7806 client.m_screenInfo.rect.width = viewportHeight; | 7822 client.m_screenInfo.rect.width = viewportHeight; |
| (...skipping 21 matching lines...) Expand all Loading... |
| 7828 HTMLIFrameElement* iframe = | 7844 HTMLIFrameElement* iframe = |
| 7829 toHTMLIFrameElement(topDoc->querySelector("iframe")); | 7845 toHTMLIFrameElement(topDoc->querySelector("iframe")); |
| 7830 Document* iframeDoc = iframe->contentDocument(); | 7846 Document* iframeDoc = iframe->contentDocument(); |
| 7831 Element* iframeBody = iframeDoc->body(); | 7847 Element* iframeBody = iframeDoc->body(); |
| 7832 | 7848 |
| 7833 { | 7849 { |
| 7834 UserGestureIndicator gesture(DocumentUserGestureToken::create(topDoc)); | 7850 UserGestureIndicator gesture(DocumentUserGestureToken::create(topDoc)); |
| 7835 Fullscreen::requestFullscreen(*topBody); | 7851 Fullscreen::requestFullscreen(*topBody); |
| 7836 } | 7852 } |
| 7837 webViewImpl->didEnterFullscreen(); | 7853 webViewImpl->didEnterFullscreen(); |
| 7838 EXPECT_EQ(nullptr, Fullscreen::fullscreenElementFrom(*topDoc)); | |
| 7839 EXPECT_EQ(nullptr, Fullscreen::fullscreenElementFrom(*iframeDoc)); | |
| 7840 webViewImpl->beginFrame(WTF::monotonicallyIncreasingTime()); | |
| 7841 EXPECT_EQ(topBody, Fullscreen::fullscreenElementFrom(*topDoc)); | |
| 7842 EXPECT_EQ(nullptr, Fullscreen::fullscreenElementFrom(*iframeDoc)); | |
| 7843 webViewImpl->updateAllLifecyclePhases(); | 7854 webViewImpl->updateAllLifecyclePhases(); |
| 7844 | 7855 |
| 7845 { | 7856 { |
| 7846 UserGestureIndicator gesture(DocumentUserGestureToken::create(iframeDoc)); | 7857 UserGestureIndicator gesture(DocumentUserGestureToken::create(iframeDoc)); |
| 7847 Fullscreen::requestFullscreen(*iframeBody); | 7858 Fullscreen::requestFullscreen(*iframeBody); |
| 7848 } | 7859 } |
| 7849 webViewImpl->didEnterFullscreen(); | 7860 webViewImpl->didEnterFullscreen(); |
| 7850 EXPECT_EQ(topBody, Fullscreen::fullscreenElementFrom(*topDoc)); | |
| 7851 EXPECT_EQ(nullptr, Fullscreen::fullscreenElementFrom(*iframeDoc)); | |
| 7852 webViewImpl->beginFrame(WTF::monotonicallyIncreasingTime()); | |
| 7853 EXPECT_EQ(iframe, Fullscreen::fullscreenElementFrom(*topDoc)); | |
| 7854 EXPECT_EQ(iframeBody, Fullscreen::fullscreenElementFrom(*iframeDoc)); | |
| 7855 webViewImpl->updateAllLifecyclePhases(); | 7861 webViewImpl->updateAllLifecyclePhases(); |
| 7856 | 7862 |
| 7857 // We are now in nested fullscreen, with both documents having a non-empty | 7863 // We are now in nested fullscreen, with both documents having a non-empty |
| 7858 // fullscreen element stack. | 7864 // fullscreen element stack. |
| 7865 EXPECT_EQ(topBody, Fullscreen::currentFullScreenElementFrom(*topDoc)); |
| 7866 EXPECT_EQ(iframe, Fullscreen::fullscreenElementFrom(*topDoc)); |
| 7867 EXPECT_EQ(iframeBody, Fullscreen::currentFullScreenElementFrom(*iframeDoc)); |
| 7868 EXPECT_EQ(iframeBody, Fullscreen::fullscreenElementFrom(*iframeDoc)); |
| 7859 | 7869 |
| 7860 webViewImpl->didExitFullscreen(); | 7870 webViewImpl->didExitFullscreen(); |
| 7861 EXPECT_EQ(iframe, Fullscreen::fullscreenElementFrom(*topDoc)); | |
| 7862 EXPECT_EQ(iframeBody, Fullscreen::fullscreenElementFrom(*iframeDoc)); | |
| 7863 webViewImpl->beginFrame(WTF::monotonicallyIncreasingTime()); | |
| 7864 EXPECT_EQ(nullptr, Fullscreen::fullscreenElementFrom(*topDoc)); | |
| 7865 EXPECT_EQ(nullptr, Fullscreen::fullscreenElementFrom(*iframeDoc)); | |
| 7866 webViewImpl->updateAllLifecyclePhases(); | 7871 webViewImpl->updateAllLifecyclePhases(); |
| 7867 | 7872 |
| 7868 // We have now fully exited fullscreen. | 7873 // We should now have fully exited fullscreen. |
| 7874 EXPECT_EQ(nullptr, Fullscreen::currentFullScreenElementFrom(*topDoc)); |
| 7875 EXPECT_EQ(nullptr, Fullscreen::fullscreenElementFrom(*topDoc)); |
| 7876 EXPECT_EQ(nullptr, Fullscreen::currentFullScreenElementFrom(*iframeDoc)); |
| 7877 EXPECT_EQ(nullptr, Fullscreen::fullscreenElementFrom(*iframeDoc)); |
| 7869 } | 7878 } |
| 7870 | 7879 |
| 7871 TEST_P(ParameterizedWebFrameTest, FullscreenWithTinyViewport) { | 7880 TEST_P(ParameterizedWebFrameTest, FullscreenWithTinyViewport) { |
| 7872 FakeCompositingWebViewClient client; | 7881 FakeCompositingWebViewClient client; |
| 7873 registerMockedHttpURLLoad("viewport-tiny.html"); | 7882 registerMockedHttpURLLoad("viewport-tiny.html"); |
| 7874 FrameTestHelpers::WebViewHelper webViewHelper; | 7883 FrameTestHelpers::WebViewHelper webViewHelper; |
| 7875 WebViewImpl* webViewImpl = webViewHelper.initializeAndLoad( | 7884 WebViewImpl* webViewImpl = webViewHelper.initializeAndLoad( |
| 7876 m_baseURL + "viewport-tiny.html", true, nullptr, &client, nullptr, | 7885 m_baseURL + "viewport-tiny.html", true, nullptr, &client, nullptr, |
| 7877 configureAndroid); | 7886 configureAndroid); |
| 7878 int viewportWidth = 384; | 7887 int viewportWidth = 384; |
| 7879 int viewportHeight = 640; | 7888 int viewportHeight = 640; |
| 7880 client.m_screenInfo.rect.width = viewportWidth; | 7889 client.m_screenInfo.rect.width = viewportWidth; |
| 7881 client.m_screenInfo.rect.height = viewportHeight; | 7890 client.m_screenInfo.rect.height = viewportHeight; |
| 7882 webViewHelper.resize(WebSize(viewportWidth, viewportHeight)); | 7891 webViewHelper.resize(WebSize(viewportWidth, viewportHeight)); |
| 7883 webViewImpl->updateAllLifecyclePhases(); | 7892 webViewImpl->updateAllLifecyclePhases(); |
| 7884 | 7893 |
| 7885 LayoutViewItem layoutViewItem = | 7894 LayoutViewItem layoutViewItem = |
| 7886 webViewHelper.webView()->mainFrameImpl()->frameView()->layoutViewItem(); | 7895 webViewHelper.webView()->mainFrameImpl()->frameView()->layoutViewItem(); |
| 7887 EXPECT_EQ(320, layoutViewItem.logicalWidth().floor()); | 7896 EXPECT_EQ(320, layoutViewItem.logicalWidth().floor()); |
| 7888 EXPECT_EQ(533, layoutViewItem.logicalHeight().floor()); | 7897 EXPECT_EQ(533, layoutViewItem.logicalHeight().floor()); |
| 7889 EXPECT_FLOAT_EQ(1.2, webViewImpl->pageScaleFactor()); | 7898 EXPECT_FLOAT_EQ(1.2, webViewImpl->pageScaleFactor()); |
| 7890 EXPECT_FLOAT_EQ(1.2, webViewImpl->minimumPageScaleFactor()); | 7899 EXPECT_FLOAT_EQ(1.2, webViewImpl->minimumPageScaleFactor()); |
| 7891 EXPECT_FLOAT_EQ(5.0, webViewImpl->maximumPageScaleFactor()); | 7900 EXPECT_FLOAT_EQ(5.0, webViewImpl->maximumPageScaleFactor()); |
| 7892 | 7901 |
| 7893 Document* document = webViewImpl->mainFrameImpl()->frame()->document(); | 7902 Document* document = webViewImpl->mainFrameImpl()->frame()->document(); |
| 7894 UserGestureIndicator gesture(DocumentUserGestureToken::create(document)); | 7903 UserGestureIndicator gesture(DocumentUserGestureToken::create(document)); |
| 7895 Fullscreen::requestFullscreen(*document->documentElement()); | 7904 Fullscreen::requestFullscreen(*document->documentElement()); |
| 7896 webViewImpl->didEnterFullscreen(); | 7905 webViewImpl->didEnterFullscreen(); |
| 7897 webViewImpl->beginFrame(WTF::monotonicallyIncreasingTime()); | |
| 7898 webViewImpl->updateAllLifecyclePhases(); | 7906 webViewImpl->updateAllLifecyclePhases(); |
| 7899 EXPECT_EQ(384, layoutViewItem.logicalWidth().floor()); | 7907 EXPECT_EQ(384, layoutViewItem.logicalWidth().floor()); |
| 7900 EXPECT_EQ(640, layoutViewItem.logicalHeight().floor()); | 7908 EXPECT_EQ(640, layoutViewItem.logicalHeight().floor()); |
| 7901 EXPECT_FLOAT_EQ(1.0, webViewImpl->pageScaleFactor()); | 7909 EXPECT_FLOAT_EQ(1.0, webViewImpl->pageScaleFactor()); |
| 7902 EXPECT_FLOAT_EQ(1.0, webViewImpl->minimumPageScaleFactor()); | 7910 EXPECT_FLOAT_EQ(1.0, webViewImpl->minimumPageScaleFactor()); |
| 7903 EXPECT_FLOAT_EQ(1.0, webViewImpl->maximumPageScaleFactor()); | 7911 EXPECT_FLOAT_EQ(1.0, webViewImpl->maximumPageScaleFactor()); |
| 7904 | 7912 |
| 7905 webViewImpl->didExitFullscreen(); | 7913 webViewImpl->didExitFullscreen(); |
| 7906 webViewImpl->beginFrame(WTF::monotonicallyIncreasingTime()); | |
| 7907 webViewImpl->updateAllLifecyclePhases(); | 7914 webViewImpl->updateAllLifecyclePhases(); |
| 7908 EXPECT_EQ(320, layoutViewItem.logicalWidth().floor()); | 7915 EXPECT_EQ(320, layoutViewItem.logicalWidth().floor()); |
| 7909 EXPECT_EQ(533, layoutViewItem.logicalHeight().floor()); | 7916 EXPECT_EQ(533, layoutViewItem.logicalHeight().floor()); |
| 7910 EXPECT_FLOAT_EQ(1.2, webViewImpl->pageScaleFactor()); | 7917 EXPECT_FLOAT_EQ(1.2, webViewImpl->pageScaleFactor()); |
| 7911 EXPECT_FLOAT_EQ(1.2, webViewImpl->minimumPageScaleFactor()); | 7918 EXPECT_FLOAT_EQ(1.2, webViewImpl->minimumPageScaleFactor()); |
| 7912 EXPECT_FLOAT_EQ(5.0, webViewImpl->maximumPageScaleFactor()); | 7919 EXPECT_FLOAT_EQ(5.0, webViewImpl->maximumPageScaleFactor()); |
| 7913 } | 7920 } |
| 7914 | 7921 |
| 7915 TEST_P(ParameterizedWebFrameTest, FullscreenResizeWithTinyViewport) { | 7922 TEST_P(ParameterizedWebFrameTest, FullscreenResizeWithTinyViewport) { |
| 7916 FakeCompositingWebViewClient client; | 7923 FakeCompositingWebViewClient client; |
| 7917 registerMockedHttpURLLoad("viewport-tiny.html"); | 7924 registerMockedHttpURLLoad("viewport-tiny.html"); |
| 7918 FrameTestHelpers::WebViewHelper webViewHelper; | 7925 FrameTestHelpers::WebViewHelper webViewHelper; |
| 7919 WebViewImpl* webViewImpl = webViewHelper.initializeAndLoad( | 7926 WebViewImpl* webViewImpl = webViewHelper.initializeAndLoad( |
| 7920 m_baseURL + "viewport-tiny.html", true, nullptr, &client, nullptr, | 7927 m_baseURL + "viewport-tiny.html", true, nullptr, &client, nullptr, |
| 7921 configureAndroid); | 7928 configureAndroid); |
| 7922 int viewportWidth = 384; | 7929 int viewportWidth = 384; |
| 7923 int viewportHeight = 640; | 7930 int viewportHeight = 640; |
| 7924 client.m_screenInfo.rect.width = viewportWidth; | 7931 client.m_screenInfo.rect.width = viewportWidth; |
| 7925 client.m_screenInfo.rect.height = viewportHeight; | 7932 client.m_screenInfo.rect.height = viewportHeight; |
| 7926 webViewHelper.resize(WebSize(viewportWidth, viewportHeight)); | 7933 webViewHelper.resize(WebSize(viewportWidth, viewportHeight)); |
| 7927 webViewImpl->updateAllLifecyclePhases(); | 7934 webViewImpl->updateAllLifecyclePhases(); |
| 7928 | 7935 |
| 7929 LayoutViewItem layoutViewItem = | 7936 LayoutViewItem layoutViewItem = |
| 7930 webViewHelper.webView()->mainFrameImpl()->frameView()->layoutViewItem(); | 7937 webViewHelper.webView()->mainFrameImpl()->frameView()->layoutViewItem(); |
| 7931 Document* document = webViewImpl->mainFrameImpl()->frame()->document(); | 7938 Document* document = webViewImpl->mainFrameImpl()->frame()->document(); |
| 7932 UserGestureIndicator gesture(DocumentUserGestureToken::create(document)); | 7939 UserGestureIndicator gesture(DocumentUserGestureToken::create(document)); |
| 7933 Fullscreen::requestFullscreen(*document->documentElement()); | 7940 Fullscreen::requestFullscreen(*document->documentElement()); |
| 7934 webViewImpl->didEnterFullscreen(); | 7941 webViewImpl->didEnterFullscreen(); |
| 7935 webViewImpl->beginFrame(WTF::monotonicallyIncreasingTime()); | |
| 7936 webViewImpl->updateAllLifecyclePhases(); | 7942 webViewImpl->updateAllLifecyclePhases(); |
| 7937 EXPECT_EQ(384, layoutViewItem.logicalWidth().floor()); | 7943 EXPECT_EQ(384, layoutViewItem.logicalWidth().floor()); |
| 7938 EXPECT_EQ(640, layoutViewItem.logicalHeight().floor()); | 7944 EXPECT_EQ(640, layoutViewItem.logicalHeight().floor()); |
| 7939 EXPECT_FLOAT_EQ(1.0, webViewImpl->pageScaleFactor()); | 7945 EXPECT_FLOAT_EQ(1.0, webViewImpl->pageScaleFactor()); |
| 7940 EXPECT_FLOAT_EQ(1.0, webViewImpl->minimumPageScaleFactor()); | 7946 EXPECT_FLOAT_EQ(1.0, webViewImpl->minimumPageScaleFactor()); |
| 7941 EXPECT_FLOAT_EQ(1.0, webViewImpl->maximumPageScaleFactor()); | 7947 EXPECT_FLOAT_EQ(1.0, webViewImpl->maximumPageScaleFactor()); |
| 7942 | 7948 |
| 7943 viewportWidth = 640; | 7949 viewportWidth = 640; |
| 7944 viewportHeight = 384; | 7950 viewportHeight = 384; |
| 7945 client.m_screenInfo.rect.width = viewportWidth; | 7951 client.m_screenInfo.rect.width = viewportWidth; |
| 7946 client.m_screenInfo.rect.height = viewportHeight; | 7952 client.m_screenInfo.rect.height = viewportHeight; |
| 7947 webViewHelper.resize(WebSize(viewportWidth, viewportHeight)); | 7953 webViewHelper.resize(WebSize(viewportWidth, viewportHeight)); |
| 7948 webViewImpl->updateAllLifecyclePhases(); | 7954 webViewImpl->updateAllLifecyclePhases(); |
| 7949 EXPECT_EQ(640, layoutViewItem.logicalWidth().floor()); | 7955 EXPECT_EQ(640, layoutViewItem.logicalWidth().floor()); |
| 7950 EXPECT_EQ(384, layoutViewItem.logicalHeight().floor()); | 7956 EXPECT_EQ(384, layoutViewItem.logicalHeight().floor()); |
| 7951 EXPECT_FLOAT_EQ(1.0, webViewImpl->pageScaleFactor()); | 7957 EXPECT_FLOAT_EQ(1.0, webViewImpl->pageScaleFactor()); |
| 7952 EXPECT_FLOAT_EQ(1.0, webViewImpl->minimumPageScaleFactor()); | 7958 EXPECT_FLOAT_EQ(1.0, webViewImpl->minimumPageScaleFactor()); |
| 7953 EXPECT_FLOAT_EQ(1.0, webViewImpl->maximumPageScaleFactor()); | 7959 EXPECT_FLOAT_EQ(1.0, webViewImpl->maximumPageScaleFactor()); |
| 7954 | 7960 |
| 7955 webViewImpl->didExitFullscreen(); | 7961 webViewImpl->didExitFullscreen(); |
| 7956 webViewImpl->beginFrame(WTF::monotonicallyIncreasingTime()); | |
| 7957 webViewImpl->updateAllLifecyclePhases(); | 7962 webViewImpl->updateAllLifecyclePhases(); |
| 7958 EXPECT_EQ(320, layoutViewItem.logicalWidth().floor()); | 7963 EXPECT_EQ(320, layoutViewItem.logicalWidth().floor()); |
| 7959 EXPECT_EQ(192, layoutViewItem.logicalHeight().floor()); | 7964 EXPECT_EQ(192, layoutViewItem.logicalHeight().floor()); |
| 7960 EXPECT_FLOAT_EQ(2, webViewImpl->pageScaleFactor()); | 7965 EXPECT_FLOAT_EQ(2, webViewImpl->pageScaleFactor()); |
| 7961 EXPECT_FLOAT_EQ(2, webViewImpl->minimumPageScaleFactor()); | 7966 EXPECT_FLOAT_EQ(2, webViewImpl->minimumPageScaleFactor()); |
| 7962 EXPECT_FLOAT_EQ(5.0, webViewImpl->maximumPageScaleFactor()); | 7967 EXPECT_FLOAT_EQ(5.0, webViewImpl->maximumPageScaleFactor()); |
| 7963 } | 7968 } |
| 7964 | 7969 |
| 7965 TEST_P(ParameterizedWebFrameTest, FullscreenRestoreScaleFactorUponExiting) { | 7970 TEST_P(ParameterizedWebFrameTest, FullscreenRestoreScaleFactorUponExiting) { |
| 7966 // The purpose of this test is to more precisely simulate the sequence of | 7971 // The purpose of this test is to more precisely simulate the sequence of |
| (...skipping 23 matching lines...) Expand all Loading... |
| 7990 EXPECT_FLOAT_EQ(1.0, webViewImpl->minimumPageScaleFactor()); | 7995 EXPECT_FLOAT_EQ(1.0, webViewImpl->minimumPageScaleFactor()); |
| 7991 EXPECT_FLOAT_EQ(5.0, webViewImpl->maximumPageScaleFactor()); | 7996 EXPECT_FLOAT_EQ(5.0, webViewImpl->maximumPageScaleFactor()); |
| 7992 | 7997 |
| 7993 { | 7998 { |
| 7994 Document* document = webViewImpl->mainFrameImpl()->frame()->document(); | 7999 Document* document = webViewImpl->mainFrameImpl()->frame()->document(); |
| 7995 UserGestureIndicator gesture(DocumentUserGestureToken::create(document)); | 8000 UserGestureIndicator gesture(DocumentUserGestureToken::create(document)); |
| 7996 Fullscreen::requestFullscreen(*document->body()); | 8001 Fullscreen::requestFullscreen(*document->body()); |
| 7997 } | 8002 } |
| 7998 | 8003 |
| 7999 webViewImpl->didEnterFullscreen(); | 8004 webViewImpl->didEnterFullscreen(); |
| 8000 webViewImpl->beginFrame(WTF::monotonicallyIncreasingTime()); | |
| 8001 webViewImpl->updateAllLifecyclePhases(); | 8005 webViewImpl->updateAllLifecyclePhases(); |
| 8002 client.m_screenInfo.rect.width = screenSizeMinusStatusBars.width; | 8006 client.m_screenInfo.rect.width = screenSizeMinusStatusBars.width; |
| 8003 client.m_screenInfo.rect.height = screenSizeMinusStatusBars.height; | 8007 client.m_screenInfo.rect.height = screenSizeMinusStatusBars.height; |
| 8004 webViewHelper.resize(screenSizeMinusStatusBars); | 8008 webViewHelper.resize(screenSizeMinusStatusBars); |
| 8005 client.m_screenInfo.rect.width = screenSize.width; | 8009 client.m_screenInfo.rect.width = screenSize.width; |
| 8006 client.m_screenInfo.rect.height = screenSize.height; | 8010 client.m_screenInfo.rect.height = screenSize.height; |
| 8007 webViewHelper.resize(screenSize); | 8011 webViewHelper.resize(screenSize); |
| 8008 EXPECT_EQ(screenSize.width, layoutViewItem.logicalWidth().floor()); | 8012 EXPECT_EQ(screenSize.width, layoutViewItem.logicalWidth().floor()); |
| 8009 EXPECT_EQ(screenSize.height, layoutViewItem.logicalHeight().floor()); | 8013 EXPECT_EQ(screenSize.height, layoutViewItem.logicalHeight().floor()); |
| 8010 EXPECT_FLOAT_EQ(1.0, webViewImpl->pageScaleFactor()); | 8014 EXPECT_FLOAT_EQ(1.0, webViewImpl->pageScaleFactor()); |
| 8011 EXPECT_FLOAT_EQ(1.0, webViewImpl->minimumPageScaleFactor()); | 8015 EXPECT_FLOAT_EQ(1.0, webViewImpl->minimumPageScaleFactor()); |
| 8012 EXPECT_FLOAT_EQ(1.0, webViewImpl->maximumPageScaleFactor()); | 8016 EXPECT_FLOAT_EQ(1.0, webViewImpl->maximumPageScaleFactor()); |
| 8013 | 8017 |
| 8014 webViewImpl->didExitFullscreen(); | 8018 webViewImpl->didExitFullscreen(); |
| 8015 webViewImpl->beginFrame(WTF::monotonicallyIncreasingTime()); | |
| 8016 webViewImpl->updateAllLifecyclePhases(); | 8019 webViewImpl->updateAllLifecyclePhases(); |
| 8017 client.m_screenInfo.rect.width = screenSizeMinusStatusBars.width; | 8020 client.m_screenInfo.rect.width = screenSizeMinusStatusBars.width; |
| 8018 client.m_screenInfo.rect.height = screenSizeMinusStatusBars.height; | 8021 client.m_screenInfo.rect.height = screenSizeMinusStatusBars.height; |
| 8019 webViewHelper.resize(screenSizeMinusStatusBars); | 8022 webViewHelper.resize(screenSizeMinusStatusBars); |
| 8020 client.m_screenInfo.rect.width = screenSizeMinusStatusBarsMinusUrlBar.width; | 8023 client.m_screenInfo.rect.width = screenSizeMinusStatusBarsMinusUrlBar.width; |
| 8021 client.m_screenInfo.rect.height = screenSizeMinusStatusBarsMinusUrlBar.height; | 8024 client.m_screenInfo.rect.height = screenSizeMinusStatusBarsMinusUrlBar.height; |
| 8022 webViewHelper.resize(screenSizeMinusStatusBarsMinusUrlBar); | 8025 webViewHelper.resize(screenSizeMinusStatusBarsMinusUrlBar); |
| 8023 EXPECT_EQ(screenSizeMinusStatusBarsMinusUrlBar.width, | 8026 EXPECT_EQ(screenSizeMinusStatusBarsMinusUrlBar.width, |
| 8024 layoutViewItem.logicalWidth().floor()); | 8027 layoutViewItem.logicalWidth().floor()); |
| 8025 EXPECT_EQ(screenSizeMinusStatusBarsMinusUrlBar.height, | 8028 EXPECT_EQ(screenSizeMinusStatusBarsMinusUrlBar.height, |
| (...skipping 25 matching lines...) Expand all Loading... |
| 8051 EXPECT_EQ(640, layoutViewItem.logicalHeight().floor()); | 8054 EXPECT_EQ(640, layoutViewItem.logicalHeight().floor()); |
| 8052 EXPECT_FLOAT_EQ(0.3125, webViewImpl->pageScaleFactor()); | 8055 EXPECT_FLOAT_EQ(0.3125, webViewImpl->pageScaleFactor()); |
| 8053 EXPECT_FLOAT_EQ(0.3125, webViewImpl->minimumPageScaleFactor()); | 8056 EXPECT_FLOAT_EQ(0.3125, webViewImpl->minimumPageScaleFactor()); |
| 8054 EXPECT_FLOAT_EQ(5.0, webViewImpl->maximumPageScaleFactor()); | 8057 EXPECT_FLOAT_EQ(5.0, webViewImpl->maximumPageScaleFactor()); |
| 8055 | 8058 |
| 8056 Document* document = webViewImpl->mainFrameImpl()->frame()->document(); | 8059 Document* document = webViewImpl->mainFrameImpl()->frame()->document(); |
| 8057 UserGestureIndicator gesture( | 8060 UserGestureIndicator gesture( |
| 8058 DocumentUserGestureToken::create(document, UserGestureToken::NewGesture)); | 8061 DocumentUserGestureToken::create(document, UserGestureToken::NewGesture)); |
| 8059 Fullscreen::requestFullscreen(*document->documentElement()); | 8062 Fullscreen::requestFullscreen(*document->documentElement()); |
| 8060 webViewImpl->didEnterFullscreen(); | 8063 webViewImpl->didEnterFullscreen(); |
| 8061 webViewImpl->beginFrame(WTF::monotonicallyIncreasingTime()); | |
| 8062 webViewImpl->updateAllLifecyclePhases(); | 8064 webViewImpl->updateAllLifecyclePhases(); |
| 8063 | 8065 |
| 8064 // Entering fullscreen causes layout size and page scale limits to be | 8066 // Entering fullscreen causes layout size and page scale limits to be |
| 8065 // overridden. | 8067 // overridden. |
| 8066 EXPECT_EQ(100, layoutViewItem.logicalWidth().floor()); | 8068 EXPECT_EQ(100, layoutViewItem.logicalWidth().floor()); |
| 8067 EXPECT_EQ(200, layoutViewItem.logicalHeight().floor()); | 8069 EXPECT_EQ(200, layoutViewItem.logicalHeight().floor()); |
| 8068 EXPECT_FLOAT_EQ(1.0, webViewImpl->pageScaleFactor()); | 8070 EXPECT_FLOAT_EQ(1.0, webViewImpl->pageScaleFactor()); |
| 8069 EXPECT_FLOAT_EQ(1.0, webViewImpl->minimumPageScaleFactor()); | 8071 EXPECT_FLOAT_EQ(1.0, webViewImpl->minimumPageScaleFactor()); |
| 8070 EXPECT_FLOAT_EQ(1.0, webViewImpl->maximumPageScaleFactor()); | 8072 EXPECT_FLOAT_EQ(1.0, webViewImpl->maximumPageScaleFactor()); |
| 8071 | 8073 |
| 8072 const char source[] = "<meta name=\"viewport\" content=\"width=200\">"; | 8074 const char source[] = "<meta name=\"viewport\" content=\"width=200\">"; |
| 8073 | 8075 |
| 8074 // Load a new page before exiting fullscreen. | 8076 // Load a new page before exiting fullscreen. |
| 8075 KURL testURL = toKURL("about:blank"); | 8077 KURL testURL = toKURL("about:blank"); |
| 8076 WebFrame* frame = webViewHelper.webView()->mainFrame(); | 8078 WebFrame* frame = webViewHelper.webView()->mainFrame(); |
| 8077 FrameTestHelpers::loadHTMLString(frame, source, testURL); | 8079 FrameTestHelpers::loadHTMLString(frame, source, testURL); |
| 8078 webViewImpl->didExitFullscreen(); | 8080 webViewImpl->didExitFullscreen(); |
| 8079 webViewImpl->beginFrame(WTF::monotonicallyIncreasingTime()); | |
| 8080 webViewImpl->updateAllLifecyclePhases(); | 8081 webViewImpl->updateAllLifecyclePhases(); |
| 8081 | 8082 |
| 8082 // Make sure the new page's layout size and scale factor limits aren't | 8083 // Make sure the new page's layout size and scale factor limits aren't |
| 8083 // overridden. | 8084 // overridden. |
| 8084 layoutViewItem = webViewImpl->mainFrameImpl()->frameView()->layoutViewItem(); | 8085 layoutViewItem = webViewImpl->mainFrameImpl()->frameView()->layoutViewItem(); |
| 8085 EXPECT_EQ(200, layoutViewItem.logicalWidth().floor()); | 8086 EXPECT_EQ(200, layoutViewItem.logicalWidth().floor()); |
| 8086 EXPECT_EQ(400, layoutViewItem.logicalHeight().floor()); | 8087 EXPECT_EQ(400, layoutViewItem.logicalHeight().floor()); |
| 8087 EXPECT_FLOAT_EQ(0.5, webViewImpl->minimumPageScaleFactor()); | 8088 EXPECT_FLOAT_EQ(0.5, webViewImpl->minimumPageScaleFactor()); |
| 8088 EXPECT_FLOAT_EQ(5.0, webViewImpl->maximumPageScaleFactor()); | 8089 EXPECT_FLOAT_EQ(5.0, webViewImpl->maximumPageScaleFactor()); |
| 8089 } | 8090 } |
| (...skipping 27 matching lines...) Expand all Loading... |
| 8117 m_baseURL + "fullscreen_video.html", true, nullptr, &webViewClient); | 8118 m_baseURL + "fullscreen_video.html", true, nullptr, &webViewClient); |
| 8118 | 8119 |
| 8119 const TestFullscreenWebLayerTreeView& layerTreeView = | 8120 const TestFullscreenWebLayerTreeView& layerTreeView = |
| 8120 webViewClient.testFullscreenLayerTreeView; | 8121 webViewClient.testFullscreenLayerTreeView; |
| 8121 | 8122 |
| 8122 Document* document = webViewImpl->mainFrameImpl()->frame()->document(); | 8123 Document* document = webViewImpl->mainFrameImpl()->frame()->document(); |
| 8123 UserGestureIndicator gesture(DocumentUserGestureToken::create(document)); | 8124 UserGestureIndicator gesture(DocumentUserGestureToken::create(document)); |
| 8124 HTMLVideoElement* video = | 8125 HTMLVideoElement* video = |
| 8125 toHTMLVideoElement(document->getElementById("video")); | 8126 toHTMLVideoElement(document->getElementById("video")); |
| 8126 EXPECT_TRUE(video->usesOverlayFullscreenVideo()); | 8127 EXPECT_TRUE(video->usesOverlayFullscreenVideo()); |
| 8128 EXPECT_FALSE(video->isFullscreen()); |
| 8129 EXPECT_FALSE(layerTreeView.hasTransparentBackground); |
| 8127 | 8130 |
| 8128 video->webkitEnterFullscreen(); | 8131 video->webkitEnterFullscreen(); |
| 8129 webViewImpl->didEnterFullscreen(); | 8132 webViewImpl->didEnterFullscreen(); |
| 8133 webViewImpl->updateAllLifecyclePhases(); |
| 8134 EXPECT_TRUE(video->isFullscreen()); |
| 8135 EXPECT_TRUE(layerTreeView.hasTransparentBackground); |
| 8136 |
| 8137 webViewImpl->didExitFullscreen(); |
| 8138 webViewImpl->updateAllLifecyclePhases(); |
| 8130 EXPECT_FALSE(video->isFullscreen()); | 8139 EXPECT_FALSE(video->isFullscreen()); |
| 8131 EXPECT_FALSE(layerTreeView.hasTransparentBackground); | 8140 EXPECT_FALSE(layerTreeView.hasTransparentBackground); |
| 8132 webViewImpl->beginFrame(WTF::monotonicallyIncreasingTime()); | |
| 8133 EXPECT_TRUE(video->isFullscreen()); | |
| 8134 EXPECT_TRUE(layerTreeView.hasTransparentBackground); | |
| 8135 webViewImpl->updateAllLifecyclePhases(); | |
| 8136 | |
| 8137 webViewImpl->didExitFullscreen(); | |
| 8138 EXPECT_TRUE(video->isFullscreen()); | |
| 8139 EXPECT_TRUE(layerTreeView.hasTransparentBackground); | |
| 8140 webViewImpl->beginFrame(WTF::monotonicallyIncreasingTime()); | |
| 8141 EXPECT_FALSE(video->isFullscreen()); | |
| 8142 EXPECT_FALSE(layerTreeView.hasTransparentBackground); | |
| 8143 webViewImpl->updateAllLifecyclePhases(); | |
| 8144 } | 8141 } |
| 8145 | 8142 |
| 8146 TEST_P(ParameterizedWebFrameTest, LayoutBlockPercentHeightDescendants) { | 8143 TEST_P(ParameterizedWebFrameTest, LayoutBlockPercentHeightDescendants) { |
| 8147 registerMockedHttpURLLoad("percent-height-descendants.html"); | 8144 registerMockedHttpURLLoad("percent-height-descendants.html"); |
| 8148 FrameTestHelpers::WebViewHelper webViewHelper; | 8145 FrameTestHelpers::WebViewHelper webViewHelper; |
| 8149 webViewHelper.initializeAndLoad(m_baseURL + | 8146 webViewHelper.initializeAndLoad(m_baseURL + |
| 8150 "percent-height-descendants.html"); | 8147 "percent-height-descendants.html"); |
| 8151 | 8148 |
| 8152 WebViewImpl* webView = webViewHelper.webView(); | 8149 WebViewImpl* webView = webViewHelper.webView(); |
| 8153 webViewHelper.resize(WebSize(800, 800)); | 8150 webViewHelper.resize(WebSize(800, 800)); |
| (...skipping 3080 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 11234 | 11231 |
| 11235 EXPECT_TRUE(mainFrameClient.childClient().didCallFrameDetached()); | 11232 EXPECT_TRUE(mainFrameClient.childClient().didCallFrameDetached()); |
| 11236 EXPECT_TRUE(mainFrameClient.childClient().didCallDidStopLoading()); | 11233 EXPECT_TRUE(mainFrameClient.childClient().didCallDidStopLoading()); |
| 11237 EXPECT_TRUE(mainFrameClient.childClient().didCallDidFinishDocumentLoad()); | 11234 EXPECT_TRUE(mainFrameClient.childClient().didCallDidFinishDocumentLoad()); |
| 11238 EXPECT_TRUE(mainFrameClient.childClient().didCallDidHandleOnloadEvents()); | 11235 EXPECT_TRUE(mainFrameClient.childClient().didCallDidHandleOnloadEvents()); |
| 11239 | 11236 |
| 11240 webViewHelper.reset(); | 11237 webViewHelper.reset(); |
| 11241 } | 11238 } |
| 11242 | 11239 |
| 11243 } // namespace blink | 11240 } // namespace blink |
| OLD | NEW |