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

Issue 1670473002: MacViews: Fix views_unittests MenuButtonTest.{ActivateDropDownOnMouseClick,DraggableMenuButtonActiv… (Closed)

Created:
4 years, 10 months ago by Patti Lor
Modified:
4 years, 10 months ago
Reviewers:
tapted, sky
CC:
chromium-reviews, tfarina, 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: Fix views_unittests MenuButtonTest.{ActivateDropDownOnMouseClick,DraggableMenuButtonActivatesOnRelease} Tests added in r301015, regressed in r363547. They fail on Mac because a non-simulated cursor position is detected during button creation, where button states are initialized, thus not detecting a hover state. the ui::test::EventGenerator is used to simulate cursor position, but isn't created until after the button widget, which means an unexpected cursor position is detected between the time of widget creation and EventGenerator creation. Additionally, using the set_current_location() method does not trigger mouse events, which means the button's hover state is never detected. Fix is to create the EventGenerator object before button creation so that when mouse events are triggered the hit tests will detect mouse hover states. BUG=579380 Committed: https://crrev.com/1ddeaf4f19e4c98b7f489746bfdec7cf90218883 Cr-Commit-Position: refs/heads/master@{#376101}

Patch Set 1 #

Total comments: 4

Patch Set 2 : Address review comments. #

Total comments: 9

Patch Set 3 : Treat scoped_ptrs properly. #

Patch Set 4 : Rebase, set cursor location consistently. #

Patch Set 5 : Make EventGenerator private. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+27 lines, -33 lines) Patch
M ui/views/controls/button/menu_button_unittest.cc View 1 2 3 4 15 chunks +27 lines, -33 lines 0 comments Download

Messages

Total messages: 28 (11 generated)
Patti Lor
PTAL, I just moved the EventGenerators used for most (all?) tests into the MenuButtonTest object.
4 years, 10 months ago (2016-02-04 07:49:27 UTC) #3
tapted
nice work! just nits really. https://codereview.chromium.org/1670473002/diff/1/ui/views/controls/button/menu_button_unittest.cc File ui/views/controls/button/menu_button_unittest.cc (right): https://codereview.chromium.org/1670473002/diff/1/ui/views/controls/button/menu_button_unittest.cc#newcode89 ui/views/controls/button/menu_button_unittest.cc:89: ui::test::EventGenerator* generator_; this should ...
4 years, 10 months ago (2016-02-04 23:27:09 UTC) #4
tapted
oh and have the tests always failed since they were added in r301015? CL description ...
4 years, 10 months ago (2016-02-04 23:28:42 UTC) #5
Patti Lor
Did a bisect and it appears to have regressed about 2 months ago in r363547, ...
4 years, 10 months ago (2016-02-08 06:03:26 UTC) #7
tapted
It's still hard to draw the link between the failures and the fix. I think ...
4 years, 10 months ago (2016-02-09 05:06:41 UTC) #8
tapted
btw there's some stuff in https://codereview.chromium.org/1682603002/ that will probably merge-conflict but that hasn't landed yet
4 years, 10 months ago (2016-02-09 06:02:49 UTC) #9
Patti Lor
Have moved the simulated cursor position to coords at 10,10 after the event generator is ...
4 years, 10 months ago (2016-02-12 04:42:20 UTC) #10
tapted
https://codereview.chromium.org/1670473002/diff/20001/ui/views/controls/button/menu_button_unittest.cc File ui/views/controls/button/menu_button_unittest.cc (right): https://codereview.chromium.org/1670473002/diff/20001/ui/views/controls/button/menu_button_unittest.cc#newcode60 ui/views/controls/button/menu_button_unittest.cc:60: scoped_ptr<ui::test::EventGenerator> generator; On 2016/02/12 04:42:20, Patti Lor wrote: > ...
4 years, 10 months ago (2016-02-12 04:44:54 UTC) #11
Patti Lor
On 2016/02/12 04:44:54, tapted wrote: > https://codereview.chromium.org/1670473002/diff/20001/ui/views/controls/button/menu_button_unittest.cc > File ui/views/controls/button/menu_button_unittest.cc (right): > > https://codereview.chromium.org/1670473002/diff/20001/ui/views/controls/button/menu_button_unittest.cc#newcode60 > ...
4 years, 10 months ago (2016-02-14 22:44:56 UTC) #12
tapted
lgtm, just the CL description needs an update to match the theory that the failures ...
4 years, 10 months ago (2016-02-14 22:52:11 UTC) #13
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1670473002/80001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1670473002/80001
4 years, 10 months ago (2016-02-14 23:50:01 UTC) #16
commit-bot: I haz the power
Try jobs failed on following builders: chromium_presubmit on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromium_presubmit/builds/146018)
4 years, 10 months ago (2016-02-15 00:03:08 UTC) #18
Patti Lor
PTAL, thank you!
4 years, 10 months ago (2016-02-15 00:36:09 UTC) #21
sky
LGTM
4 years, 10 months ago (2016-02-16 16:05:47 UTC) #22
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1670473002/80001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1670473002/80001
4 years, 10 months ago (2016-02-18 04:44:02 UTC) #24
commit-bot: I haz the power
Committed patchset #5 (id:80001)
4 years, 10 months ago (2016-02-18 05:22:47 UTC) #26
commit-bot: I haz the power
4 years, 10 months ago (2016-02-18 05:24:53 UTC) #28
Message was sent while issue was closed.
Patchset 5 (id:??) landed as
https://crrev.com/1ddeaf4f19e4c98b7f489746bfdec7cf90218883
Cr-Commit-Position: refs/heads/master@{#376101}

Powered by Google App Engine
This is Rietveld 408576698