Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(335)

Side by Side Diff: third_party/WebKit/Source/core/layout/LayoutTestHelper.h

Issue 1662483002: Introduce RenderingTest::getLayoutObjectByElementId(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 43
44 // Both enables compositing and runs the document lifecycle. 44 // Both enables compositing and runs the document lifecycle.
45 void enableCompositing() 45 void enableCompositing()
46 { 46 {
47 m_pageHolder->page().settings().setAcceleratedCompositingEnabled(true); 47 m_pageHolder->page().settings().setAcceleratedCompositingEnabled(true);
48 document().view()->setParentVisible(true); 48 document().view()->setParentVisible(true);
49 document().view()->setSelfVisible(true); 49 document().view()->setSelfVisible(true);
50 document().view()->updateAllLifecyclePhases(); 50 document().view()->updateAllLifecyclePhases();
51 } 51 }
52 52
53 LayoutObject* getLayoutObjectByElementId(const char* id) const
54 {
55 Node* node = document().getElementById(id);
56 return node ? node->layoutObject() : nullptr;
57 }
58
53 private: 59 private:
54 RefPtrWillBePersistent<LocalFrame> m_subframe; 60 RefPtrWillBePersistent<LocalFrame> m_subframe;
55 OwnPtrWillBePersistent<FrameLoaderClient> m_frameLoaderClient; 61 OwnPtrWillBePersistent<FrameLoaderClient> m_frameLoaderClient;
56 OwnPtr<DummyPageHolder> m_pageHolder; 62 OwnPtr<DummyPageHolder> m_pageHolder;
57 }; 63 };
58 64
59 class SingleChildFrameLoaderClient final : public EmptyFrameLoaderClient { 65 class SingleChildFrameLoaderClient final : public EmptyFrameLoaderClient {
60 public: 66 public:
61 static PassOwnPtrWillBeRawPtr<SingleChildFrameLoaderClient> create() { retur n adoptPtrWillBeNoop(new SingleChildFrameLoaderClient); } 67 static PassOwnPtrWillBeRawPtr<SingleChildFrameLoaderClient> create() { retur n adoptPtrWillBeNoop(new SingleChildFrameLoaderClient); }
62 68
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 100
95 private: 101 private:
96 explicit FrameLoaderClientWithParent(Frame* parent) : m_parent(parent) { } 102 explicit FrameLoaderClientWithParent(Frame* parent) : m_parent(parent) { }
97 103
98 RefPtrWillBeMember<Frame> m_parent; 104 RefPtrWillBeMember<Frame> m_parent;
99 }; 105 };
100 106
101 } // namespace blink 107 } // namespace blink
102 108
103 #endif // LayoutTestHelper_h 109 #endif // LayoutTestHelper_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutObjectTest.cpp ('k') | third_party/WebKit/Source/core/layout/PaginationTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698