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

Unified Diff: Source/web/tests/FrameTestHelpers.cpp

Issue 644573002: Disable async main thread HTML parsing (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: WebFrameTest should wait for background thread tasks Created 6 years, 2 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
« no previous file with comments | « Source/web/tests/FrameTestHelpers.h ('k') | Source/web/tests/WebFrameTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/web/tests/FrameTestHelpers.cpp
diff --git a/Source/web/tests/FrameTestHelpers.cpp b/Source/web/tests/FrameTestHelpers.cpp
index bd3c18ded9823cf28e966c3d9bd623696c475454..2109c7d7f3561d9c5cc46658631930434e0fa90a 100644
--- a/Source/web/tests/FrameTestHelpers.cpp
+++ b/Source/web/tests/FrameTestHelpers.cpp
@@ -329,6 +329,21 @@ void TestWebFrameClient::didStopLoading()
--m_loadsInProgress;
}
+void TestWebFrameClient::waitForLoadToComplete()
+{
+ for (;;) {
+ // We call runPendingTasks multiple times as single call of
+ // runPendingTasks may not be enough.
+ // runPendingTasks only ensures that main thread task queue is empty,
+ // and asynchronous parsing make use of off main thread HTML parser.
+ FrameTestHelpers::runPendingTasks();
+ if (!isLoading())
+ break;
+
+ Platform::current()->yieldCurrentThread();
+ }
+}
+
void TestWebViewClient::initializeLayerTreeView()
{
m_layerTreeView = adoptPtr(Platform::current()->unitTestSupport()->createLayerTreeViewForTesting());
« no previous file with comments | « Source/web/tests/FrameTestHelpers.h ('k') | Source/web/tests/WebFrameTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698