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

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

Issue 200943002: Fix an issue that fullscreen layer is scrollable (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: using setScrollClipLayer to do the trick Created 6 years, 9 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
Index: Source/web/tests/WebFrameTest.cpp
diff --git a/Source/web/tests/WebFrameTest.cpp b/Source/web/tests/WebFrameTest.cpp
index d39bc920fd639a006c07ef4aee8d6e911ac4ea86..3dfd900c1b4fc156086ad042b85a16f890221dde 100644
--- a/Source/web/tests/WebFrameTest.cpp
+++ b/Source/web/tests/WebFrameTest.cpp
@@ -60,6 +60,7 @@
#include "WebViewImpl.h"
#include "core/clipboard/Clipboard.h"
#include "core/dom/DocumentMarkerController.h"
+#include "core/dom/FullscreenElementStack.h"
#include "core/dom/Range.h"
#include "core/editing/Editor.h"
#include "core/editing/FrameSelection.h"
@@ -127,6 +128,8 @@ public:
return m_layerTreeView.get();
}
+ virtual bool enterFullScreen() OVERRIDE { return true; }
+
private:
OwnPtr<WebLayerTreeView> m_layerTreeView;
};
@@ -5243,4 +5246,38 @@ TEST_F(WebFrameTest, FrameViewSetFrameRect)
EXPECT_EQ_RECT(WebCore::IntRect(100, 100, 200, 200), frameView->frameRect());
}
+TEST_F(WebFrameTest, FullscreenLayerNonScrollable)
+{
+ FakeCompositingWebViewClient client;
+ registerMockedHttpURLLoad("fullscreen_div.html");
+ FrameTestHelpers::WebViewHelper webViewHelper;
+ int viewportWidth = 640;
+ int viewportHeight = 480;
+ WebViewImpl* webViewImpl = webViewHelper.initializeAndLoad(m_baseURL + "fullscreen_div.html", true, 0, &client, &configueCompositingWebView);
+ webViewImpl->settings()->setFullScreenEnabled(true);
+ webViewImpl->resize(WebSize(viewportWidth, viewportHeight));
+ webViewImpl->layout();
+
+ Document* document = toWebFrameImpl(webViewImpl->mainFrame())->frame()->document();
+ WebCore::UserGestureIndicator gesture(WebCore::DefinitelyProcessingUserGesture);
+ Element* divFullscreen = document->getElementById("div1");
+ divFullscreen->webkitRequestFullscreen();
+ webViewImpl->willEnterFullScreen();
+ webViewImpl->didEnterFullScreen();
+ webViewImpl->layout();
+
+ // Verify that the main frame is not scrollable.
+ ASSERT_TRUE(WebCore::FullscreenElementStack::isFullScreen(*document));
+ WebLayer* webScrollLayer = webViewImpl->compositor()->scrollLayer()->platformLayer();
+ ASSERT_FALSE(webScrollLayer->scrollable());
+
+ // Verify that the main frame is scrollable upon exiting fullscreen.
+ webViewImpl->willExitFullScreen();
+ webViewImpl->didExitFullScreen();
+ webViewImpl->layout();
+ ASSERT_FALSE(WebCore::FullscreenElementStack::isFullScreen(*document));
+ webScrollLayer = webViewImpl->compositor()->scrollLayer()->platformLayer();
+ ASSERT_TRUE(webScrollLayer->scrollable());
+}
+
} // namespace

Powered by Google App Engine
This is Rietveld 408576698