| Index: third_party/WebKit/Source/web/tests/WebFrameTest.cpp
|
| diff --git a/third_party/WebKit/Source/web/tests/WebFrameTest.cpp b/third_party/WebKit/Source/web/tests/WebFrameTest.cpp
|
| index 11297851b7d8d8a7982fc0c6e96f7985850396e1..6d0868b58db5699002006a772e120202774bef8d 100644
|
| --- a/third_party/WebKit/Source/web/tests/WebFrameTest.cpp
|
| +++ b/third_party/WebKit/Source/web/tests/WebFrameTest.cpp
|
| @@ -7665,11 +7665,14 @@ TEST_P(ParameterizedWebFrameTest, FullscreenLayerSize) {
|
| UserGestureIndicator gesture(DocumentUserGestureToken::create(document));
|
| Element* divFullscreen = document->getElementById("div1");
|
| Fullscreen::requestFullscreen(*divFullscreen);
|
| + EXPECT_EQ(nullptr, Fullscreen::currentFullScreenElementFrom(*document));
|
| + EXPECT_EQ(divFullscreen, Fullscreen::fullscreenElementFrom(*document));
|
| webViewImpl->didEnterFullscreen();
|
| - EXPECT_EQ(nullptr, Fullscreen::fullscreenElementFrom(*document));
|
| - webViewImpl->beginFrame(WTF::monotonicallyIncreasingTime());
|
| + EXPECT_EQ(divFullscreen, Fullscreen::currentFullScreenElementFrom(*document));
|
| EXPECT_EQ(divFullscreen, Fullscreen::fullscreenElementFrom(*document));
|
| webViewImpl->updateAllLifecyclePhases();
|
| + EXPECT_EQ(divFullscreen, Fullscreen::currentFullScreenElementFrom(*document));
|
| + EXPECT_EQ(divFullscreen, Fullscreen::fullscreenElementFrom(*document));
|
|
|
| // Verify that the element is sized to the viewport.
|
| LayoutFullScreen* fullscreenLayoutObject =
|
| @@ -7702,11 +7705,14 @@ TEST_F(WebFrameTest, FullscreenLayerNonScrollable) {
|
| UserGestureIndicator gesture(DocumentUserGestureToken::create(document));
|
| Element* divFullscreen = document->getElementById("div1");
|
| Fullscreen::requestFullscreen(*divFullscreen);
|
| + EXPECT_EQ(nullptr, Fullscreen::currentFullScreenElementFrom(*document));
|
| + EXPECT_EQ(divFullscreen, Fullscreen::fullscreenElementFrom(*document));
|
| webViewImpl->didEnterFullscreen();
|
| - EXPECT_EQ(nullptr, Fullscreen::fullscreenElementFrom(*document));
|
| - webViewImpl->beginFrame(WTF::monotonicallyIncreasingTime());
|
| + EXPECT_EQ(divFullscreen, Fullscreen::currentFullScreenElementFrom(*document));
|
| EXPECT_EQ(divFullscreen, Fullscreen::fullscreenElementFrom(*document));
|
| webViewImpl->updateAllLifecyclePhases();
|
| + EXPECT_EQ(divFullscreen, Fullscreen::currentFullScreenElementFrom(*document));
|
| + EXPECT_EQ(divFullscreen, Fullscreen::fullscreenElementFrom(*document));
|
|
|
| // Verify that the viewports are nonscrollable.
|
| FrameView* frameView = webViewHelper.webView()->mainFrameImpl()->frameView();
|
| @@ -7723,11 +7729,14 @@ TEST_F(WebFrameTest, FullscreenLayerNonScrollable) {
|
| ASSERT_FALSE(visualViewportScrollLayer->userScrollableVertical());
|
|
|
| // Verify that the viewports are scrollable upon exiting fullscreen.
|
| - webViewImpl->didExitFullscreen();
|
| + EXPECT_EQ(divFullscreen, Fullscreen::currentFullScreenElementFrom(*document));
|
| EXPECT_EQ(divFullscreen, Fullscreen::fullscreenElementFrom(*document));
|
| - webViewImpl->beginFrame(WTF::monotonicallyIncreasingTime());
|
| + webViewImpl->didExitFullscreen();
|
| + EXPECT_EQ(nullptr, Fullscreen::currentFullScreenElementFrom(*document));
|
| EXPECT_EQ(nullptr, Fullscreen::fullscreenElementFrom(*document));
|
| webViewImpl->updateAllLifecyclePhases();
|
| + EXPECT_EQ(nullptr, Fullscreen::currentFullScreenElementFrom(*document));
|
| + EXPECT_EQ(nullptr, Fullscreen::fullscreenElementFrom(*document));
|
| ASSERT_TRUE(layoutViewportScrollLayer->userScrollableHorizontal());
|
| ASSERT_TRUE(layoutViewportScrollLayer->userScrollableVertical());
|
| ASSERT_TRUE(visualViewportScrollLayer->userScrollableHorizontal());
|
| @@ -7749,12 +7758,20 @@ TEST_P(ParameterizedWebFrameTest, FullscreenMainFrame) {
|
| Document* document = webViewImpl->mainFrameImpl()->frame()->document();
|
| UserGestureIndicator gesture(DocumentUserGestureToken::create(document));
|
| Fullscreen::requestFullscreen(*document->documentElement());
|
| + EXPECT_EQ(nullptr, Fullscreen::currentFullScreenElementFrom(*document));
|
| + EXPECT_EQ(document->documentElement(),
|
| + Fullscreen::fullscreenElementFrom(*document));
|
| webViewImpl->didEnterFullscreen();
|
| - EXPECT_EQ(nullptr, Fullscreen::fullscreenElementFrom(*document));
|
| - webViewImpl->beginFrame(WTF::monotonicallyIncreasingTime());
|
| + EXPECT_EQ(document->documentElement(),
|
| + Fullscreen::currentFullScreenElementFrom(*document));
|
| EXPECT_EQ(document->documentElement(),
|
| Fullscreen::fullscreenElementFrom(*document));
|
| +
|
| webViewImpl->updateAllLifecyclePhases();
|
| + EXPECT_EQ(document->documentElement(),
|
| + Fullscreen::currentFullScreenElementFrom(*document));
|
| + EXPECT_EQ(document->documentElement(),
|
| + Fullscreen::fullscreenElementFrom(*document));
|
|
|
| // Verify that the main frame is still scrollable.
|
| WebLayer* webScrollLayer =
|
| @@ -7793,7 +7810,6 @@ TEST_P(ParameterizedWebFrameTest, FullscreenSubframe) {
|
| Element* divFullscreen = document->getElementById("div1");
|
| Fullscreen::requestFullscreen(*divFullscreen);
|
| webViewImpl->didEnterFullscreen();
|
| - webViewImpl->beginFrame(WTF::monotonicallyIncreasingTime());
|
| webViewImpl->updateAllLifecyclePhases();
|
|
|
| // Verify that the element is sized to the viewport.
|
| @@ -7835,11 +7851,6 @@ TEST_P(ParameterizedWebFrameTest, FullscreenNestedExit) {
|
| Fullscreen::requestFullscreen(*topBody);
|
| }
|
| webViewImpl->didEnterFullscreen();
|
| - EXPECT_EQ(nullptr, Fullscreen::fullscreenElementFrom(*topDoc));
|
| - EXPECT_EQ(nullptr, Fullscreen::fullscreenElementFrom(*iframeDoc));
|
| - webViewImpl->beginFrame(WTF::monotonicallyIncreasingTime());
|
| - EXPECT_EQ(topBody, Fullscreen::fullscreenElementFrom(*topDoc));
|
| - EXPECT_EQ(nullptr, Fullscreen::fullscreenElementFrom(*iframeDoc));
|
| webViewImpl->updateAllLifecyclePhases();
|
|
|
| {
|
| @@ -7847,25 +7858,23 @@ TEST_P(ParameterizedWebFrameTest, FullscreenNestedExit) {
|
| Fullscreen::requestFullscreen(*iframeBody);
|
| }
|
| webViewImpl->didEnterFullscreen();
|
| - EXPECT_EQ(topBody, Fullscreen::fullscreenElementFrom(*topDoc));
|
| - EXPECT_EQ(nullptr, Fullscreen::fullscreenElementFrom(*iframeDoc));
|
| - webViewImpl->beginFrame(WTF::monotonicallyIncreasingTime());
|
| - EXPECT_EQ(iframe, Fullscreen::fullscreenElementFrom(*topDoc));
|
| - EXPECT_EQ(iframeBody, Fullscreen::fullscreenElementFrom(*iframeDoc));
|
| webViewImpl->updateAllLifecyclePhases();
|
|
|
| // We are now in nested fullscreen, with both documents having a non-empty
|
| // fullscreen element stack.
|
| -
|
| - webViewImpl->didExitFullscreen();
|
| + EXPECT_EQ(topBody, Fullscreen::currentFullScreenElementFrom(*topDoc));
|
| EXPECT_EQ(iframe, Fullscreen::fullscreenElementFrom(*topDoc));
|
| + EXPECT_EQ(iframeBody, Fullscreen::currentFullScreenElementFrom(*iframeDoc));
|
| EXPECT_EQ(iframeBody, Fullscreen::fullscreenElementFrom(*iframeDoc));
|
| - webViewImpl->beginFrame(WTF::monotonicallyIncreasingTime());
|
| - EXPECT_EQ(nullptr, Fullscreen::fullscreenElementFrom(*topDoc));
|
| - EXPECT_EQ(nullptr, Fullscreen::fullscreenElementFrom(*iframeDoc));
|
| +
|
| + webViewImpl->didExitFullscreen();
|
| webViewImpl->updateAllLifecyclePhases();
|
|
|
| - // We have now fully exited fullscreen.
|
| + // We should now have fully exited fullscreen.
|
| + EXPECT_EQ(nullptr, Fullscreen::currentFullScreenElementFrom(*topDoc));
|
| + EXPECT_EQ(nullptr, Fullscreen::fullscreenElementFrom(*topDoc));
|
| + EXPECT_EQ(nullptr, Fullscreen::currentFullScreenElementFrom(*iframeDoc));
|
| + EXPECT_EQ(nullptr, Fullscreen::fullscreenElementFrom(*iframeDoc));
|
| }
|
|
|
| TEST_P(ParameterizedWebFrameTest, FullscreenWithTinyViewport) {
|
| @@ -7894,7 +7903,6 @@ TEST_P(ParameterizedWebFrameTest, FullscreenWithTinyViewport) {
|
| UserGestureIndicator gesture(DocumentUserGestureToken::create(document));
|
| Fullscreen::requestFullscreen(*document->documentElement());
|
| webViewImpl->didEnterFullscreen();
|
| - webViewImpl->beginFrame(WTF::monotonicallyIncreasingTime());
|
| webViewImpl->updateAllLifecyclePhases();
|
| EXPECT_EQ(384, layoutViewItem.logicalWidth().floor());
|
| EXPECT_EQ(640, layoutViewItem.logicalHeight().floor());
|
| @@ -7903,7 +7911,6 @@ TEST_P(ParameterizedWebFrameTest, FullscreenWithTinyViewport) {
|
| EXPECT_FLOAT_EQ(1.0, webViewImpl->maximumPageScaleFactor());
|
|
|
| webViewImpl->didExitFullscreen();
|
| - webViewImpl->beginFrame(WTF::monotonicallyIncreasingTime());
|
| webViewImpl->updateAllLifecyclePhases();
|
| EXPECT_EQ(320, layoutViewItem.logicalWidth().floor());
|
| EXPECT_EQ(533, layoutViewItem.logicalHeight().floor());
|
| @@ -7932,7 +7939,6 @@ TEST_P(ParameterizedWebFrameTest, FullscreenResizeWithTinyViewport) {
|
| UserGestureIndicator gesture(DocumentUserGestureToken::create(document));
|
| Fullscreen::requestFullscreen(*document->documentElement());
|
| webViewImpl->didEnterFullscreen();
|
| - webViewImpl->beginFrame(WTF::monotonicallyIncreasingTime());
|
| webViewImpl->updateAllLifecyclePhases();
|
| EXPECT_EQ(384, layoutViewItem.logicalWidth().floor());
|
| EXPECT_EQ(640, layoutViewItem.logicalHeight().floor());
|
| @@ -7953,7 +7959,6 @@ TEST_P(ParameterizedWebFrameTest, FullscreenResizeWithTinyViewport) {
|
| EXPECT_FLOAT_EQ(1.0, webViewImpl->maximumPageScaleFactor());
|
|
|
| webViewImpl->didExitFullscreen();
|
| - webViewImpl->beginFrame(WTF::monotonicallyIncreasingTime());
|
| webViewImpl->updateAllLifecyclePhases();
|
| EXPECT_EQ(320, layoutViewItem.logicalWidth().floor());
|
| EXPECT_EQ(192, layoutViewItem.logicalHeight().floor());
|
| @@ -7997,7 +8002,6 @@ TEST_P(ParameterizedWebFrameTest, FullscreenRestoreScaleFactorUponExiting) {
|
| }
|
|
|
| webViewImpl->didEnterFullscreen();
|
| - webViewImpl->beginFrame(WTF::monotonicallyIncreasingTime());
|
| webViewImpl->updateAllLifecyclePhases();
|
| client.m_screenInfo.rect.width = screenSizeMinusStatusBars.width;
|
| client.m_screenInfo.rect.height = screenSizeMinusStatusBars.height;
|
| @@ -8012,7 +8016,6 @@ TEST_P(ParameterizedWebFrameTest, FullscreenRestoreScaleFactorUponExiting) {
|
| EXPECT_FLOAT_EQ(1.0, webViewImpl->maximumPageScaleFactor());
|
|
|
| webViewImpl->didExitFullscreen();
|
| - webViewImpl->beginFrame(WTF::monotonicallyIncreasingTime());
|
| webViewImpl->updateAllLifecyclePhases();
|
| client.m_screenInfo.rect.width = screenSizeMinusStatusBars.width;
|
| client.m_screenInfo.rect.height = screenSizeMinusStatusBars.height;
|
| @@ -8058,7 +8061,6 @@ TEST_P(ParameterizedWebFrameTest, ClearFullscreenConstraintsOnNavigation) {
|
| DocumentUserGestureToken::create(document, UserGestureToken::NewGesture));
|
| Fullscreen::requestFullscreen(*document->documentElement());
|
| webViewImpl->didEnterFullscreen();
|
| - webViewImpl->beginFrame(WTF::monotonicallyIncreasingTime());
|
| webViewImpl->updateAllLifecyclePhases();
|
|
|
| // Entering fullscreen causes layout size and page scale limits to be
|
| @@ -8076,7 +8078,6 @@ TEST_P(ParameterizedWebFrameTest, ClearFullscreenConstraintsOnNavigation) {
|
| WebFrame* frame = webViewHelper.webView()->mainFrame();
|
| FrameTestHelpers::loadHTMLString(frame, source, testURL);
|
| webViewImpl->didExitFullscreen();
|
| - webViewImpl->beginFrame(WTF::monotonicallyIncreasingTime());
|
| webViewImpl->updateAllLifecyclePhases();
|
|
|
| // Make sure the new page's layout size and scale factor limits aren't
|
| @@ -8124,23 +8125,19 @@ TEST_P(ParameterizedWebFrameTest, OverlayFullscreenVideo) {
|
| HTMLVideoElement* video =
|
| toHTMLVideoElement(document->getElementById("video"));
|
| EXPECT_TRUE(video->usesOverlayFullscreenVideo());
|
| + EXPECT_FALSE(video->isFullscreen());
|
| + EXPECT_FALSE(layerTreeView.hasTransparentBackground);
|
|
|
| video->webkitEnterFullscreen();
|
| webViewImpl->didEnterFullscreen();
|
| - EXPECT_FALSE(video->isFullscreen());
|
| - EXPECT_FALSE(layerTreeView.hasTransparentBackground);
|
| - webViewImpl->beginFrame(WTF::monotonicallyIncreasingTime());
|
| + webViewImpl->updateAllLifecyclePhases();
|
| EXPECT_TRUE(video->isFullscreen());
|
| EXPECT_TRUE(layerTreeView.hasTransparentBackground);
|
| - webViewImpl->updateAllLifecyclePhases();
|
|
|
| webViewImpl->didExitFullscreen();
|
| - EXPECT_TRUE(video->isFullscreen());
|
| - EXPECT_TRUE(layerTreeView.hasTransparentBackground);
|
| - webViewImpl->beginFrame(WTF::monotonicallyIncreasingTime());
|
| + webViewImpl->updateAllLifecyclePhases();
|
| EXPECT_FALSE(video->isFullscreen());
|
| EXPECT_FALSE(layerTreeView.hasTransparentBackground);
|
| - webViewImpl->updateAllLifecyclePhases();
|
| }
|
|
|
| TEST_P(ParameterizedWebFrameTest, LayoutBlockPercentHeightDescendants) {
|
|
|