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

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

Issue 662393003: Revert 183623 "Fix fullscreen elements in pinch viewport mode." (Closed) Base URL: svn://svn.chromium.org/blink/branches/chromium/2194/
Patch Set: Created 6 years, 2 months 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
« no previous file with comments | « Source/web/WebViewImpl.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
===================================================================
--- Source/web/tests/WebFrameTest.cpp (revision 183995)
+++ Source/web/tests/WebFrameTest.cpp (working copy)
@@ -66,7 +66,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/URLTestHelpers.h"
@@ -144,6 +143,11 @@
} while (false)
+class FakeCompositingWebViewClient : public FrameTestHelpers::TestWebViewClient {
+public:
+ virtual bool enterFullScreen() override { return true; }
+};
+
class WebFrameTest : public testing::Test {
protected:
WebFrameTest()
@@ -683,11 +687,6 @@
WebScreenInfo m_screenInfo;
};
-class FakeCompositingWebViewClient : public FixedLayoutTestWebViewClient {
-public:
- virtual bool enterFullScreen() override { return true; }
-};
-
// Viewport settings need to be set before the page gets loaded
static void enableViewportSettings(WebSettings* settings)
{
@@ -6101,42 +6100,6 @@
EXPECT_POINT_EQ(IntPoint(50, 51), frameView->maximumScrollPosition());
}
-TEST_F(WebFrameTest, FullscreenLayerSize)
-{
- 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();
-
- Document* document = toWebLocalFrameImpl(webViewImpl->mainFrame())->frame()->document();
- UserGestureIndicator gesture(DefinitelyProcessingUserGesture);
- Element* divFullscreen = document->getElementById("div1");
- Fullscreen::from(*document).requestFullscreen(*divFullscreen, Fullscreen::PrefixedRequest);
- webViewImpl->didEnterFullScreen();
- webViewImpl->layout();
- ASSERT_TRUE(Fullscreen::isFullScreen(*document));
-
- // Verify that the element is sized to the viewport.
- RenderFullScreen* fullscreenRenderer = Fullscreen::from(*document).fullScreenRenderer();
- EXPECT_EQ(viewportWidth, fullscreenRenderer->logicalWidth().toInt());
- EXPECT_EQ(viewportHeight, fullscreenRenderer->logicalHeight().toInt());
-
- // Verify it's updated after a device rotation.
- client.m_screenInfo.rect.width = viewportHeight;
- client.m_screenInfo.rect.height = viewportWidth;
- webViewImpl->resize(WebSize(viewportHeight, viewportWidth));
- webViewImpl->layout();
- EXPECT_EQ(viewportHeight, fullscreenRenderer->logicalWidth().toInt());
- EXPECT_EQ(viewportWidth, fullscreenRenderer->logicalHeight().toInt());
-
-}
-
TEST_F(WebFrameTest, FullscreenLayerNonScrollable)
{
FakeCompositingWebViewClient client;
@@ -6144,7 +6107,7 @@
FrameTestHelpers::WebViewHelper webViewHelper;
int viewportWidth = 640;
int viewportHeight = 480;
- WebViewImpl* webViewImpl = webViewHelper.initializeAndLoad(m_baseURL + "fullscreen_div.html", true, 0, &client, configurePinchVirtualViewport);
+ WebViewImpl* webViewImpl = webViewHelper.initializeAndLoad(m_baseURL + "fullscreen_div.html", true, 0, &client, &configueCompositingWebView);
webViewImpl->resize(WebSize(viewportWidth, viewportHeight));
webViewImpl->layout();
@@ -6155,19 +6118,17 @@
webViewImpl->didEnterFullScreen();
webViewImpl->layout();
- // Verify that the main frame is nonscrollable.
+ // Verify that the main frame bounds are empty.
ASSERT_TRUE(Fullscreen::isFullScreen(*document));
WebLayer* webScrollLayer = webViewImpl->compositor()->scrollLayer()->platformLayer();
- ASSERT_FALSE(webScrollLayer->userScrollableHorizontal());
- ASSERT_FALSE(webScrollLayer->userScrollableVertical());
+ ASSERT_EQ(WebSize(), webScrollLayer->bounds());
// Verify that the main frame is scrollable upon exiting fullscreen.
webViewImpl->didExitFullScreen();
webViewImpl->layout();
ASSERT_FALSE(Fullscreen::isFullScreen(*document));
webScrollLayer = webViewImpl->compositor()->scrollLayer()->platformLayer();
- ASSERT_TRUE(webScrollLayer->userScrollableHorizontal());
- ASSERT_TRUE(webScrollLayer->userScrollableVertical());
+ ASSERT_NE(WebSize(), webScrollLayer->bounds());
}
TEST_F(WebFrameTest, FullscreenMainFrameScrollable)
@@ -6177,7 +6138,7 @@
FrameTestHelpers::WebViewHelper webViewHelper;
int viewportWidth = 640;
int viewportHeight = 480;
- WebViewImpl* webViewImpl = webViewHelper.initializeAndLoad(m_baseURL + "fullscreen_div.html", true, 0, &client, configurePinchVirtualViewport);
+ WebViewImpl* webViewImpl = webViewHelper.initializeAndLoad(m_baseURL + "fullscreen_div.html", true, 0, &client, &configueCompositingWebView);
webViewImpl->resize(WebSize(viewportWidth, viewportHeight));
webViewImpl->layout();
@@ -6191,8 +6152,6 @@
ASSERT_TRUE(Fullscreen::isFullScreen(*document));
WebLayer* webScrollLayer = webViewImpl->compositor()->scrollLayer()->platformLayer();
ASSERT_TRUE(webScrollLayer->scrollable());
- ASSERT_TRUE(webScrollLayer->userScrollableHorizontal());
- ASSERT_TRUE(webScrollLayer->userScrollableVertical());
}
TEST_F(WebFrameTest, RenderBlockPercentHeightDescendants)
« no previous file with comments | « Source/web/WebViewImpl.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698