| 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());
|
|
|