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

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

Issue 1397713004: Don't bother layout until first navigation is done. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: another attempt to fix tests 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 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 3d2e288b0b278ceca3aa95c41f5f5f6b7f17969f..a6f6466c9062084f9b9a7ff2641e96aa99733420 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/frame/FrameHost.h"
#include "core/html/HTMLIFrameElement.h"
+#include "core/loader/FrameLoaderStateMachine.h"
#include "platform/graphics/test/FakeGraphicsLayerFactory.h"
#include "platform/scroll/ScrollbarTheme.h"
@@ -61,12 +62,14 @@ void RenderingTest::TearDown()
Document& RenderingTest::setupChildIframe(const AtomicString& iframeElementId, const String& htmlContentOfIframe)
{
-
HTMLIFrameElement& iframe = *toHTMLIFrameElement(document().getElementById(iframeElementId));
m_childFrameLoaderClient = FrameLoaderClientWithParent::create(document().frame());
m_subframe = LocalFrame::create(m_childFrameLoaderClient.get(), document().frame()->host(), &iframe);
m_subframe->setView(FrameView::create(m_subframe.get(), IntSize(500, 500)));
m_subframe->init();
+ // Some tests directly inject content into the initial empty document.
+ // Unmark it so that unforced layout would also run on the document.
+ m_subframe->loader().stateMachine()->advanceTo(FrameLoaderStateMachine::CommittedFirstRealLoad);
m_subframe->view()->setParentVisible(true);
m_subframe->view()->setSelfVisible(true);
static_cast<SingleChildFrameLoaderClient*>(document().frame()->client())->setChild(m_subframe.get());
« no previous file with comments | « third_party/WebKit/Source/core/dom/StyleEngine.cpp ('k') | third_party/WebKit/Source/core/testing/DummyPageHolder.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698