| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "core/layout/LayoutTestHelper.h" | 5 #include "core/layout/LayoutTestHelper.h" |
| 6 | 6 |
| 7 #include "core/fetch/MemoryCache.h" | 7 #include "core/fetch/MemoryCache.h" |
| 8 #include "core/frame/FrameHost.h" | 8 #include "core/frame/FrameHost.h" |
| 9 #include "core/html/HTMLIFrameElement.h" | 9 #include "core/html/HTMLIFrameElement.h" |
| 10 #include "platform/scroll/ScrollbarTheme.h" | 10 #include "platform/scroll/ScrollbarTheme.h" |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 Document& RenderingTest::setupChildIframe(const AtomicString& iframeElementId, | 54 Document& RenderingTest::setupChildIframe(const AtomicString& iframeElementId, |
| 55 const String& htmlContentOfIframe) { | 55 const String& htmlContentOfIframe) { |
| 56 // TODO(pdr): This should be refactored to share code with the actual setup | 56 // TODO(pdr): This should be refactored to share code with the actual setup |
| 57 // instead of partially duplicating it here (e.g., LocalFrame::createView). | 57 // instead of partially duplicating it here (e.g., LocalFrame::createView). |
| 58 HTMLIFrameElement& iframe = | 58 HTMLIFrameElement& iframe = |
| 59 *toHTMLIFrameElement(document().getElementById(iframeElementId)); | 59 *toHTMLIFrameElement(document().getElementById(iframeElementId)); |
| 60 m_childFrameLoaderClient = | 60 m_childFrameLoaderClient = |
| 61 FrameLoaderClientWithParent::create(document().frame()); | 61 FrameLoaderClientWithParent::create(document().frame()); |
| 62 m_subframe = LocalFrame::create(m_childFrameLoaderClient.get(), | 62 m_subframe = LocalFrame::create(m_childFrameLoaderClient.get(), |
| 63 document().frame()->host(), &iframe); | 63 document().frame()->host(), &iframe); |
| 64 m_subframe->setView(FrameView::create(m_subframe.get(), IntSize(500, 500))); | 64 m_subframe->setView(FrameView::create(*m_subframe, IntSize(500, 500))); |
| 65 m_subframe->init(); | 65 m_subframe->init(); |
| 66 m_subframe->view()->setParentVisible(true); | 66 m_subframe->view()->setParentVisible(true); |
| 67 m_subframe->view()->setSelfVisible(true); | 67 m_subframe->view()->setSelfVisible(true); |
| 68 iframe.setWidget(m_subframe->view()); | 68 iframe.setWidget(m_subframe->view()); |
| 69 static_cast<SingleChildFrameLoaderClient*>(document().frame()->client()) | 69 static_cast<SingleChildFrameLoaderClient*>(document().frame()->client()) |
| 70 ->setChild(m_subframe.get()); | 70 ->setChild(m_subframe.get()); |
| 71 document().frame()->host()->incrementSubframeCount(); | 71 document().frame()->host()->incrementSubframeCount(); |
| 72 Document& frameDocument = *iframe.contentDocument(); | 72 Document& frameDocument = *iframe.contentDocument(); |
| 73 | 73 |
| 74 frameDocument.setBaseURLOverride(KURL(ParsedURLString, "http://test.com")); | 74 frameDocument.setBaseURLOverride(KURL(ParsedURLString, "http://test.com")); |
| 75 frameDocument.body()->setInnerHTML(htmlContentOfIframe, ASSERT_NO_EXCEPTION); | 75 frameDocument.body()->setInnerHTML(htmlContentOfIframe, ASSERT_NO_EXCEPTION); |
| 76 return frameDocument; | 76 return frameDocument; |
| 77 } | 77 } |
| 78 | 78 |
| 79 } // namespace blink | 79 } // namespace blink |
| OLD | NEW |