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/frame/FrameHost.h" | 7 #include "core/frame/FrameHost.h" |
8 #include "core/html/HTMLIFrameElement.h" | 8 #include "core/html/HTMLIFrameElement.h" |
9 #include "platform/scroll/ScrollbarTheme.h" | 9 #include "platform/scroll/ScrollbarTheme.h" |
10 | 10 |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 // getting invoked, breaking the assumption that REF can't change during Bli
nk lifetime. | 43 // getting invoked, breaking the assumption that REF can't change during Bli
nk lifetime. |
44 m_pageHolder = nullptr; | 44 m_pageHolder = nullptr; |
45 } | 45 } |
46 | 46 |
47 Document& RenderingTest::setupChildIframe(const AtomicString& iframeElementId, c
onst String& htmlContentOfIframe) | 47 Document& RenderingTest::setupChildIframe(const AtomicString& iframeElementId, c
onst String& htmlContentOfIframe) |
48 { | 48 { |
49 // TODO(pdr): This should be refactored to share code with the actual setup | 49 // TODO(pdr): This should be refactored to share code with the actual setup |
50 // instead of partially duplicating it here (e.g., LocalFrame::createView). | 50 // instead of partially duplicating it here (e.g., LocalFrame::createView). |
51 HTMLIFrameElement& iframe = *toHTMLIFrameElement(document().getElementById(i
frameElementId)); | 51 HTMLIFrameElement& iframe = *toHTMLIFrameElement(document().getElementById(i
frameElementId)); |
52 m_childFrameLoaderClient = FrameLoaderClientWithParent::create(document().fr
ame()); | 52 m_childFrameLoaderClient = FrameLoaderClientWithParent::create(document().fr
ame()); |
53 m_subframe = LocalFrame::create(m_childFrameLoaderClient.get(), document().f
rame()->host(), &iframe); | 53 m_subframe = LocalFrame::create(m_childFrameLoaderClient.get(), document().f
rame()->host(), &iframe, nullptr); |
54 m_subframe->setView(FrameView::create(m_subframe.get(), IntSize(500, 500))); | 54 m_subframe->setView(FrameView::create(m_subframe.get(), IntSize(500, 500))); |
55 m_subframe->init(); | 55 m_subframe->init(); |
56 m_subframe->view()->setParentVisible(true); | 56 m_subframe->view()->setParentVisible(true); |
57 m_subframe->view()->setSelfVisible(true); | 57 m_subframe->view()->setSelfVisible(true); |
58 iframe.setWidget(m_subframe->view()); | 58 iframe.setWidget(m_subframe->view()); |
59 static_cast<SingleChildFrameLoaderClient*>(document().frame()->client())->se
tChild(m_subframe.get()); | 59 static_cast<SingleChildFrameLoaderClient*>(document().frame()->client())->se
tChild(m_subframe.get()); |
60 document().frame()->host()->incrementSubframeCount(); | 60 document().frame()->host()->incrementSubframeCount(); |
61 Document& frameDocument = *iframe.contentDocument(); | 61 Document& frameDocument = *iframe.contentDocument(); |
62 | 62 |
63 frameDocument.setBaseURLOverride(KURL(ParsedURLString, "http://test.com")); | 63 frameDocument.setBaseURLOverride(KURL(ParsedURLString, "http://test.com")); |
64 frameDocument.body()->setInnerHTML(htmlContentOfIframe, ASSERT_NO_EXCEPTION)
; | 64 frameDocument.body()->setInnerHTML(htmlContentOfIframe, ASSERT_NO_EXCEPTION)
; |
65 return frameDocument; | 65 return frameDocument; |
66 } | 66 } |
67 | 67 |
68 } // namespace blink | 68 } // namespace blink |
OLD | NEW |