Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1295)

Unified Diff: Source/web/tests/WebFrameTest.cpp

Issue 788073004: Replace RenderFullscreen with top layer - Take II (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Updated after review comments. Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« Source/web/FullscreenController.cpp ('K') | « Source/web/FullscreenController.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/web/tests/WebFrameTest.cpp
diff --git a/Source/web/tests/WebFrameTest.cpp b/Source/web/tests/WebFrameTest.cpp
index 4e49576834b10337ae437e990eba63c3004b9feb..0329cfb8c9768e93cefe9c88aae2e6320ef1713b 100644
--- a/Source/web/tests/WebFrameTest.cpp
+++ b/Source/web/tests/WebFrameTest.cpp
@@ -68,7 +68,6 @@
#include "core/page/EventHandler.h"
#include "core/page/Page.h"
#include "core/rendering/HitTestResult.h"
-#include "core/rendering/RenderFullScreen.h"
#include "core/rendering/RenderView.h"
#include "core/rendering/compositing/RenderLayerCompositor.h"
#include "core/testing/NullExecutionContext.h"
@@ -6172,6 +6171,39 @@ TEST_F(WebFrameTest, DISABLED_FrameViewScrollAccountsForTopControls)
EXPECT_POINT_EQ(IntPoint(50, 51), frameView->maximumScrollPosition());
}
+TEST_F(WebFrameTest, FullscreenCleanTopLayerAndFullscreenStack)
+{
+ FakeCompositingWebViewClient client;
+ registerMockedHttpURLLoad("fullscreen_div.html");
+ FrameTestHelpers::WebViewHelper webViewHelper;
+ int viewportWidth = 640;
+ int viewportHeight = 480;
+ client.m_screenInfo.rect.width = viewportWidth;
+ client.m_screenInfo.rect.height = viewportHeight;
+ WebViewImpl* webViewImpl = webViewHelper.initializeAndLoad(m_baseURL + "fullscreen_div.html", true, 0, &client, configurePinchVirtualViewport);
+ webViewImpl->resize(WebSize(viewportWidth, viewportHeight));
+ webViewImpl->layout();
+
+ UserGestureIndicator gesture(DefinitelyProcessingUserGesture);
+ Document* document = toWebLocalFrameImpl(webViewImpl->mainFrame())->frame()->document();
+ Fullscreen& fullscreen = Fullscreen::from(*document);
+
+ Element* divFullscreen = document->getElementById("div1");
+ fullscreen.requestFullscreen(*divFullscreen, Fullscreen::PrefixedRequest);
+ webViewImpl->didEnterFullScreen();
+ ASSERT_TRUE(Fullscreen::isFullScreen(*document));
+
+ // Sanity check. We should have both in our stack.
+ ASSERT_EQ(fullscreen.fullScreenElementStack().size(), 1UL);
+ ASSERT_EQ(document->topLayerElements().size(), 2UL);
+
+ fullscreen.exitFullscreen();
+ webViewImpl->didExitFullScreen();
+
+ ASSERT_EQ(fullscreen.fullScreenElementStack().size(), 0UL);
+ ASSERT_EQ(document->topLayerElements().size(), 0UL);
+}
+
TEST_F(WebFrameTest, FullscreenLayerSize)
{
FakeCompositingWebViewClient client;
@@ -6194,7 +6226,8 @@ TEST_F(WebFrameTest, FullscreenLayerSize)
ASSERT_TRUE(Fullscreen::isFullScreen(*document));
// Verify that the element is sized to the viewport.
- RenderFullScreen* fullscreenRenderer = Fullscreen::from(*document).fullScreenRenderer();
+ Element* fullscreenElement = Fullscreen::currentFullScreenElementFrom(*document);
+ RenderBox* fullscreenRenderer = toRenderBox(fullscreenElement->renderer());
EXPECT_EQ(viewportWidth, fullscreenRenderer->logicalWidth().toInt());
EXPECT_EQ(viewportHeight, fullscreenRenderer->logicalHeight().toInt());
@@ -6293,7 +6326,8 @@ TEST_F(WebFrameTest, FullscreenSubframe)
webViewImpl->layout();
// Verify that the element is sized to the viewport.
- RenderFullScreen* fullscreenRenderer = Fullscreen::from(*document).fullScreenRenderer();
+ Element* fullscreenElement = Fullscreen::currentFullScreenElementFrom(*document);
+ RenderBox* fullscreenRenderer = toRenderBox(fullscreenElement->renderer());
EXPECT_EQ(viewportWidth, fullscreenRenderer->logicalWidth().toInt());
EXPECT_EQ(viewportHeight, fullscreenRenderer->logicalHeight().toInt());
« Source/web/FullscreenController.cpp ('K') | « Source/web/FullscreenController.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698