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

Issue 2095283002: MacViews: Don't handle character events in textfield_unittest's MockInputMethod::DispatchKeyEvent. (Closed)

Created:
4 years, 5 months ago by karandeepb
Modified:
4 years, 5 months ago
Reviewers:
tapted, sky
CC:
chromium-reviews, tfarina, James Su, shuchen+watch_chromium.org, yusukes+watch_chromium.org, nona+watch_chromium.org, 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: Don't handle character events in textfield_unittest's MockInputMethod::DispatchKeyEvent. MockInputMethod::DispatchKeyEvent in textfield_unittest.cc currently has a lot of logic to handle key events. While this is appropriate for other platforms, on Mac this is incorrect since key events don't pass through InputMethod on Mac. This causes the test pipeline to be different from the production one on Mac. As a result some tests may incorrectly pass on MacViews. This CL fixes the issue by changing MockInputMethod::DispatchKeyEvent to behave similarly to InputMethodMac::DispatchKeyEvent for character events. Composition still needs to be mocked, since its not possible to generate test events which trigger the appropriate NSResponder action messages for composition. This also necessitates modifying SendKeyEvent(base::char16 ch) in textfield_unittest.cc to dispatch all character events regularly on Mac, rather than sending them directly to the InputMethod. This is a precursor to crrev.com/2096363002 which adds a test TextfieldTest.TextInputType_InsertionTest, which should have failed on MacViews, but doesn't currently due to this issue. BUG=623036 Committed: https://crrev.com/32409d8df5d505a66ed1710f102c84b90456f696 Cr-Commit-Position: refs/heads/master@{#403110}

Patch Set 1 #

Total comments: 8

Patch Set 2 : Address review comments. Rebase. #

Patch Set 3 : Fix trybots. #

Total comments: 2

Patch Set 4 : Modify comment. #

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

Dependent Patchsets:

Messages

Total messages: 30 (18 generated)
karandeepb
PTAL Trent. https://codereview.chromium.org/2095283002/diff/40001/ui/views/controls/textfield/textfield_unittest.cc File ui/views/controls/textfield/textfield_unittest.cc (right): https://codereview.chromium.org/2095283002/diff/40001/ui/views/controls/textfield/textfield_unittest.cc#newcode526 ui/views/controls/textfield/textfield_unittest.cc:526: input_method_->DispatchKeyEvent(&event); Not sure if the event needs ...
4 years, 5 months ago (2016-06-29 01:42:41 UTC) #8
tapted
https://codereview.chromium.org/2095283002/diff/40001/ui/events/test/cocoa_test_event_utils.mm File ui/events/test/cocoa_test_event_utils.mm (right): https://codereview.chromium.org/2095283002/diff/40001/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-29 07:21:39 UTC) #9
tapted
also lgtm
4 years, 5 months ago (2016-06-29 07:21:51 UTC) #10
karandeepb
https://codereview.chromium.org/2095283002/diff/40001/ui/events/test/cocoa_test_event_utils.mm File ui/events/test/cocoa_test_event_utils.mm (right): https://codereview.chromium.org/2095283002/diff/40001/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-29 07:54:07 UTC) #13
karandeepb
+sky for ui/ review.
4 years, 5 months ago (2016-06-29 07:54:58 UTC) #15
sky
LGTM
4 years, 5 months ago (2016-06-29 15:22:41 UTC) #16
karandeepb
PTAL Trent. Rebasing caused TextfieldTest.TextInputClientTest (which was disabled earlier) to fail, since composition still needs ...
4 years, 5 months ago (2016-06-30 03:22:59 UTC) #20
tapted
yup makes sense - still lgtm (please re-wrap CL description) https://codereview.chromium.org/2095283002/diff/120001/ui/views/controls/textfield/textfield_unittest.cc File ui/views/controls/textfield/textfield_unittest.cc (right): https://codereview.chromium.org/2095283002/diff/120001/ui/views/controls/textfield/textfield_unittest.cc#newcode151 ...
4 years, 5 months ago (2016-06-30 05:33:53 UTC) #21
karandeepb
https://codereview.chromium.org/2095283002/diff/120001/ui/views/controls/textfield/textfield_unittest.cc File ui/views/controls/textfield/textfield_unittest.cc (right): https://codereview.chromium.org/2095283002/diff/120001/ui/views/controls/textfield/textfield_unittest.cc#newcode151 ui/views/controls/textfield/textfield_unittest.cc:151: // still needs to be mocked, since its not ...
4 years, 5 months ago (2016-06-30 06:02:35 UTC) #23
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/2095283002/140001
4 years, 5 months ago (2016-06-30 06:03:00 UTC) #26
commit-bot: I haz the power
Committed patchset #4 (id:140001)
4 years, 5 months ago (2016-06-30 07:14:54 UTC) #28
commit-bot: I haz the power
4 years, 5 months ago (2016-06-30 07:17:30 UTC) #30
Message was sent while issue was closed.
Patchset 4 (id:??) landed as
https://crrev.com/32409d8df5d505a66ed1710f102c84b90456f696
Cr-Commit-Position: refs/heads/master@{#403110}

Powered by Google App Engine
This is Rietveld 408576698