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

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

Issue 156123004: Move the frame tree into the embedder. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: T -> t Created 6 years, 10 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 | « Source/web/tests/FrameTestHelpers.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/web/tests/WebFrameTest.cpp
diff --git a/Source/web/tests/WebFrameTest.cpp b/Source/web/tests/WebFrameTest.cpp
index 6dfe3e8dc4f0e83990ac39e48505a437e6ee1ce7..cf128a99ff3f955f0d26340b079f56046ded7482 100644
--- a/Source/web/tests/WebFrameTest.cpp
+++ b/Source/web/tests/WebFrameTest.cpp
@@ -4721,13 +4721,22 @@ public:
int willSendRequestCallCount() const { return m_willSendRequestCallCount; }
int childFrameCreationCount() const { return m_childFrameCreationCount; }
- virtual WebFrame* createChildFrame(WebFrame*, const WebString&)
+ virtual WebFrame* createChildFrame(WebFrame* parent, const WebString&)
{
m_childFrameCreationCount++;
- return WebFrame::create(m_client);
+ WebFrame* frame = WebFrame::create(m_client);
+ parent->appendChild(frame);
+ return frame;
}
- virtual void willSendRequest(WebFrame* frame, unsigned, WebURLRequest& request, const WebURLResponse&)
+ virtual void frameDetached(WebFrame* frame) OVERRIDE
+ {
+ if (frame->parent())
+ frame->parent()->removeChild(frame);
+ frame->close();
+ }
+
+ virtual void willSendRequest(WebFrame* frame, unsigned, WebURLRequest& request, const WebURLResponse&) OVERRIDE
{
m_policy = request.cachePolicy();
m_willSendRequestCallCount++;
@@ -4752,7 +4761,7 @@ TEST_F(WebFrameTest, ReloadIframe)
webViewHelper.initializeAndLoad(m_baseURL + "iframe_reload.html", true, &mainClient);
WebFrameImpl* mainFrame = webViewHelper.webViewImpl()->mainFrameImpl();
- WebFrameImpl* childFrame = toWebFrameImpl(mainFrame->firstChild());
+ RefPtr<WebFrameImpl> childFrame = toWebFrameImpl(mainFrame->firstChild());
ASSERT_EQ(childFrame->client(), &childClient);
EXPECT_EQ(mainClient.childFrameCreationCount(), 1);
EXPECT_EQ(childClient.willSendRequestCallCount(), 1);
@@ -4762,7 +4771,7 @@ TEST_F(WebFrameTest, ReloadIframe)
Platform::current()->unitTestSupport()->serveAsynchronousMockedRequests();
// A new WebFrame should have been created, but the child WebFrameClient should be reused.
- ASSERT_FALSE(childFrame == toWebFrameImpl(mainFrame->firstChild()));
+ ASSERT_NE(childFrame, toWebFrameImpl(mainFrame->firstChild()));
ASSERT_EQ(toWebFrameImpl(mainFrame->firstChild())->client(), &childClient);
EXPECT_EQ(mainClient.childFrameCreationCount(), 2);
« no previous file with comments | « Source/web/tests/FrameTestHelpers.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698