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

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

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
« no previous file with comments | « components/test_runner/web_test_delegate.h ('k') | content/shell/renderer/layout_test/blink_test_runner.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/shell/renderer/layout_test/blink_test_runner.h
diff --git a/content/shell/renderer/layout_test/blink_test_runner.h b/content/shell/renderer/layout_test/blink_test_runner.h
index 5756f6bb85d36cfd327cc626d4a694ec22741281..7ee31ccc0b9fb0d7d129f866e8ca7128388c1508 100644
--- a/content/shell/renderer/layout_test/blink_test_runner.h
+++ b/content/shell/renderer/layout_test/blink_test_runner.h
@@ -155,6 +155,9 @@ class BlinkTestRunner : public RenderViewObserver,
float GetDeviceScaleFactor() const override;
void RunIdleTasks(const base::Closure& callback) override;
+ void SetMockMonotonicTimeFunction(
+ const base::Callback<double()>& time_function) const override;
+
// Resets a RenderView to a known state for layout tests. It is used both when
// a RenderView is created and when reusing an existing RenderView for the
// next test case.
@@ -214,6 +217,12 @@ class BlinkTestRunner : public RenderViewObserver,
std::unique_ptr<LeakDetector> leak_detector_;
+ static base::Callback<double()> time_function_;
+ static double returnMockTime() {
+ DCHECK(!time_function_.is_null());
+ return time_function_.Run();
+ }
+
DISALLOW_COPY_AND_ASSIGN(BlinkTestRunner);
};
« no previous file with comments | « components/test_runner/web_test_delegate.h ('k') | content/shell/renderer/layout_test/blink_test_runner.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698