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

Unified Diff: third_party/WebKit/Source/platform/testing/UnitTestHelpers.cpp

Issue 1774123006: Implement link selection on alt+mouse drag. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address comments. Created 4 years, 9 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/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..36f6123b3b247bff4921fbc551fef7fe91781b9f 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 seconds)
+{
+ // Pending tasks include Timers that have been scheduled.
+ Timer<QuitTask> quitOnTimeout(new QuitTask, &QuitTask::timerFired);
+ quitOnTimeout.startOneShot(seconds, BLINK_FROM_HERE);
+ testing::enterRunLoop();
+}
+
String blinkRootDir()
{
base::FilePath path;

Powered by Google App Engine
This is Rietveld 408576698