| Index: third_party/WebKit/Source/core/testing/Internals.cpp
|
| diff --git a/third_party/WebKit/Source/core/testing/Internals.cpp b/third_party/WebKit/Source/core/testing/Internals.cpp
|
| index dc9440c2e30d3484e279a8c4a977016f5c3e3e2e..543d24b5f493fc9a49a9df54000e642c36bca0df 100644
|
| --- a/third_party/WebKit/Source/core/testing/Internals.cpp
|
| +++ b/third_party/WebKit/Source/core/testing/Internals.cpp
|
| @@ -897,8 +897,15 @@ void Internals::setFormControlStateOfHistoryItem(
|
| DOMWindow* Internals::pagePopupWindow() const {
|
| if (!m_document)
|
| return nullptr;
|
| - if (Page* page = m_document->page())
|
| - return page->chromeClient().pagePopupWindowForTesting();
|
| + if (Page* page = m_document->page()) {
|
| + LocalDOMWindow* popup =
|
| + toLocalDOMWindow(page->chromeClient().pagePopupWindowForTesting());
|
| + if (popup) {
|
| + // We need to make the popup same origin so layout tests can access it.
|
| + popup->document()->setSecurityOrigin(m_document->getSecurityOrigin());
|
| + }
|
| + return popup;
|
| + }
|
| return nullptr;
|
| }
|
|
|
|
|