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

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

Issue 1157563004: Revert of Update Blink to use the tree scope info on WebFrame for scoping checks. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 7 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') | Source/web/tests/WebViewTest.cpp » ('j') | 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 a9b8a62910172d7c6ce7b7f96546b23979721e0e..a108f11eb86b2d1ed8118b4f7d1f0231fcd1297b 100644
--- a/Source/web/tests/WebFrameTest.cpp
+++ b/Source/web/tests/WebFrameTest.cpp
@@ -5626,11 +5626,11 @@
int willSendRequestCallCount() const { return m_willSendRequestCallCount; }
int childFrameCreationCount() const { return m_childFrameCreationCount; }
- virtual WebFrame* createChildFrame(WebLocalFrame* parent, WebTreeScopeType scope, const WebString&, WebSandboxFlags)
+ virtual WebFrame* createChildFrame(WebLocalFrame* parent, const WebString&, WebSandboxFlags)
{
ASSERT(m_childClient);
m_childFrameCreationCount++;
- WebFrame* frame = WebLocalFrame::create(scope, m_childClient);
+ WebFrame* frame = WebLocalFrame::create(m_childClient);
parent->appendChild(frame);
return frame;
}
@@ -5996,7 +5996,7 @@
public:
FailCreateChildFrame() : m_callCount(0) { }
- virtual WebFrame* createChildFrame(WebLocalFrame* parent, WebTreeScopeType scope, const WebString& frameName, WebSandboxFlags sandboxFlags) override
+ virtual WebFrame* createChildFrame(WebLocalFrame* parent, const WebString& frameName, WebSandboxFlags sandboxFlags) override
{
++m_callCount;
return 0;
@@ -6688,7 +6688,7 @@
WebView* view = WebView::create(&viewClient);
view->setMainFrame(remoteClient.frame());
FrameTestHelpers::TestWebFrameClient childFrameClient;
- WebLocalFrame* childFrame = view->mainFrame()->toWebRemoteFrame()->createLocalChild(WebTreeScopeType::Document, "", WebSandboxFlags::None, &childFrameClient, nullptr);
+ WebLocalFrame* childFrame = view->mainFrame()->toWebRemoteFrame()->createLocalChild("", WebSandboxFlags::None, &childFrameClient, nullptr);
// Purposely keep the LocalFrame alive so it's the last thing to be destroyed.
RefPtrWillBePersistent<Frame> childCoreFrame = toCoreFrame(childFrame);
@@ -6718,11 +6718,11 @@
TEST_F(WebFrameSwapTest, SwapMainFrame)
{
- WebRemoteFrame* remoteFrame = WebRemoteFrame::create(WebTreeScopeType::Document, nullptr);
+ WebRemoteFrame* remoteFrame = WebRemoteFrame::create(nullptr);
mainFrame()->swap(remoteFrame);
FrameTestHelpers::TestWebFrameClient client;
- WebLocalFrame* localFrame = WebLocalFrame::create(WebTreeScopeType::Document, &client);
+ WebLocalFrame* localFrame = WebLocalFrame::create(&client);
localFrame->initializeToReplaceRemoteFrame(remoteFrame, "", WebSandboxFlags::None);
remoteFrame->swap(localFrame);
@@ -6751,11 +6751,11 @@
TEST_F(WebFrameSwapTest, SwapFirstChild)
{
- WebRemoteFrame* remoteFrame = WebRemoteFrame::create(WebTreeScopeType::Document, nullptr);
+ WebRemoteFrame* remoteFrame = WebRemoteFrame::create(nullptr);
swapAndVerifyFirstChildConsistency("local->remote", mainFrame(), remoteFrame);
FrameTestHelpers::TestWebFrameClient client;
- WebLocalFrame* localFrame = WebLocalFrame::create(WebTreeScopeType::Document, &client);
+ WebLocalFrame* localFrame = WebLocalFrame::create(&client);
localFrame->initializeToReplaceRemoteFrame(remoteFrame, "", WebSandboxFlags::None);
swapAndVerifyFirstChildConsistency("remote->local", mainFrame(), localFrame);
@@ -6789,11 +6789,11 @@
TEST_F(WebFrameSwapTest, SwapMiddleChild)
{
- WebRemoteFrame* remoteFrame = WebRemoteFrame::create(WebTreeScopeType::Document, nullptr);
+ WebRemoteFrame* remoteFrame = WebRemoteFrame::create(nullptr);
swapAndVerifyMiddleChildConsistency("local->remote", mainFrame(), remoteFrame);
FrameTestHelpers::TestWebFrameClient client;
- WebLocalFrame* localFrame = WebLocalFrame::create(WebTreeScopeType::Document, &client);
+ WebLocalFrame* localFrame = WebLocalFrame::create(&client);
localFrame->initializeToReplaceRemoteFrame(remoteFrame, "", WebSandboxFlags::None);
swapAndVerifyMiddleChildConsistency("remote->local", mainFrame(), localFrame);
@@ -6824,11 +6824,11 @@
TEST_F(WebFrameSwapTest, SwapLastChild)
{
- WebRemoteFrame* remoteFrame = WebRemoteFrame::create(WebTreeScopeType::Document, nullptr);
+ WebRemoteFrame* remoteFrame = WebRemoteFrame::create(nullptr);
swapAndVerifyLastChildConsistency("local->remote", mainFrame(), remoteFrame);
FrameTestHelpers::TestWebFrameClient client;
- WebLocalFrame* localFrame = WebLocalFrame::create(WebTreeScopeType::Document, &client);
+ WebLocalFrame* localFrame = WebLocalFrame::create(&client);
localFrame->initializeToReplaceRemoteFrame(remoteFrame, "", WebSandboxFlags::None);
swapAndVerifyLastChildConsistency("remote->local", mainFrame(), localFrame);
@@ -6859,7 +6859,7 @@
TEST_F(WebFrameSwapTest, SwapParentShouldDetachChildren)
{
- WebRemoteFrame* remoteFrame = WebRemoteFrame::create(WebTreeScopeType::Document, nullptr);
+ WebRemoteFrame* remoteFrame = WebRemoteFrame::create(0);
WebFrame* targetFrame = mainFrame()->firstChild()->nextSibling();
EXPECT_TRUE(targetFrame);
swapAndVerifySubframeConsistency("local->remote", targetFrame, remoteFrame);
@@ -6869,10 +6869,10 @@
// Create child frames in the target frame before testing the swap.
FrameTestHelpers::TestWebRemoteFrameClient remoteFrameClient;
- remoteFrame->createRemoteChild(WebTreeScopeType::Document, "", WebSandboxFlags::None, &remoteFrameClient);
+ remoteFrame->createRemoteChild("", WebSandboxFlags::None, &remoteFrameClient);
FrameTestHelpers::TestWebFrameClient client;
- WebLocalFrame* localFrame = WebLocalFrame::create(WebTreeScopeType::Document, &client);
+ WebLocalFrame* localFrame = WebLocalFrame::create(&client);
localFrame->initializeToReplaceRemoteFrame(remoteFrame, "", WebSandboxFlags::None);
swapAndVerifySubframeConsistency("remote->local", targetFrame, localFrame);
@@ -6928,7 +6928,7 @@
// Now check that remote -> local works too, since it goes through a different code path.
FrameTestHelpers::TestWebFrameClient client;
- WebLocalFrame* localFrame = WebLocalFrame::create(WebTreeScopeType::Document, &client);
+ WebLocalFrame* localFrame = WebLocalFrame::create(&client);
localFrame->initializeToReplaceRemoteFrame(remoteFrame, "", WebSandboxFlags::None);
remoteFrame->swap(localFrame);
v8::Local<v8::Value> localWindow = mainFrame()->executeScriptAndReturnValue(WebScriptSource(
@@ -6963,7 +6963,7 @@
EXPECT_TRUE(windowTop->StrictEquals(remoteWindowTop));
FrameTestHelpers::TestWebFrameClient client;
- WebLocalFrame* localFrame = WebLocalFrame::create(WebTreeScopeType::Document, &client);
+ WebLocalFrame* localFrame = WebLocalFrame::create(&client);
localFrame->initializeToReplaceRemoteFrame(remoteFrame, "", WebSandboxFlags::None);
remoteFrame->swap(localFrame);
v8::Local<v8::Value> localWindowTop = mainFrame()->executeScriptAndReturnValue(WebScriptSource("saved.top"));
@@ -7035,7 +7035,7 @@
remoteParentFrame->setReplicatedOrigin(SecurityOrigin::createUnique());
FrameTestHelpers::TestWebFrameClient childFrameClient;
- WebLocalFrame* childFrame = remoteParentFrame->createLocalChild(WebTreeScopeType::Document, "", WebSandboxFlags::None, &childFrameClient, nullptr);
+ WebLocalFrame* childFrame = remoteParentFrame->createLocalChild("", WebSandboxFlags::None, &childFrameClient, nullptr);
FrameTestHelpers::loadFrame(childFrame, m_baseURL + "subframe-hello.html");
v8::Local<v8::Value> window = childFrame->executeScriptAndReturnValue(WebScriptSource("window"));
@@ -7062,7 +7062,7 @@
remoteParentFrame->setReplicatedOrigin(SecurityOrigin::createUnique());
FrameTestHelpers::TestWebFrameClient childFrameClient;
- WebLocalFrame* childFrame = remoteParentFrame->createLocalChild(WebTreeScopeType::Document, "", WebSandboxFlags::None, &childFrameClient, nullptr);
+ WebLocalFrame* childFrame = remoteParentFrame->createLocalChild("", WebSandboxFlags::None, &childFrameClient, nullptr);
FrameTestHelpers::loadFrame(childFrame, m_baseURL + "subframe-hello.html");
v8::Local<v8::Value> frameElement = childFrame->executeScriptAndReturnValue(WebScriptSource("window.frameElement"));
@@ -7095,7 +7095,7 @@
TEST_F(WebFrameSwapTest, HistoryCommitTypeAfterRemoteToLocalSwap)
{
- WebRemoteFrame* remoteFrame = WebRemoteFrame::create(WebTreeScopeType::Document, nullptr);
+ WebRemoteFrame* remoteFrame = WebRemoteFrame::create(nullptr);
WebFrame* targetFrame = mainFrame()->firstChild();
ASSERT_TRUE(targetFrame);
targetFrame->swap(remoteFrame);
@@ -7103,7 +7103,7 @@
ASSERT_EQ(mainFrame()->firstChild(), remoteFrame);
RemoteToLocalSwapWebFrameClient client(remoteFrame);
- WebLocalFrame* localFrame = WebLocalFrame::create(WebTreeScopeType::Document, &client);
+ WebLocalFrame* localFrame = WebLocalFrame::create(&client);
localFrame->initializeToReplaceRemoteFrame(remoteFrame, "", WebSandboxFlags::None);
FrameTestHelpers::loadFrame(localFrame, m_baseURL + "subframe-hello.html");
EXPECT_EQ(WebStandardCommit, client.historyCommitType());
@@ -7194,7 +7194,7 @@
// If an iframe has a remote main frame, ensure the inital commit is correctly identified as WebInitialCommitInChildFrame.
CommitTypeWebFrameClient childFrameClient;
- WebLocalFrame* childFrame = view->mainFrame()->toWebRemoteFrame()->createLocalChild(WebTreeScopeType::Document, "", WebSandboxFlags::None, &childFrameClient, nullptr);
+ WebLocalFrame* childFrame = view->mainFrame()->toWebRemoteFrame()->createLocalChild("", WebSandboxFlags::None, &childFrameClient, nullptr);
registerMockedHttpURLLoad("foo.html");
FrameTestHelpers::loadFrame(childFrame, m_baseURL + "foo.html");
EXPECT_EQ(WebInitialCommitInChildFrame, childFrameClient.historyCommitType());
@@ -7253,7 +7253,7 @@
WebView* view = WebView::create(&viewClient);
view->setMainFrame(remoteClient.frame());
FrameTestHelpers::TestWebRemoteFrameClient childFrameClient;
- WebRemoteFrame* childFrame = view->mainFrame()->toWebRemoteFrame()->createRemoteChild(WebTreeScopeType::Document, "", WebSandboxFlags::None, &childFrameClient);
+ WebRemoteFrame* childFrame = view->mainFrame()->toWebRemoteFrame()->createRemoteChild("", WebSandboxFlags::None, &childFrameClient);
childFrame->detach();
view->close();
}
@@ -7314,10 +7314,10 @@
view->setMainFrame(remoteClient.frame());
WebRemoteFrame* parent = view->mainFrame()->toWebRemoteFrame();
- WebLocalFrame* secondFrame = parent->createLocalChild(WebTreeScopeType::Document, "", WebSandboxFlags::None, nullptr, nullptr);
- WebLocalFrame* fourthFrame = parent->createLocalChild(WebTreeScopeType::Document, "", WebSandboxFlags::None, nullptr, secondFrame);
- WebLocalFrame* thirdFrame = parent->createLocalChild(WebTreeScopeType::Document, "", WebSandboxFlags::None, nullptr, secondFrame);
- WebLocalFrame* firstFrame = parent->createLocalChild(WebTreeScopeType::Document, "", WebSandboxFlags::None, nullptr, nullptr);
+ WebLocalFrame* secondFrame = parent->createLocalChild("", WebSandboxFlags::None, nullptr, nullptr);
+ WebLocalFrame* fourthFrame = parent->createLocalChild("", WebSandboxFlags::None, nullptr, secondFrame);
+ WebLocalFrame* thirdFrame = parent->createLocalChild("", WebSandboxFlags::None, nullptr, secondFrame);
+ WebLocalFrame* firstFrame = parent->createLocalChild("", WebSandboxFlags::None, nullptr, nullptr);
EXPECT_EQ(firstFrame, parent->firstChild());
EXPECT_EQ(nullptr, firstFrame->previousSibling());
« no previous file with comments | « Source/web/tests/FrameTestHelpers.cpp ('k') | Source/web/tests/WebViewTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698