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

Unified Diff: ui/events/test/event_generator.cc

Issue 2007083002: Validate that ui::Event::time_stamp comes from the same clock as TimeTicks::Now (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@453559-use-timeticks-ui-event
Patch Set: Address feedback Created 4 years, 6 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 | « ui/events/event_utils.cc ('k') | ui/events/win/events_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/events/test/event_generator.cc
diff --git a/ui/events/test/event_generator.cc b/ui/events/test/event_generator.cc
index b7b01d44d6cf481f215c335761825d33bdf9120b..2f3a56b9e528a0eb2974b19aad46d7bfd9ebade2 100644
--- a/ui/events/test/event_generator.cc
+++ b/ui/events/test/event_generator.cc
@@ -599,15 +599,15 @@ void EventGenerator::Dispatch(ui::Event* event) {
void EventGenerator::SetTickClock(std::unique_ptr<base::TickClock> tick_clock) {
scoped_refptr<ClonableTickClock> clonable =
new ClonableTickClock(std::move(tick_clock));
-#if defined(USE_X11)
- ResetTimestampRolloverCountersForTesting(clonable->Clone());
-#endif
+ ui::SetEventTickClockForTesting(clonable->Clone());
tick_clock_ = clonable->Clone();
}
base::TimeTicks EventGenerator::Now() {
// This is the same as what EventTimeForNow() does, but here we do it
// with a tick clock that can be replaced with a simulated clock for tests.
+ // TODO(majidvp): The tick clock used by |ui::EventTimeForNow()| is now
+ // mockable so we no longer need this.
return tick_clock_->NowTicks();
}
« no previous file with comments | « ui/events/event_utils.cc ('k') | ui/events/win/events_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698