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 912a0fd56e72d73e65100a382b85e85963eea718..e9cf8c33a1588a5cf3e6717cd7c56e8d732df0dd 100644 |
--- a/third_party/WebKit/Source/web/tests/WebFrameTest.cpp |
+++ b/third_party/WebKit/Source/web/tests/WebFrameTest.cpp |
@@ -1582,7 +1582,7 @@ TEST_F(WebFrameTest, FrameOwnerPropertiesMargin) |
properties.marginWidth = 11; |
properties.marginHeight = 22; |
FrameTestHelpers::TestWebFrameClient localFrameClient; |
- WebLocalFrame* localFrame = root->createLocalChild(WebTreeScopeType::Document, "", WebSandboxFlags::None, &localFrameClient, nullptr, properties); |
+ WebLocalFrame* localFrame = root->createLocalChild(WebTreeScopeType::Document, "name", "uniqueName", WebSandboxFlags::None, &localFrameClient, nullptr, properties); |
registerMockedHttpURLLoad("frame_owner_properties.html"); |
FrameTestHelpers::loadFrame(localFrame, m_baseURL + "frame_owner_properties.html"); |
@@ -1615,7 +1615,7 @@ TEST_F(WebFrameTest, FrameOwnerPropertiesScrolling) |
// Turn off scrolling in the subframe. |
properties.scrollingMode = WebFrameOwnerProperties::ScrollingMode::AlwaysOff; |
FrameTestHelpers::TestWebFrameClient localFrameClient; |
- WebLocalFrame* localFrame = root->createLocalChild(WebTreeScopeType::Document, "", WebSandboxFlags::None, &localFrameClient, nullptr, properties); |
+ WebLocalFrame* localFrame = root->createLocalChild(WebTreeScopeType::Document, "name", "uniqueName", WebSandboxFlags::None, &localFrameClient, nullptr, properties); |
registerMockedHttpURLLoad("frame_owner_properties.html"); |
FrameTestHelpers::loadFrame(localFrame, m_baseURL + "frame_owner_properties.html"); |
@@ -5887,7 +5887,7 @@ public: |
int willSendRequestCallCount() const { return m_willSendRequestCallCount; } |
int childFrameCreationCount() const { return m_childFrameCreationCount; } |
- virtual WebFrame* createChildFrame(WebLocalFrame* parent, WebTreeScopeType scope, const WebString&, WebSandboxFlags, const WebFrameOwnerProperties& frameOwnerProperties) |
+ virtual WebFrame* createChildFrame(WebLocalFrame* parent, WebTreeScopeType scope, const WebString&, const WebString&, WebSandboxFlags, const WebFrameOwnerProperties& frameOwnerProperties) |
{ |
ASSERT(m_childClient); |
m_childFrameCreationCount++; |
@@ -6276,7 +6276,7 @@ class FailCreateChildFrame : public FrameTestHelpers::TestWebFrameClient { |
public: |
FailCreateChildFrame() : m_callCount(0) { } |
- WebFrame* createChildFrame(WebLocalFrame* parent, WebTreeScopeType scope, const WebString& frameName, WebSandboxFlags sandboxFlags, const WebFrameOwnerProperties& frameOwnerProperties) override |
+ WebFrame* createChildFrame(WebLocalFrame* parent, WebTreeScopeType scope, const WebString& frameName, const WebString& frameUniqueName, WebSandboxFlags sandboxFlags, const WebFrameOwnerProperties& frameOwnerProperties) override |
{ |
++m_callCount; |
return 0; |
@@ -6935,7 +6935,7 @@ TEST_P(ParameterizedWebFrameTest, EmbedderTriggeredDetachWithRemoteMainFrame) |
WebView* view = WebView::create(&viewClient); |
view->setMainFrame(remoteClient.frame()); |
FrameTestHelpers::TestWebFrameClient childFrameClient; |
- WebLocalFrame* childFrame = view->mainFrame()->toWebRemoteFrame()->createLocalChild(WebTreeScopeType::Document, "", WebSandboxFlags::None, &childFrameClient, nullptr, WebFrameOwnerProperties()); |
+ WebLocalFrame* childFrame = view->mainFrame()->toWebRemoteFrame()->createLocalChild(WebTreeScopeType::Document, "name", "uniqueName", WebSandboxFlags::None, &childFrameClient, nullptr, WebFrameOwnerProperties()); |
// Purposely keep the LocalFrame alive so it's the last thing to be destroyed. |
RefPtrWillBePersistent<Frame> childCoreFrame = childFrame->toImplBase()->frame(); |
@@ -7183,7 +7183,7 @@ TEST_F(WebFrameSwapTest, SwapParentShouldDetachChildren) |
// Create child frames in the target frame before testing the swap. |
FrameTestHelpers::TestWebRemoteFrameClient remoteFrameClient2; |
- WebRemoteFrame* childRemoteFrame = remoteFrame->createRemoteChild(WebTreeScopeType::Document, "", WebSandboxFlags::None, &remoteFrameClient2); |
+ WebRemoteFrame* childRemoteFrame = remoteFrame->createRemoteChild(WebTreeScopeType::Document, "", "uniqueName0", WebSandboxFlags::None, &remoteFrameClient2); |
FrameTestHelpers::TestWebFrameClient client; |
WebLocalFrame* localFrame = WebLocalFrame::createProvisional(&client, remoteFrame, WebSandboxFlags::None, WebFrameOwnerProperties()); |
@@ -7333,7 +7333,7 @@ TEST_F(WebFrameSwapTest, FramesOfRemoteParentAreIndexable) |
remoteParentFrame->setReplicatedOrigin(SecurityOrigin::createUnique()); |
FrameTestHelpers::TestWebFrameClient childFrameClient; |
- WebLocalFrame* childFrame = remoteParentFrame->createLocalChild(WebTreeScopeType::Document, "", WebSandboxFlags::None, &childFrameClient, nullptr, WebFrameOwnerProperties()); |
+ WebLocalFrame* childFrame = remoteParentFrame->createLocalChild(WebTreeScopeType::Document, "name", "uniqueName", WebSandboxFlags::None, &childFrameClient, nullptr, WebFrameOwnerProperties()); |
FrameTestHelpers::loadFrame(childFrame, m_baseURL + "subframe-hello.html"); |
v8::Local<v8::Value> window = childFrame->executeScriptAndReturnValue(WebScriptSource("window")); |
@@ -7360,7 +7360,7 @@ TEST_F(WebFrameSwapTest, FrameElementInFramesWithRemoteParent) |
remoteParentFrame->setReplicatedOrigin(SecurityOrigin::createUnique()); |
FrameTestHelpers::TestWebFrameClient childFrameClient; |
- WebLocalFrame* childFrame = remoteParentFrame->createLocalChild(WebTreeScopeType::Document, "", WebSandboxFlags::None, &childFrameClient, nullptr, WebFrameOwnerProperties()); |
+ WebLocalFrame* childFrame = remoteParentFrame->createLocalChild(WebTreeScopeType::Document, "name", "uniqueName", WebSandboxFlags::None, &childFrameClient, nullptr, WebFrameOwnerProperties()); |
FrameTestHelpers::loadFrame(childFrame, m_baseURL + "subframe-hello.html"); |
v8::Local<v8::Value> frameElement = childFrame->executeScriptAndReturnValue(WebScriptSource("window.frameElement")); |
@@ -7677,7 +7677,7 @@ TEST_P(ParameterizedWebFrameTest, RemoteFrameInitialCommitType) |
// 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, WebFrameOwnerProperties()); |
+ WebLocalFrame* childFrame = view->mainFrame()->toWebRemoteFrame()->createLocalChild(WebTreeScopeType::Document, "name", "uniqueName", WebSandboxFlags::None, &childFrameClient, nullptr, WebFrameOwnerProperties()); |
registerMockedHttpURLLoad("foo.html"); |
FrameTestHelpers::loadFrame(childFrame, m_baseURL + "foo.html"); |
EXPECT_EQ(WebInitialCommitInChildFrame, childFrameClient.historyCommitType()); |
@@ -7703,7 +7703,7 @@ TEST_P(ParameterizedWebFrameTest, FrameWidgetTest) |
view->setMainFrame(remoteClient.frame()); |
FrameTestHelpers::TestWebFrameClient childFrameClient; |
- WebLocalFrame* childFrame = view->mainFrame()->toWebRemoteFrame()->createLocalChild(WebTreeScopeType::Document, "", WebSandboxFlags::None, &childFrameClient, nullptr, WebFrameOwnerProperties()); |
+ WebLocalFrame* childFrame = view->mainFrame()->toWebRemoteFrame()->createLocalChild(WebTreeScopeType::Document, "name", "uniqueName", WebSandboxFlags::None, &childFrameClient, nullptr, WebFrameOwnerProperties()); |
GestureEventTestWebViewClient childViewClient; |
WebFrameWidget* widget = WebFrameWidget::create(&childViewClient, childFrame); |
@@ -7769,7 +7769,7 @@ TEST_P(ParameterizedWebFrameTest, DetachRemoteFrame) |
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(WebTreeScopeType::Document, "", "uniqueName1", WebSandboxFlags::None, &childFrameClient); |
childFrame->detach(); |
view->close(); |
childFrame->close(); |
@@ -7922,10 +7922,10 @@ TEST_P(ParameterizedWebFrameTest, CreateLocalChildWithPreviousSibling) |
view->setMainFrame(remoteClient.frame()); |
WebRemoteFrame* parent = view->mainFrame()->toWebRemoteFrame(); |
- WebLocalFrameScope secondFrame(parent->createLocalChild(WebTreeScopeType::Document, "", WebSandboxFlags::None, nullptr, nullptr, WebFrameOwnerProperties())); |
- WebLocalFrameScope fourthFrame(parent->createLocalChild(WebTreeScopeType::Document, "", WebSandboxFlags::None, nullptr, secondFrame, WebFrameOwnerProperties())); |
- WebLocalFrameScope thirdFrame(parent->createLocalChild(WebTreeScopeType::Document, "", WebSandboxFlags::None, nullptr, secondFrame, WebFrameOwnerProperties())); |
- WebLocalFrameScope firstFrame(parent->createLocalChild(WebTreeScopeType::Document, "", WebSandboxFlags::None, nullptr, nullptr, WebFrameOwnerProperties())); |
+ WebLocalFrameScope secondFrame(parent->createLocalChild(WebTreeScopeType::Document, "name2", "uniqueName2", WebSandboxFlags::None, nullptr, nullptr, WebFrameOwnerProperties())); |
+ WebLocalFrameScope fourthFrame(parent->createLocalChild(WebTreeScopeType::Document, "name4", "uniqueName4", WebSandboxFlags::None, nullptr, secondFrame, WebFrameOwnerProperties())); |
+ WebLocalFrameScope thirdFrame(parent->createLocalChild(WebTreeScopeType::Document, "name3", "uniqueName3", WebSandboxFlags::None, nullptr, secondFrame, WebFrameOwnerProperties())); |
+ WebLocalFrameScope firstFrame(parent->createLocalChild(WebTreeScopeType::Document, "name1", "uniqueName1", WebSandboxFlags::None, nullptr, nullptr, WebFrameOwnerProperties())); |
EXPECT_EQ(firstFrame, parent->firstChild()); |
EXPECT_EQ(nullptr, firstFrame->previousSibling()); |
@@ -7960,7 +7960,7 @@ TEST_P(ParameterizedWebFrameTest, SendBeaconFromChildWithRemoteMainFrame) |
root->setReplicatedOrigin(SecurityOrigin::createUnique()); |
FrameTestHelpers::TestWebFrameClient localFrameClient; |
- WebLocalFrame* localFrame = root->createLocalChild(WebTreeScopeType::Document, "", WebSandboxFlags::None, &localFrameClient, nullptr, WebFrameOwnerProperties()); |
+ WebLocalFrame* localFrame = root->createLocalChild(WebTreeScopeType::Document, "name", "uniqueName", WebSandboxFlags::None, &localFrameClient, nullptr, WebFrameOwnerProperties()); |
// Finally, make sure an embedder triggered load in the local frame swapped |
// back in works. |
@@ -7982,7 +7982,7 @@ TEST_P(ParameterizedWebFrameTest, RemoteToLocalSwapOnMainFrameInitializesCoreFra |
remoteRoot->setReplicatedOrigin(SecurityOrigin::createUnique()); |
FrameTestHelpers::TestWebFrameClient localFrameClient; |
- remoteRoot->createLocalChild(WebTreeScopeType::Document, "", WebSandboxFlags::None, &localFrameClient, nullptr, WebFrameOwnerProperties()); |
+ remoteRoot->createLocalChild(WebTreeScopeType::Document, "name", "uniqueName", WebSandboxFlags::None, &localFrameClient, nullptr, WebFrameOwnerProperties()); |
// Do a remote-to-local swap of the top frame. |
FrameTestHelpers::TestWebFrameClient localClient; |