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

Issue 2101903002: MacViews: Modify cocoa_test_event_utils::SynthesizeKeyEvent to use the correct event timestamp value (Closed)

Created:
4 years, 5 months ago by karandeepb
Modified:
4 years, 5 months ago
Reviewers:
tapted, sky
CC:
chromium-reviews, yusukes+watch_chromium.org, tdresser+watch_chromium.org, tfarina, shuchen+watch_chromium.org, nona+watch_chromium.org, James Su, chrome-apps-syd-reviews_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

MacViews: Modify cocoa_test_event_utils::SynthesizeKeyEvent to use the correct event timestamp value. This CL fixes the following views_unittests, currently disabled on MacViews- -TextfieldTest.DestroyingTextfieldFromOnKeyEvent -TextfieldTest.FocusTraversalTest -TextfieldTest.TextInputClientTest These regressed in crrev.com/2007083002, which added a DCHECK to validate that ui::Event::time_stamp comes from the same clock as TimeTicks::Now. These tests fail since we are using a mocked system clock in tests, set using SetEventTickClockForTesting in base_event_utils.h, against which the event timestamp is validated. However cocoa_test_event_utils::SynthesizeKeyEvent uses the actual/correct timestamp value, and not the mocked one. This CL fixes the tests by using a timestamp value obtained from ui::EventTimeForNow. This returns the mocked time (if applicable), or base::TimeTicks::Now(). base::TimeTicks::Now() internally uses the same logic as TimeIntervalSinceSystemStartup() did previously (i.e. mach_absolute_time()). BUG=623420, 607403 Committed: https://crrev.com/84c48ee3ccb04d21a17e14428d15c64d17b3033f Cr-Commit-Position: refs/heads/master@{#402708}

Patch Set 1 #

Total comments: 6

Patch Set 2 : Address review comments. #

Patch Set 3 : Correct header order. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+17 lines, -63 lines) Patch
M ui/events/test/cocoa_test_event_utils.h View 1 2 1 chunk +3 lines, -2 lines 0 comments Download
M ui/events/test/cocoa_test_event_utils.mm View 1 7 chunks +11 lines, -38 lines 0 comments Download
M ui/views/controls/textfield/textfield_unittest.cc View 3 chunks +3 lines, -23 lines 0 comments Download

Messages

Total messages: 21 (13 generated)
karandeepb
PTAL Trent. Thanks.
4 years, 5 months ago (2016-06-28 04:17:27 UTC) #5
tapted
lgtm https://codereview.chromium.org/2101903002/diff/1/ui/events/test/cocoa_test_event_utils.mm File ui/events/test/cocoa_test_event_utils.mm (right): https://codereview.chromium.org/2101903002/diff/1/ui/events/test/cocoa_test_event_utils.mm#newcode1 ui/events/test/cocoa_test_event_utils.mm:1: // Copyright 2014 The Chromium Authors. All rights ...
4 years, 5 months ago (2016-06-28 05:07:41 UTC) #6
karandeepb
https://codereview.chromium.org/2101903002/diff/1/ui/events/test/cocoa_test_event_utils.mm File ui/events/test/cocoa_test_event_utils.mm (right): https://codereview.chromium.org/2101903002/diff/1/ui/events/test/cocoa_test_event_utils.mm#newcode1 ui/events/test/cocoa_test_event_utils.mm:1: // Copyright 2014 The Chromium Authors. All rights reserved. ...
4 years, 5 months ago (2016-06-28 12:07:49 UTC) #11
karandeepb
+sky for ui/ review.
4 years, 5 months ago (2016-06-29 00:48:04 UTC) #13
sky
LGTM
4 years, 5 months ago (2016-06-29 03:22:04 UTC) #14
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2101903002/80001
4 years, 5 months ago (2016-06-29 03:26:06 UTC) #17
commit-bot: I haz the power
Committed patchset #3 (id:80001)
4 years, 5 months ago (2016-06-29 04:10:12 UTC) #19
commit-bot: I haz the power
4 years, 5 months ago (2016-06-29 04:11:49 UTC) #21
Message was sent while issue was closed.
Patchset 3 (id:??) landed as
https://crrev.com/84c48ee3ccb04d21a17e14428d15c64d17b3033f
Cr-Commit-Position: refs/heads/master@{#402708}

Powered by Google App Engine
This is Rietveld 408576698