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

Issue 1782773002: MacViews: Fix ViewTest.HandleAccelerator by faking window activation (Closed)

Created:
4 years, 9 months ago by tapted
Modified:
4 years, 9 months ago
Reviewers:
sky
CC:
chromium-reviews, tfarina, msw+watch_chromium.org, groby+bubble_chromium.org, hcarmona+bubble_chromium.org, rouslan+bubble_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: Fix ViewTest.HandleAccelerator by faking window activation In fact, fake activation for all tests that use ViewsTestHelper, except those that run as interactive_ui_tests. Currently for HandleAccelerator, `EXPECT_TRUE(widget->IsActive())` fails on Mac since desktop widgets are used rather than Aura widgets, so activation is asynchronous. Also TYPE_POPUP widgets are not activatable by default (on all platforms). For non-desktop Aura widgets, Show() on non-activatable widgets does not activate, but Activate() does allow activation. Make it easier for a unit test inheriting from ViewsTestBase to use fake window activation on Mac without using #ifdefs by just giving it to them by default. BUG=592890 Committed: https://crrev.com/2a697015fafd0c99b169890a9a7ac0b2011a91c0 Cr-Commit-Position: refs/heads/master@{#380917}

Patch Set 1 #

Patch Set 2 : fix gn deps, format consistently #

Patch Set 3 : Delay the activatableness #

Total comments: 3

Patch Set 4 : rebase #

Patch Set 5 : Faked activations for everyone! #

Unified diffs Side-by-side diffs Delta from patch set Stats (+50 lines, -85 lines) Patch
M ui/base/test/ui_controls.h View 1 2 3 4 1 chunk +4 lines, -0 lines 0 comments Download
M ui/base/test/ui_controls_mac.mm View 1 2 3 4 1 chunk +4 lines, -0 lines 0 comments Download
M ui/views/BUILD.gn View 1 1 chunk +1 line, -0 lines 0 comments Download
M ui/views/accessible_pane_view_unittest.cc View 1 2 3 4 2 chunks +0 lines, -11 lines 0 comments Download
M ui/views/bubble/bubble_delegate_unittest.cc View 1 2 3 4 2 chunks +0 lines, -9 lines 0 comments Download
M ui/views/cocoa/bridged_native_widget_interactive_uitest.mm View 1 2 3 4 2 chunks +6 lines, -1 line 0 comments Download
M ui/views/controls/textfield/textfield_unittest.cc View 1 2 3 4 2 chunks +0 lines, -6 lines 0 comments Download
M ui/views/test/views_test_helper_mac.h View 1 2 3 4 2 chunks +11 lines, -0 lines 0 comments Download
M ui/views/test/views_test_helper_mac.mm View 1 2 3 4 2 chunks +12 lines, -0 lines 0 comments Download
M ui/views/test/widget_test.h View 1 2 3 4 2 chunks +0 lines, -19 lines 0 comments Download
M ui/views/test/widget_test_mac.mm View 1 2 3 4 2 chunks +0 lines, -27 lines 0 comments Download
M ui/views/view_unittest.cc View 1 2 3 4 2 chunks +5 lines, -1 line 0 comments Download
M ui/views/views.gyp View 1 1 chunk +1 line, -0 lines 0 comments Download
M ui/views/widget/native_widget_mac_interactive_uitest.mm View 1 2 3 4 2 chunks +6 lines, -1 line 0 comments Download
M ui/views/window/dialog_delegate_unittest.cc View 1 2 3 4 2 chunks +0 lines, -10 lines 0 comments Download

Dependent Patchsets:

Messages

Total messages: 17 (10 generated)
tapted
Hi sky, please take a look when you get a chance. Thanks! https://codereview.chromium.org/1782773002/diff/60001/ui/views/view_unittest.cc File ui/views/view_unittest.cc ...
4 years, 9 months ago (2016-03-10 10:52:42 UTC) #6
sky
https://codereview.chromium.org/1782773002/diff/60001/ui/views/test/views_test_helper_mac.mm File ui/views/test/views_test_helper_mac.mm (right): https://codereview.chromium.org/1782773002/diff/60001/ui/views/test/views_test_helper_mac.mm#newcode51 ui/views/test/views_test_helper_mac.mm:51: faked_focus_.reset(new ui::test::ScopedFakeNSWindowFocus); Is there a reason not to do ...
4 years, 9 months ago (2016-03-10 18:59:16 UTC) #7
tapted
https://codereview.chromium.org/1782773002/diff/60001/ui/views/test/views_test_helper_mac.mm File ui/views/test/views_test_helper_mac.mm (right): https://codereview.chromium.org/1782773002/diff/60001/ui/views/test/views_test_helper_mac.mm#newcode51 ui/views/test/views_test_helper_mac.mm:51: faked_focus_.reset(new ui::test::ScopedFakeNSWindowFocus); On 2016/03/10 18:59:16, sky wrote: > Is ...
4 years, 9 months ago (2016-03-11 09:56:20 UTC) #10
sky
LGTM
4 years, 9 months ago (2016-03-11 16:16:17 UTC) #11
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1782773002/120001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1782773002/120001
4 years, 9 months ago (2016-03-14 00:40:22 UTC) #13
commit-bot: I haz the power
Committed patchset #5 (id:120001)
4 years, 9 months ago (2016-03-14 02:00:51 UTC) #15
commit-bot: I haz the power
4 years, 9 months ago (2016-03-14 02:02:13 UTC) #17
Message was sent while issue was closed.
Patchset 5 (id:??) landed as
https://crrev.com/2a697015fafd0c99b169890a9a7ac0b2011a91c0
Cr-Commit-Position: refs/heads/master@{#380917}

Powered by Google App Engine
This is Rietveld 408576698