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

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: dcheng's suggestion 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
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..40ecd8dfc3bcc68555eaf37ecce4b4675c8d47d0 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.
+ WebFloatSize floatSize = localFrame->view()->visualViewportSize();
bokan 2016/01/11 18:18:58 This actually returns the scaled size of the viewp
kenrb 2016/01/11 20:50:26 Done.
+ EXPECT_EQ(size.width, floatSize.width);
+ EXPECT_EQ(size.height, floatSize.height);
+
+ // Manually reset to break WebViewHelper's dependency on the stack allocated
+ // TestWebFrameClient.
+ reset();
+ remoteFrame->close();
+}
+
namespace {
class SwapMainFrameWhenTitleChangesWebFrameClient : public FrameTestHelpers::TestWebFrameClient {

Powered by Google App Engine
This is Rietveld 408576698