Commit 1e394df7 authored by Tomasz Moniuszko's avatar Tomasz Moniuszko Committed by Commit Bot

Unregister test event tick clock to avoid crash

BUG=1060156

TEST=events_unittests --gtest_filter=XEventTranslationTest.*

Change-Id: I8e26af89d45edb24027a2d53c7b25cbe824bf0b9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2096640Reviewed-by: default avatarSadrul Chowdhury <sadrul@chromium.org>
Commit-Queue: Tomasz Moniuszko <tmoniuszko@opera.com>
Cr-Commit-Position: refs/heads/master@{#749076}
parent 0e0e4de2
......@@ -6,6 +6,7 @@
#define UI_EVENTS_TEST_SCOPED_EVENT_TEST_TICK_CLOCK_H_
#include "base/test/simple_test_tick_clock.h"
#include "base/time/time.h"
#include "ui/events/base_event_utils.h"
namespace ui {
......@@ -32,6 +33,8 @@ class ScopedEventTestTickClock {
void SetNowTicks(base::TimeTicks ticks) { test_clock_.SetNowTicks(ticks); }
void Advance(base::TimeDelta delta) { test_clock_.Advance(delta); }
private:
base::SimpleTestTickClock test_clock_;
......
......@@ -4,7 +4,6 @@
#include "ui/events/x/x11_event_translation.h"
#include "base/test/simple_test_tick_clock.h"
#include "base/time/time.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "ui/events/base_event_utils.h"
......@@ -15,6 +14,7 @@
#include "ui/events/test/events_test_utils.h"
#include "ui/events/test/events_test_utils_x11.h"
#include "ui/events/test/keyboard_layout.h"
#include "ui/events/test/scoped_event_test_tick_clock.h"
#include "ui/events/types/event_type.h"
#include "ui/gfx/x/x11.h"
......@@ -92,8 +92,7 @@ TEST(XEventTranslationTest, BogusTimestampCorrection) {
scoped_xev.InitKeyEvent(ET_KEY_PRESSED, VKEY_RETURN, EF_NONE);
XEvent* xev = scoped_xev;
base::SimpleTestTickClock test_clock;
ui::SetEventTickClockForTesting(&test_clock);
test::ScopedEventTestTickClock test_clock;
test_clock.Advance(TimeDelta::FromSeconds(1));
// Set initial time as 1000ms
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment