| 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 7677 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7688 client.m_screenInfo.rect.height = viewportHeight; | 7688 client.m_screenInfo.rect.height = viewportHeight; |
| 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, Fullscreen::PrefixedRequest); | 7698 Fullscreen::requestFullscreen(*divFullscreen); |
| 7699 EXPECT_EQ(nullptr, Fullscreen::currentFullScreenElementFrom(*document)); | 7699 EXPECT_EQ(nullptr, Fullscreen::currentFullScreenElementFrom(*document)); |
| 7700 EXPECT_EQ(divFullscreen, Fullscreen::fullscreenElementFrom(*document)); | 7700 EXPECT_EQ(divFullscreen, Fullscreen::fullscreenElementFrom(*document)); |
| 7701 webViewImpl->didEnterFullscreen(); | 7701 webViewImpl->didEnterFullscreen(); |
| 7702 EXPECT_EQ(divFullscreen, Fullscreen::currentFullScreenElementFrom(*document)); | 7702 EXPECT_EQ(divFullscreen, Fullscreen::currentFullScreenElementFrom(*document)); |
| 7703 EXPECT_EQ(divFullscreen, Fullscreen::fullscreenElementFrom(*document)); | 7703 EXPECT_EQ(divFullscreen, Fullscreen::fullscreenElementFrom(*document)); |
| 7704 webViewImpl->updateAllLifecyclePhases(); | 7704 webViewImpl->updateAllLifecyclePhases(); |
| 7705 EXPECT_EQ(divFullscreen, Fullscreen::currentFullScreenElementFrom(*document)); | 7705 EXPECT_EQ(divFullscreen, Fullscreen::currentFullScreenElementFrom(*document)); |
| 7706 EXPECT_EQ(divFullscreen, Fullscreen::fullscreenElementFrom(*document)); | 7706 EXPECT_EQ(divFullscreen, Fullscreen::fullscreenElementFrom(*document)); |
| 7707 | 7707 |
| 7708 // Verify that the element is sized to the viewport. | 7708 // Verify that the element is sized to the viewport. |
| (...skipping 19 matching lines...) Expand all Loading... |
| 7728 int viewportHeight = 480; | 7728 int viewportHeight = 480; |
| 7729 WebViewImpl* webViewImpl = webViewHelper.initializeAndLoad( | 7729 WebViewImpl* webViewImpl = webViewHelper.initializeAndLoad( |
| 7730 m_baseURL + "fullscreen_div.html", true, nullptr, &client, nullptr, | 7730 m_baseURL + "fullscreen_div.html", true, nullptr, &client, nullptr, |
| 7731 configureAndroid); | 7731 configureAndroid); |
| 7732 webViewHelper.resize(WebSize(viewportWidth, viewportHeight)); | 7732 webViewHelper.resize(WebSize(viewportWidth, viewportHeight)); |
| 7733 webViewImpl->updateAllLifecyclePhases(); | 7733 webViewImpl->updateAllLifecyclePhases(); |
| 7734 | 7734 |
| 7735 Document* document = webViewImpl->mainFrameImpl()->frame()->document(); | 7735 Document* document = webViewImpl->mainFrameImpl()->frame()->document(); |
| 7736 UserGestureIndicator gesture(DocumentUserGestureToken::create(document)); | 7736 UserGestureIndicator gesture(DocumentUserGestureToken::create(document)); |
| 7737 Element* divFullscreen = document->getElementById("div1"); | 7737 Element* divFullscreen = document->getElementById("div1"); |
| 7738 Fullscreen::requestFullscreen(*divFullscreen, Fullscreen::PrefixedRequest); | 7738 Fullscreen::requestFullscreen(*divFullscreen); |
| 7739 EXPECT_EQ(nullptr, Fullscreen::currentFullScreenElementFrom(*document)); | 7739 EXPECT_EQ(nullptr, Fullscreen::currentFullScreenElementFrom(*document)); |
| 7740 EXPECT_EQ(divFullscreen, Fullscreen::fullscreenElementFrom(*document)); | 7740 EXPECT_EQ(divFullscreen, Fullscreen::fullscreenElementFrom(*document)); |
| 7741 webViewImpl->didEnterFullscreen(); | 7741 webViewImpl->didEnterFullscreen(); |
| 7742 EXPECT_EQ(divFullscreen, Fullscreen::currentFullScreenElementFrom(*document)); | 7742 EXPECT_EQ(divFullscreen, Fullscreen::currentFullScreenElementFrom(*document)); |
| 7743 EXPECT_EQ(divFullscreen, Fullscreen::fullscreenElementFrom(*document)); | 7743 EXPECT_EQ(divFullscreen, Fullscreen::fullscreenElementFrom(*document)); |
| 7744 webViewImpl->updateAllLifecyclePhases(); | 7744 webViewImpl->updateAllLifecyclePhases(); |
| 7745 EXPECT_EQ(divFullscreen, Fullscreen::currentFullScreenElementFrom(*document)); | 7745 EXPECT_EQ(divFullscreen, Fullscreen::currentFullScreenElementFrom(*document)); |
| 7746 EXPECT_EQ(divFullscreen, Fullscreen::fullscreenElementFrom(*document)); | 7746 EXPECT_EQ(divFullscreen, Fullscreen::fullscreenElementFrom(*document)); |
| 7747 | 7747 |
| 7748 // Verify that the viewports are nonscrollable. | 7748 // Verify that the viewports are nonscrollable. |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7781 int viewportWidth = 640; | 7781 int viewportWidth = 640; |
| 7782 int viewportHeight = 480; | 7782 int viewportHeight = 480; |
| 7783 WebViewImpl* webViewImpl = webViewHelper.initializeAndLoad( | 7783 WebViewImpl* webViewImpl = webViewHelper.initializeAndLoad( |
| 7784 m_baseURL + "fullscreen_div.html", true, nullptr, &client, nullptr, | 7784 m_baseURL + "fullscreen_div.html", true, nullptr, &client, nullptr, |
| 7785 configureAndroid); | 7785 configureAndroid); |
| 7786 webViewHelper.resize(WebSize(viewportWidth, viewportHeight)); | 7786 webViewHelper.resize(WebSize(viewportWidth, viewportHeight)); |
| 7787 webViewImpl->updateAllLifecyclePhases(); | 7787 webViewImpl->updateAllLifecyclePhases(); |
| 7788 | 7788 |
| 7789 Document* document = webViewImpl->mainFrameImpl()->frame()->document(); | 7789 Document* document = webViewImpl->mainFrameImpl()->frame()->document(); |
| 7790 UserGestureIndicator gesture(DocumentUserGestureToken::create(document)); | 7790 UserGestureIndicator gesture(DocumentUserGestureToken::create(document)); |
| 7791 Fullscreen::requestFullscreen(*document->documentElement(), | 7791 Fullscreen::requestFullscreen(*document->documentElement()); |
| 7792 Fullscreen::PrefixedRequest); | |
| 7793 EXPECT_EQ(nullptr, Fullscreen::currentFullScreenElementFrom(*document)); | 7792 EXPECT_EQ(nullptr, Fullscreen::currentFullScreenElementFrom(*document)); |
| 7794 EXPECT_EQ(document->documentElement(), | 7793 EXPECT_EQ(document->documentElement(), |
| 7795 Fullscreen::fullscreenElementFrom(*document)); | 7794 Fullscreen::fullscreenElementFrom(*document)); |
| 7796 webViewImpl->didEnterFullscreen(); | 7795 webViewImpl->didEnterFullscreen(); |
| 7797 EXPECT_EQ(document->documentElement(), | 7796 EXPECT_EQ(document->documentElement(), |
| 7798 Fullscreen::currentFullScreenElementFrom(*document)); | 7797 Fullscreen::currentFullScreenElementFrom(*document)); |
| 7799 EXPECT_EQ(document->documentElement(), | 7798 EXPECT_EQ(document->documentElement(), |
| 7800 Fullscreen::fullscreenElementFrom(*document)); | 7799 Fullscreen::fullscreenElementFrom(*document)); |
| 7801 | 7800 |
| 7802 webViewImpl->updateAllLifecyclePhases(); | 7801 webViewImpl->updateAllLifecyclePhases(); |
| (...skipping 30 matching lines...) Expand all Loading... |
| 7833 client.m_screenInfo.rect.height = viewportHeight; | 7832 client.m_screenInfo.rect.height = viewportHeight; |
| 7834 webViewHelper.resize(WebSize(viewportWidth, viewportHeight)); | 7833 webViewHelper.resize(WebSize(viewportWidth, viewportHeight)); |
| 7835 webViewImpl->updateAllLifecyclePhases(); | 7834 webViewImpl->updateAllLifecyclePhases(); |
| 7836 | 7835 |
| 7837 Document* document = | 7836 Document* document = |
| 7838 toWebLocalFrameImpl(webViewHelper.webView()->mainFrame()->firstChild()) | 7837 toWebLocalFrameImpl(webViewHelper.webView()->mainFrame()->firstChild()) |
| 7839 ->frame() | 7838 ->frame() |
| 7840 ->document(); | 7839 ->document(); |
| 7841 UserGestureIndicator gesture(DocumentUserGestureToken::create(document)); | 7840 UserGestureIndicator gesture(DocumentUserGestureToken::create(document)); |
| 7842 Element* divFullscreen = document->getElementById("div1"); | 7841 Element* divFullscreen = document->getElementById("div1"); |
| 7843 Fullscreen::requestFullscreen(*divFullscreen, Fullscreen::PrefixedRequest); | 7842 Fullscreen::requestFullscreen(*divFullscreen); |
| 7844 webViewImpl->didEnterFullscreen(); | 7843 webViewImpl->didEnterFullscreen(); |
| 7845 webViewImpl->updateAllLifecyclePhases(); | 7844 webViewImpl->updateAllLifecyclePhases(); |
| 7846 | 7845 |
| 7847 // Verify that the element is sized to the viewport. | 7846 // Verify that the element is sized to the viewport. |
| 7848 LayoutFullScreen* fullscreenLayoutObject = | 7847 LayoutFullScreen* fullscreenLayoutObject = |
| 7849 Fullscreen::from(*document).fullScreenLayoutObject(); | 7848 Fullscreen::from(*document).fullScreenLayoutObject(); |
| 7850 EXPECT_EQ(viewportWidth, fullscreenLayoutObject->logicalWidth().toInt()); | 7849 EXPECT_EQ(viewportWidth, fullscreenLayoutObject->logicalWidth().toInt()); |
| 7851 EXPECT_EQ(viewportHeight, fullscreenLayoutObject->logicalHeight().toInt()); | 7850 EXPECT_EQ(viewportHeight, fullscreenLayoutObject->logicalHeight().toInt()); |
| 7852 | 7851 |
| 7853 // Verify it's updated after a device rotation. | 7852 // Verify it's updated after a device rotation. |
| (...skipping 19 matching lines...) Expand all Loading... |
| 7873 Document* topDoc = webViewImpl->mainFrameImpl()->frame()->document(); | 7872 Document* topDoc = webViewImpl->mainFrameImpl()->frame()->document(); |
| 7874 Element* topBody = topDoc->body(); | 7873 Element* topBody = topDoc->body(); |
| 7875 | 7874 |
| 7876 HTMLIFrameElement* iframe = | 7875 HTMLIFrameElement* iframe = |
| 7877 toHTMLIFrameElement(topDoc->querySelector("iframe")); | 7876 toHTMLIFrameElement(topDoc->querySelector("iframe")); |
| 7878 Document* iframeDoc = iframe->contentDocument(); | 7877 Document* iframeDoc = iframe->contentDocument(); |
| 7879 Element* iframeBody = iframeDoc->body(); | 7878 Element* iframeBody = iframeDoc->body(); |
| 7880 | 7879 |
| 7881 { | 7880 { |
| 7882 UserGestureIndicator gesture(DocumentUserGestureToken::create(topDoc)); | 7881 UserGestureIndicator gesture(DocumentUserGestureToken::create(topDoc)); |
| 7883 Fullscreen::requestFullscreen(*topBody, Fullscreen::PrefixedRequest); | 7882 Fullscreen::requestFullscreen(*topBody); |
| 7884 } | 7883 } |
| 7885 webViewImpl->didEnterFullscreen(); | 7884 webViewImpl->didEnterFullscreen(); |
| 7886 webViewImpl->updateAllLifecyclePhases(); | 7885 webViewImpl->updateAllLifecyclePhases(); |
| 7887 | 7886 |
| 7888 { | 7887 { |
| 7889 UserGestureIndicator gesture(DocumentUserGestureToken::create(iframeDoc)); | 7888 UserGestureIndicator gesture(DocumentUserGestureToken::create(iframeDoc)); |
| 7890 Fullscreen::requestFullscreen(*iframeBody, Fullscreen::PrefixedRequest); | 7889 Fullscreen::requestFullscreen(*iframeBody); |
| 7891 } | 7890 } |
| 7892 webViewImpl->didEnterFullscreen(); | 7891 webViewImpl->didEnterFullscreen(); |
| 7893 webViewImpl->updateAllLifecyclePhases(); | 7892 webViewImpl->updateAllLifecyclePhases(); |
| 7894 | 7893 |
| 7895 // We are now in nested fullscreen, with both documents having a non-empty | 7894 // We are now in nested fullscreen, with both documents having a non-empty |
| 7896 // fullscreen element stack. | 7895 // fullscreen element stack. |
| 7897 EXPECT_EQ(topBody, Fullscreen::currentFullScreenElementFrom(*topDoc)); | 7896 EXPECT_EQ(topBody, Fullscreen::currentFullScreenElementFrom(*topDoc)); |
| 7898 EXPECT_EQ(iframe, Fullscreen::fullscreenElementFrom(*topDoc)); | 7897 EXPECT_EQ(iframe, Fullscreen::fullscreenElementFrom(*topDoc)); |
| 7899 EXPECT_EQ(iframeBody, Fullscreen::currentFullScreenElementFrom(*iframeDoc)); | 7898 EXPECT_EQ(iframeBody, Fullscreen::currentFullScreenElementFrom(*iframeDoc)); |
| 7900 EXPECT_EQ(iframeBody, Fullscreen::fullscreenElementFrom(*iframeDoc)); | 7899 EXPECT_EQ(iframeBody, Fullscreen::fullscreenElementFrom(*iframeDoc)); |
| (...skipping 25 matching lines...) Expand all Loading... |
| 7926 LayoutViewItem layoutViewItem = | 7925 LayoutViewItem layoutViewItem = |
| 7927 webViewHelper.webView()->mainFrameImpl()->frameView()->layoutViewItem(); | 7926 webViewHelper.webView()->mainFrameImpl()->frameView()->layoutViewItem(); |
| 7928 EXPECT_EQ(320, layoutViewItem.logicalWidth().floor()); | 7927 EXPECT_EQ(320, layoutViewItem.logicalWidth().floor()); |
| 7929 EXPECT_EQ(533, layoutViewItem.logicalHeight().floor()); | 7928 EXPECT_EQ(533, layoutViewItem.logicalHeight().floor()); |
| 7930 EXPECT_FLOAT_EQ(1.2, webViewImpl->pageScaleFactor()); | 7929 EXPECT_FLOAT_EQ(1.2, webViewImpl->pageScaleFactor()); |
| 7931 EXPECT_FLOAT_EQ(1.2, webViewImpl->minimumPageScaleFactor()); | 7930 EXPECT_FLOAT_EQ(1.2, webViewImpl->minimumPageScaleFactor()); |
| 7932 EXPECT_FLOAT_EQ(5.0, webViewImpl->maximumPageScaleFactor()); | 7931 EXPECT_FLOAT_EQ(5.0, webViewImpl->maximumPageScaleFactor()); |
| 7933 | 7932 |
| 7934 Document* document = webViewImpl->mainFrameImpl()->frame()->document(); | 7933 Document* document = webViewImpl->mainFrameImpl()->frame()->document(); |
| 7935 UserGestureIndicator gesture(DocumentUserGestureToken::create(document)); | 7934 UserGestureIndicator gesture(DocumentUserGestureToken::create(document)); |
| 7936 Fullscreen::requestFullscreen(*document->documentElement(), | 7935 Fullscreen::requestFullscreen(*document->documentElement()); |
| 7937 Fullscreen::PrefixedRequest); | |
| 7938 webViewImpl->didEnterFullscreen(); | 7936 webViewImpl->didEnterFullscreen(); |
| 7939 webViewImpl->updateAllLifecyclePhases(); | 7937 webViewImpl->updateAllLifecyclePhases(); |
| 7940 EXPECT_EQ(384, layoutViewItem.logicalWidth().floor()); | 7938 EXPECT_EQ(384, layoutViewItem.logicalWidth().floor()); |
| 7941 EXPECT_EQ(640, layoutViewItem.logicalHeight().floor()); | 7939 EXPECT_EQ(640, layoutViewItem.logicalHeight().floor()); |
| 7942 EXPECT_FLOAT_EQ(1.0, webViewImpl->pageScaleFactor()); | 7940 EXPECT_FLOAT_EQ(1.0, webViewImpl->pageScaleFactor()); |
| 7943 EXPECT_FLOAT_EQ(1.0, webViewImpl->minimumPageScaleFactor()); | 7941 EXPECT_FLOAT_EQ(1.0, webViewImpl->minimumPageScaleFactor()); |
| 7944 EXPECT_FLOAT_EQ(1.0, webViewImpl->maximumPageScaleFactor()); | 7942 EXPECT_FLOAT_EQ(1.0, webViewImpl->maximumPageScaleFactor()); |
| 7945 | 7943 |
| 7946 webViewImpl->didExitFullscreen(); | 7944 webViewImpl->didExitFullscreen(); |
| 7947 webViewImpl->updateAllLifecyclePhases(); | 7945 webViewImpl->updateAllLifecyclePhases(); |
| (...skipping 15 matching lines...) Expand all Loading... |
| 7963 int viewportHeight = 640; | 7961 int viewportHeight = 640; |
| 7964 client.m_screenInfo.rect.width = viewportWidth; | 7962 client.m_screenInfo.rect.width = viewportWidth; |
| 7965 client.m_screenInfo.rect.height = viewportHeight; | 7963 client.m_screenInfo.rect.height = viewportHeight; |
| 7966 webViewHelper.resize(WebSize(viewportWidth, viewportHeight)); | 7964 webViewHelper.resize(WebSize(viewportWidth, viewportHeight)); |
| 7967 webViewImpl->updateAllLifecyclePhases(); | 7965 webViewImpl->updateAllLifecyclePhases(); |
| 7968 | 7966 |
| 7969 LayoutViewItem layoutViewItem = | 7967 LayoutViewItem layoutViewItem = |
| 7970 webViewHelper.webView()->mainFrameImpl()->frameView()->layoutViewItem(); | 7968 webViewHelper.webView()->mainFrameImpl()->frameView()->layoutViewItem(); |
| 7971 Document* document = webViewImpl->mainFrameImpl()->frame()->document(); | 7969 Document* document = webViewImpl->mainFrameImpl()->frame()->document(); |
| 7972 UserGestureIndicator gesture(DocumentUserGestureToken::create(document)); | 7970 UserGestureIndicator gesture(DocumentUserGestureToken::create(document)); |
| 7973 Fullscreen::requestFullscreen(*document->documentElement(), | 7971 Fullscreen::requestFullscreen(*document->documentElement()); |
| 7974 Fullscreen::PrefixedRequest); | |
| 7975 webViewImpl->didEnterFullscreen(); | 7972 webViewImpl->didEnterFullscreen(); |
| 7976 webViewImpl->updateAllLifecyclePhases(); | 7973 webViewImpl->updateAllLifecyclePhases(); |
| 7977 EXPECT_EQ(384, layoutViewItem.logicalWidth().floor()); | 7974 EXPECT_EQ(384, layoutViewItem.logicalWidth().floor()); |
| 7978 EXPECT_EQ(640, layoutViewItem.logicalHeight().floor()); | 7975 EXPECT_EQ(640, layoutViewItem.logicalHeight().floor()); |
| 7979 EXPECT_FLOAT_EQ(1.0, webViewImpl->pageScaleFactor()); | 7976 EXPECT_FLOAT_EQ(1.0, webViewImpl->pageScaleFactor()); |
| 7980 EXPECT_FLOAT_EQ(1.0, webViewImpl->minimumPageScaleFactor()); | 7977 EXPECT_FLOAT_EQ(1.0, webViewImpl->minimumPageScaleFactor()); |
| 7981 EXPECT_FLOAT_EQ(1.0, webViewImpl->maximumPageScaleFactor()); | 7978 EXPECT_FLOAT_EQ(1.0, webViewImpl->maximumPageScaleFactor()); |
| 7982 | 7979 |
| 7983 viewportWidth = 640; | 7980 viewportWidth = 640; |
| 7984 viewportHeight = 384; | 7981 viewportHeight = 384; |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8025 layoutViewItem.logicalWidth().floor()); | 8022 layoutViewItem.logicalWidth().floor()); |
| 8026 EXPECT_EQ(screenSizeMinusStatusBarsMinusUrlBar.height, | 8023 EXPECT_EQ(screenSizeMinusStatusBarsMinusUrlBar.height, |
| 8027 layoutViewItem.logicalHeight().floor()); | 8024 layoutViewItem.logicalHeight().floor()); |
| 8028 EXPECT_FLOAT_EQ(1.0, webViewImpl->pageScaleFactor()); | 8025 EXPECT_FLOAT_EQ(1.0, webViewImpl->pageScaleFactor()); |
| 8029 EXPECT_FLOAT_EQ(1.0, webViewImpl->minimumPageScaleFactor()); | 8026 EXPECT_FLOAT_EQ(1.0, webViewImpl->minimumPageScaleFactor()); |
| 8030 EXPECT_FLOAT_EQ(5.0, webViewImpl->maximumPageScaleFactor()); | 8027 EXPECT_FLOAT_EQ(5.0, webViewImpl->maximumPageScaleFactor()); |
| 8031 | 8028 |
| 8032 { | 8029 { |
| 8033 Document* document = webViewImpl->mainFrameImpl()->frame()->document(); | 8030 Document* document = webViewImpl->mainFrameImpl()->frame()->document(); |
| 8034 UserGestureIndicator gesture(DocumentUserGestureToken::create(document)); | 8031 UserGestureIndicator gesture(DocumentUserGestureToken::create(document)); |
| 8035 Fullscreen::requestFullscreen(*document->body(), | 8032 Fullscreen::requestFullscreen(*document->body()); |
| 8036 Fullscreen::PrefixedRequest); | |
| 8037 } | 8033 } |
| 8038 | 8034 |
| 8039 webViewImpl->didEnterFullscreen(); | 8035 webViewImpl->didEnterFullscreen(); |
| 8040 webViewImpl->updateAllLifecyclePhases(); | 8036 webViewImpl->updateAllLifecyclePhases(); |
| 8041 client.m_screenInfo.rect.width = screenSizeMinusStatusBars.width; | 8037 client.m_screenInfo.rect.width = screenSizeMinusStatusBars.width; |
| 8042 client.m_screenInfo.rect.height = screenSizeMinusStatusBars.height; | 8038 client.m_screenInfo.rect.height = screenSizeMinusStatusBars.height; |
| 8043 webViewHelper.resize(screenSizeMinusStatusBars); | 8039 webViewHelper.resize(screenSizeMinusStatusBars); |
| 8044 client.m_screenInfo.rect.width = screenSize.width; | 8040 client.m_screenInfo.rect.width = screenSize.width; |
| 8045 client.m_screenInfo.rect.height = screenSize.height; | 8041 client.m_screenInfo.rect.height = screenSize.height; |
| 8046 webViewHelper.resize(screenSize); | 8042 webViewHelper.resize(screenSize); |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8087 webViewImpl->mainFrameImpl()->frameView()->layoutViewItem(); | 8083 webViewImpl->mainFrameImpl()->frameView()->layoutViewItem(); |
| 8088 EXPECT_EQ(320, layoutViewItem.logicalWidth().floor()); | 8084 EXPECT_EQ(320, layoutViewItem.logicalWidth().floor()); |
| 8089 EXPECT_EQ(640, layoutViewItem.logicalHeight().floor()); | 8085 EXPECT_EQ(640, layoutViewItem.logicalHeight().floor()); |
| 8090 EXPECT_FLOAT_EQ(0.3125, webViewImpl->pageScaleFactor()); | 8086 EXPECT_FLOAT_EQ(0.3125, webViewImpl->pageScaleFactor()); |
| 8091 EXPECT_FLOAT_EQ(0.3125, webViewImpl->minimumPageScaleFactor()); | 8087 EXPECT_FLOAT_EQ(0.3125, webViewImpl->minimumPageScaleFactor()); |
| 8092 EXPECT_FLOAT_EQ(5.0, webViewImpl->maximumPageScaleFactor()); | 8088 EXPECT_FLOAT_EQ(5.0, webViewImpl->maximumPageScaleFactor()); |
| 8093 | 8089 |
| 8094 Document* document = webViewImpl->mainFrameImpl()->frame()->document(); | 8090 Document* document = webViewImpl->mainFrameImpl()->frame()->document(); |
| 8095 UserGestureIndicator gesture( | 8091 UserGestureIndicator gesture( |
| 8096 DocumentUserGestureToken::create(document, UserGestureToken::NewGesture)); | 8092 DocumentUserGestureToken::create(document, UserGestureToken::NewGesture)); |
| 8097 Fullscreen::requestFullscreen(*document->documentElement(), | 8093 Fullscreen::requestFullscreen(*document->documentElement()); |
| 8098 Fullscreen::PrefixedRequest); | |
| 8099 webViewImpl->didEnterFullscreen(); | 8094 webViewImpl->didEnterFullscreen(); |
| 8100 webViewImpl->updateAllLifecyclePhases(); | 8095 webViewImpl->updateAllLifecyclePhases(); |
| 8101 | 8096 |
| 8102 // Entering fullscreen causes layout size and page scale limits to be | 8097 // Entering fullscreen causes layout size and page scale limits to be |
| 8103 // overridden. | 8098 // overridden. |
| 8104 EXPECT_EQ(100, layoutViewItem.logicalWidth().floor()); | 8099 EXPECT_EQ(100, layoutViewItem.logicalWidth().floor()); |
| 8105 EXPECT_EQ(200, layoutViewItem.logicalHeight().floor()); | 8100 EXPECT_EQ(200, layoutViewItem.logicalHeight().floor()); |
| 8106 EXPECT_FLOAT_EQ(1.0, webViewImpl->pageScaleFactor()); | 8101 EXPECT_FLOAT_EQ(1.0, webViewImpl->pageScaleFactor()); |
| 8107 EXPECT_FLOAT_EQ(1.0, webViewImpl->minimumPageScaleFactor()); | 8102 EXPECT_FLOAT_EQ(1.0, webViewImpl->minimumPageScaleFactor()); |
| 8108 EXPECT_FLOAT_EQ(1.0, webViewImpl->maximumPageScaleFactor()); | 8103 EXPECT_FLOAT_EQ(1.0, webViewImpl->maximumPageScaleFactor()); |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8157 webViewClient.testFullscreenLayerTreeView; | 8152 webViewClient.testFullscreenLayerTreeView; |
| 8158 | 8153 |
| 8159 Document* document = webViewImpl->mainFrameImpl()->frame()->document(); | 8154 Document* document = webViewImpl->mainFrameImpl()->frame()->document(); |
| 8160 UserGestureIndicator gesture(DocumentUserGestureToken::create(document)); | 8155 UserGestureIndicator gesture(DocumentUserGestureToken::create(document)); |
| 8161 HTMLVideoElement* video = | 8156 HTMLVideoElement* video = |
| 8162 toHTMLVideoElement(document->getElementById("video")); | 8157 toHTMLVideoElement(document->getElementById("video")); |
| 8163 EXPECT_TRUE(video->usesOverlayFullscreenVideo()); | 8158 EXPECT_TRUE(video->usesOverlayFullscreenVideo()); |
| 8164 EXPECT_FALSE(video->isFullscreen()); | 8159 EXPECT_FALSE(video->isFullscreen()); |
| 8165 EXPECT_FALSE(layerTreeView.hasTransparentBackground); | 8160 EXPECT_FALSE(layerTreeView.hasTransparentBackground); |
| 8166 | 8161 |
| 8167 video->enterFullscreen(); | 8162 video->webkitEnterFullscreen(); |
| 8168 webViewImpl->didEnterFullscreen(); | 8163 webViewImpl->didEnterFullscreen(); |
| 8169 webViewImpl->updateAllLifecyclePhases(); | 8164 webViewImpl->updateAllLifecyclePhases(); |
| 8170 EXPECT_TRUE(video->isFullscreen()); | 8165 EXPECT_TRUE(video->isFullscreen()); |
| 8171 EXPECT_TRUE(layerTreeView.hasTransparentBackground); | 8166 EXPECT_TRUE(layerTreeView.hasTransparentBackground); |
| 8172 | 8167 |
| 8173 webViewImpl->didExitFullscreen(); | 8168 webViewImpl->didExitFullscreen(); |
| 8174 webViewImpl->updateAllLifecyclePhases(); | 8169 webViewImpl->updateAllLifecyclePhases(); |
| 8175 EXPECT_FALSE(video->isFullscreen()); | 8170 EXPECT_FALSE(video->isFullscreen()); |
| 8176 EXPECT_FALSE(layerTreeView.hasTransparentBackground); | 8171 EXPECT_FALSE(layerTreeView.hasTransparentBackground); |
| 8177 } | 8172 } |
| (...skipping 2911 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 11089 | 11084 |
| 11090 EXPECT_TRUE(mainFrameClient.childClient().didCallFrameDetached()); | 11085 EXPECT_TRUE(mainFrameClient.childClient().didCallFrameDetached()); |
| 11091 EXPECT_TRUE(mainFrameClient.childClient().didCallDidStopLoading()); | 11086 EXPECT_TRUE(mainFrameClient.childClient().didCallDidStopLoading()); |
| 11092 EXPECT_TRUE(mainFrameClient.childClient().didCallDidFinishDocumentLoad()); | 11087 EXPECT_TRUE(mainFrameClient.childClient().didCallDidFinishDocumentLoad()); |
| 11093 EXPECT_TRUE(mainFrameClient.childClient().didCallDidHandleOnloadEvents()); | 11088 EXPECT_TRUE(mainFrameClient.childClient().didCallDidHandleOnloadEvents()); |
| 11094 | 11089 |
| 11095 webViewHelper.reset(); | 11090 webViewHelper.reset(); |
| 11096 } | 11091 } |
| 11097 | 11092 |
| 11098 } // namespace blink | 11093 } // namespace blink |
| OLD | NEW |