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