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

Unified Diff: third_party/WebKit/Source/core/layout/LayoutTestHelper.cpp

Issue 1516893002: Second reland: Fix incorrect sign in scroll and content box offset in absoluteToLocalPoint. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/layout/LayoutTestHelper.cpp
diff --git a/third_party/WebKit/Source/core/layout/LayoutTestHelper.cpp b/third_party/WebKit/Source/core/layout/LayoutTestHelper.cpp
index 97db2f3d0bc8a9771207f64b7cbb26930ec7c85a..518e7dfc25de5887994ca1bc330eb01c31db951f 100644
--- a/third_party/WebKit/Source/core/layout/LayoutTestHelper.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutTestHelper.cpp
@@ -6,6 +6,7 @@
#include "core/layout/LayoutTestHelper.h"
#include "core/frame/FrameHost.h"
+#include "core/html/HTMLIFrameElement.h"
#include "platform/graphics/test/FakeGraphicsLayerFactory.h"
namespace blink {
@@ -42,10 +43,33 @@ void RenderingTest::SetUp()
void RenderingTest::TearDown()
{
+ if (m_subframe) {
+ m_subframe->detach(FrameDetachType::Remove);
+ static_cast<SingleChildFrameLoaderClient*>(document().frame()->client())->setChild(nullptr);
+ document().frame()->host()->decrementSubframeCount();
+ }
+
// We need to destroy most of the Blink structure here because derived tests may restore
// RuntimeEnabledFeatures setting during teardown, which happens before our destructor
// getting invoked, breaking the assumption that REF can't change during Blink lifetime.
m_pageHolder = nullptr;
}
+Document& RenderingTest::setupChildIframe(const AtomicString& iframeElementId, const String& htmlContentOfIframe)
+{
+
+ HTMLIFrameElement& iframe = *toHTMLIFrameElement(document().getElementById(iframeElementId));
+ m_frameLoaderClient = FrameLoaderClientWithParent::create(document().frame());
+ m_subframe = LocalFrame::create(m_frameLoaderClient.get(), document().frame()->host(), &iframe);
+ m_subframe->setView(FrameView::create(m_subframe.get(), IntSize(500, 500)));
+ m_subframe->init();
+ static_cast<SingleChildFrameLoaderClient*>(document().frame()->client())->setChild(m_subframe.get());
+ document().frame()->host()->incrementSubframeCount();
+ Document& frameDocument = *iframe.contentDocument();
+
+ frameDocument.setBaseURLOverride(KURL(ParsedURLString, "http://test.com"));
+ frameDocument.body()->setInnerHTML(htmlContentOfIframe, ASSERT_NO_EXCEPTION);
+ return frameDocument;
+}
+
} // namespace blink
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutTestHelper.h ('k') | third_party/WebKit/Source/core/layout/LayoutView.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698