Commit 5d463ee4 authored by sky@chromium.org's avatar sky@chromium.org

Adds test coverage for 521663

BUG=521663
TEST=this is a test only change
r=japhet@chromium.org

Review URL: https://codereview.chromium.org/1302333003

git-svn-id: svn://svn.chromium.org/blink/trunk@201818 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent d44ffbc6
......@@ -7043,6 +7043,36 @@ TEST_F(WebFrameSwapTest, SwapMainFrame)
remoteFrame->close();
}
namespace {
class SwapMainFrameWhenTitleChangesWebFrameClient : public FrameTestHelpers::TestWebFrameClient {
public:
SwapMainFrameWhenTitleChangesWebFrameClient() {}
~SwapMainFrameWhenTitleChangesWebFrameClient() override {}
void didReceiveTitle(WebLocalFrame* frame, const WebString&, WebTextDirection) override
{
if (!frame->parent())
frame->swap(WebRemoteFrame::create(WebTreeScopeType::Document, nullptr));
}
};
} // anonymous namespace
TEST_F(WebFrameTest, SwapMainFrameWhileLoading)
{
SwapMainFrameWhenTitleChangesWebFrameClient frameClient;
FrameTestHelpers::WebViewHelper webViewHelper;
registerMockedHttpURLLoad("frame-a-b-c.html");
registerMockedHttpURLLoad("subframe-a.html");
registerMockedHttpURLLoad("subframe-b.html");
registerMockedHttpURLLoad("subframe-c.html");
registerMockedHttpURLLoad("subframe-hello.html");
webViewHelper.initializeAndLoad(m_baseURL + "frame-a-b-c.html", true, &frameClient);
}
void swapAndVerifyFirstChildConsistency(const char* const message, WebFrame* parent, WebFrame* newChild)
{
SCOPED_TRACE(message);
......
<!DOCTYPE html>
<html>
<title>title</title>
<body>
<iframe id="frame1" name="frame1" src="subframe-a.html"></iframe>
<iframe id="frame2" name="frame2" src="subframe-b.html"></iframe>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment