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

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

Issue 1568383002: Preserve page resize information when main frame is remote (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Small tweak to width comparison in setSize Created 4 years, 11 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 | « third_party/WebKit/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: 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 6d006afeac74cad236faf2591d3840026383ad59..5a555eb772e887abf9539726ba8ec8e9f7807583 100644
--- a/third_party/WebKit/Source/web/tests/WebFrameTest.cpp
+++ b/third_party/WebKit/Source/web/tests/WebFrameTest.cpp
@@ -7021,6 +7021,31 @@ TEST_F(WebFrameSwapTest, SwapMainFrame)
remoteFrame->close();
}
+TEST_F(WebFrameSwapTest, ValidateSizeOnRemoteToLocalMainFrameSwap)
+{
+ WebSize size(111, 222);
+
+ WebRemoteFrame* remoteFrame = WebRemoteFrame::create(WebTreeScopeType::Document, nullptr);
+ mainFrame()->swap(remoteFrame);
+
+ remoteFrame->view()->resize(size);
+
+ FrameTestHelpers::TestWebFrameClient client;
+ WebLocalFrame* localFrame = WebLocalFrame::createProvisional(&client, remoteFrame, WebSandboxFlags::None, WebFrameOwnerProperties());
+ remoteFrame->swap(localFrame);
+
+ // Verify that the size that was set with a remote main frame is correct
+ // after swapping to a local frame.
+ FrameHost* host = toWebViewImpl(localFrame->view())->page()->mainFrame()->host();
+ EXPECT_EQ(size.width, host->visualViewport().size().width());
+ EXPECT_EQ(size.height, host->visualViewport().size().height());
+
+ // Manually reset to break WebViewHelper's dependency on the stack allocated
+ // TestWebFrameClient.
+ reset();
+ remoteFrame->close();
+}
+
namespace {
class SwapMainFrameWhenTitleChangesWebFrameClient : public FrameTestHelpers::TestWebFrameClient {
« no previous file with comments | « third_party/WebKit/Source/web/WebViewImpl.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698