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

Unified Diff: third_party/WebKit/Source/web/tests/VirtualTimeTest.cpp

Issue 2377243003: Make VirtualTimeTest fast (Closed)
Patch Set: Created 4 years, 3 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/web/tests/VirtualTimeTest.cpp
diff --git a/third_party/WebKit/Source/web/tests/VirtualTimeTest.cpp b/third_party/WebKit/Source/web/tests/VirtualTimeTest.cpp
index 76c8855b10b238826bd308fd7b167bd109946ede..a1c4451ff3de88994f9599bf992777454606ca3b 100644
--- a/third_party/WebKit/Source/web/tests/VirtualTimeTest.cpp
+++ b/third_party/WebKit/Source/web/tests/VirtualTimeTest.cpp
@@ -41,6 +41,14 @@ protected:
WebScriptSource(WebString(scriptSource)), false, &callbackHelper);
return callbackHelper.result();
}
+
+ void TearDown() override
+ {
+ // The SimTest destructor calls runPendingTasks. This is a problem because if there are
+ // any repeating tasks, advancing virtual time will cause the runloop to busy loop. Pausing
+ // virtual time here fixes that.
+ webView().scheduler()->setVirtualTimePolicy(WebViewScheduler::VirtualTimePolicy::PAUSE);
+ }
};
namespace {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698