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 #ifndef LayoutTestHelper_h | 5 #ifndef LayoutTestHelper_h |
6 #define LayoutTestHelper_h | 6 #define LayoutTestHelper_h |
7 | 7 |
8 #include "core/dom/Document.h" | 8 #include "core/dom/Document.h" |
9 #include "core/frame/FrameHost.h" | 9 #include "core/frame/FrameHost.h" |
10 #include "core/frame/FrameView.h" | 10 #include "core/frame/FrameView.h" |
(...skipping 20 matching lines...) Expand all Loading... |
31 | 31 |
32 Document& document() const { return m_pageHolder->document(); } | 32 Document& document() const { return m_pageHolder->document(); } |
33 | 33 |
34 // Both sets the inner html and runs the document lifecycle. | 34 // Both sets the inner html and runs the document lifecycle. |
35 void setBodyInnerHTML(const String& htmlContent) | 35 void setBodyInnerHTML(const String& htmlContent) |
36 { | 36 { |
37 document().body()->setInnerHTML(htmlContent, ASSERT_NO_EXCEPTION); | 37 document().body()->setInnerHTML(htmlContent, ASSERT_NO_EXCEPTION); |
38 document().view()->updateAllLifecyclePhases(); | 38 document().view()->updateAllLifecyclePhases(); |
39 } | 39 } |
40 | 40 |
41 // Returns the Document for the iframe. | |
42 Document& setupChildIframe(const AtomicString& iframeElementId, const String
& htmlContentOfIframe); | |
43 | |
44 // Both enables compositing and runs the document lifecycle. | 41 // Both enables compositing and runs the document lifecycle. |
45 void enableCompositing() | 42 void enableCompositing() |
46 { | 43 { |
47 m_pageHolder->page().settings().setAcceleratedCompositingEnabled(true); | 44 m_pageHolder->page().settings().setAcceleratedCompositingEnabled(true); |
48 document().view()->updateAllLifecyclePhases(); | 45 document().view()->updateAllLifecyclePhases(); |
49 } | 46 } |
50 | 47 |
51 private: | 48 private: |
52 RefPtrWillBePersistent<LocalFrame> m_subframe; | |
53 OwnPtrWillBePersistent<FrameLoaderClient> m_frameLoaderClient; | |
54 OwnPtr<DummyPageHolder> m_pageHolder; | 49 OwnPtr<DummyPageHolder> m_pageHolder; |
55 }; | 50 }; |
56 | 51 |
57 class SingleChildFrameLoaderClient final : public EmptyFrameLoaderClient { | 52 class SingleChildFrameLoaderClient final : public EmptyFrameLoaderClient { |
58 public: | 53 public: |
59 static PassOwnPtrWillBeRawPtr<SingleChildFrameLoaderClient> create() { retur
n adoptPtrWillBeNoop(new SingleChildFrameLoaderClient); } | 54 static PassOwnPtrWillBeRawPtr<SingleChildFrameLoaderClient> create() { retur
n adoptPtrWillBeNoop(new SingleChildFrameLoaderClient); } |
60 | 55 |
61 DEFINE_INLINE_VIRTUAL_TRACE() | 56 DEFINE_INLINE_VIRTUAL_TRACE() |
62 { | 57 { |
63 visitor->trace(m_child); | 58 visitor->trace(m_child); |
(...skipping 28 matching lines...) Expand all Loading... |
92 | 87 |
93 private: | 88 private: |
94 explicit FrameLoaderClientWithParent(Frame* parent) : m_parent(parent) { } | 89 explicit FrameLoaderClientWithParent(Frame* parent) : m_parent(parent) { } |
95 | 90 |
96 RefPtrWillBeMember<Frame> m_parent; | 91 RefPtrWillBeMember<Frame> m_parent; |
97 }; | 92 }; |
98 | 93 |
99 } // namespace blink | 94 } // namespace blink |
100 | 95 |
101 #endif // LayoutTestHelper_h | 96 #endif // LayoutTestHelper_h |
OLD | NEW |