 Chromium Code Reviews
 Chromium Code Reviews Issue 1635873003:
  Replicating WebFrame::uniqueName across renderers.  (Closed) 
  Base URL: https://chromium.googlesource.com/chromium/src.git@dump-render-tree3
    
  
    Issue 1635873003:
  Replicating WebFrame::uniqueName across renderers.  (Closed) 
  Base URL: https://chromium.googlesource.com/chromium/src.git@dump-render-tree3| Index: third_party/WebKit/Source/web/tests/FrameTestHelpers.cpp | 
| diff --git a/third_party/WebKit/Source/web/tests/FrameTestHelpers.cpp b/third_party/WebKit/Source/web/tests/FrameTestHelpers.cpp | 
| index ead7d8151ea912b65c58c451629ae66b93422016..b77e30894ae1ca32a6e75b9e491ee04a171a00b5 100644 | 
| --- a/third_party/WebKit/Source/web/tests/FrameTestHelpers.cpp | 
| +++ b/third_party/WebKit/Source/web/tests/FrameTestHelpers.cpp | 
| @@ -40,11 +40,13 @@ | 
| #include "public/platform/WebURLResponse.h" | 
| #include "public/platform/WebUnitTestSupport.h" | 
| #include "public/web/WebFrameWidget.h" | 
| +#include "public/web/WebRemoteFrame.h" | 
| #include "public/web/WebSettings.h" | 
| #include "public/web/WebTreeScopeType.h" | 
| #include "public/web/WebViewClient.h" | 
| #include "web/WebLocalFrameImpl.h" | 
| #include "web/WebRemoteFrameImpl.h" | 
| +#include "wtf/Assertions.h" | 
| #include "wtf/StdLibExtras.h" | 
| namespace blink { | 
| @@ -229,6 +231,20 @@ void pumpPendingRequestsDoNotUse(WebFrame* frame) | 
| pumpPendingRequests(frame); | 
| } | 
| +WebLocalFrame* createLocalChild(WebRemoteFrame* parent, const WebString& name, WebFrameClient* client, WebFrame* previousSibling, const WebFrameOwnerProperties& properties) | 
| +{ | 
| + if (!client) | 
| + client = defaultWebFrameClient(); | 
| + | 
| + // |uniqueName| is normally calculated in a somewhat complicated way by | 
| 
dcheng
2016/02/19 21:36:27
I think we should make a nominal effort at uniquen
 
dcheng
2016/02/19 21:37:02
Also: nit
Change "way by" to "way by the"
 
Łukasz Anforowicz
2016/02/19 22:10:09
Done.
 
Łukasz Anforowicz
2016/02/19 22:10:09
Done.
 | 
| + // FrameTree class, but for test purposes the approximation below should be | 
| + // close enough. | 
| + ASSERT(!name.isEmpty()); | 
| + WebString uniqueName = name; | 
| + | 
| + return parent->createLocalChild(WebTreeScopeType::Document, name, uniqueName, WebSandboxFlags::None, client, previousSibling, properties); | 
| +} | 
| + | 
| WebViewHelper::WebViewHelper(SettingOverrider* settingOverrider) | 
| : m_webView(nullptr) | 
| , m_webViewWidget(nullptr) | 
| @@ -312,7 +328,7 @@ TestWebFrameClient::TestWebFrameClient() : m_loadsInProgress(0) | 
| { | 
| } | 
| -WebFrame* TestWebFrameClient::createChildFrame(WebLocalFrame* parent, WebTreeScopeType scope, const WebString& frameName, WebSandboxFlags sandboxFlags, const WebFrameOwnerProperties& frameOwnerProperties) | 
| +WebFrame* TestWebFrameClient::createChildFrame(WebLocalFrame* parent, WebTreeScopeType scope, const WebString& name, const WebString& uniqueName, WebSandboxFlags sandboxFlags, const WebFrameOwnerProperties& frameOwnerProperties) | 
| { | 
| WebFrame* frame = WebLocalFrame::create(scope, this); | 
| parent->appendChild(frame); |