| 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 {
|
|
|