Chromium Code Reviews| 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 { |