Index: ui/events/base_event_utils.cc |
diff --git a/ui/events/base_event_utils.cc b/ui/events/base_event_utils.cc |
index d4545bc45c4560dddc39c2c217a5e0045dd39914..e5500d7f7367cb43e69940acb4fcfeebb374f2d6 100644 |
--- a/ui/events/base_event_utils.cc |
+++ b/ui/events/base_event_utils.cc |
@@ -13,6 +13,8 @@ |
#include "ui/events/event_constants.h" |
#include "ui/events/event_switches.h" |
+bool g_no_mock_time = false; |
+ |
namespace ui { |
namespace { |
@@ -48,11 +50,14 @@ base::LazyInstance<std::unique_ptr<base::TickClock>>::Leaky g_tick_clock = |
LAZY_INSTANCE_INITIALIZER; |
base::TimeTicks EventTimeForNow() { |
+ if (g_no_mock_time) |
+ DCHECK(!g_tick_clock.Get()); |
tapted
2016/06/30 07:02:49
So I got this to fail at [ RUN ] MenuRunnerCo
|
return g_tick_clock.Get() ? g_tick_clock.Get()->NowTicks() |
: base::TimeTicks::Now(); |
} |
void SetEventTickClockForTesting(std::unique_ptr<base::TickClock> tick_clock) { |
+ DCHECK(!g_no_mock_time); |
g_tick_clock.Get() = std::move(tick_clock); |
} |