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

Unified Diff: content/shell/renderer/layout_test/blink_test_runner.cc

Issue 1936853002: Assert event timestamp to be monotonic and not from future Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Change to histogram Created 4 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
Index: content/shell/renderer/layout_test/blink_test_runner.cc
diff --git a/content/shell/renderer/layout_test/blink_test_runner.cc b/content/shell/renderer/layout_test/blink_test_runner.cc
index 8cec34121dc3361bb05606c094d5da622c79c334..d7d8a430ffde358ca9831c5c1fed393beb5b5f40 100644
--- a/content/shell/renderer/layout_test/blink_test_runner.cc
+++ b/content/shell/renderer/layout_test/blink_test_runner.cc
@@ -721,6 +721,19 @@ void BlinkTestRunner::RunIdleTasks(const base::Closure& callback) {
SchedulerRunIdleTasks(callback);
}
+base::Callback<double()> BlinkTestRunner::time_function_;
+
+void BlinkTestRunner::SetMockMonotonicTimeFunction(
+ const base::Callback<double()>& time_function) const {
+ time_function_ = time_function;
+ // TODO(majidvp): Perhaps we need a generic utility to convert a
+ // base::Callback to a WTF::Function similar to WebFunction but in reverse
+ // direction.
+ WebTestingSupport::setMonotonicallyIncreasingTimeFunctionForTesting(
+ time_function_.is_null() ? nullptr : returnMockTime);
+
+}
+
bool BlinkTestRunner::AddMediaStreamVideoSourceAndTrack(
blink::WebMediaStream* stream) {
DCHECK(stream);
« no previous file with comments | « content/shell/renderer/layout_test/blink_test_runner.h ('k') | third_party/WebKit/Source/core/events/Event.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698