| Index: third_party/WebKit/Source/platform/testing/UnitTestHelpers.cpp
|
| diff --git a/third_party/WebKit/Source/platform/testing/UnitTestHelpers.cpp b/third_party/WebKit/Source/platform/testing/UnitTestHelpers.cpp
|
| index 814a7f7150012d4cd85c2493031e8d990bbe3768..dee7b3dd5ef68e134764e86a8bacd6edc59b6c8a 100644
|
| --- a/third_party/WebKit/Source/platform/testing/UnitTestHelpers.cpp
|
| +++ b/third_party/WebKit/Source/platform/testing/UnitTestHelpers.cpp
|
| @@ -30,6 +30,7 @@
|
| #include "base/message_loop/message_loop.h"
|
| #include "base/path_service.h"
|
| #include "platform/SharedBuffer.h"
|
| +#include "platform/Timer.h"
|
| #include "public/platform/FilePathConversion.h"
|
| #include "public/platform/Platform.h"
|
| #include "public/platform/WebString.h"
|
| @@ -48,6 +49,22 @@ void runPendingTasks()
|
| enterRunLoop();
|
| }
|
|
|
| +struct QuitTask {
|
| + void timerFired(Timer<QuitTask>*)
|
| + {
|
| + // We cannot just exit loop here, because we may be halfway through the task queue.
|
| + Platform::current()->currentThread()->getWebTaskRunner()->postTask(BLINK_FROM_HERE, bind(&exitRunLoop));
|
| + }
|
| +};
|
| +
|
| +void waitForDeferredTasks(double interval)
|
| +{
|
| + // Pending tasks include Timers that have been scheduled.
|
| + Timer<QuitTask> quitOnTimeout(new QuitTask, &QuitTask::timerFired);
|
| + quitOnTimeout.startOneShot(interval, BLINK_FROM_HERE);
|
| + testing::enterRunLoop();
|
| +}
|
| +
|
| String blinkRootDir()
|
| {
|
| base::FilePath path;
|
|
|