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

Issue 284903002: Only dispatch menu events if they have a valid target. (Closed)

Created:
6 years, 7 months ago by flackr
Modified:
6 years, 7 months ago
Reviewers:
sadrul
CC:
chromium-reviews, tfarina, tdresser+watch_chromium.org
Visibility:
Public.

Description

Only dispatch menu events if they have a valid target. BUG=370162 TEST=In touchview, open wrench menu and press a key (i.e. 'T'), nothing should happen. Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=271283

Patch Set 1 #

Total comments: 2

Patch Set 2 : Add test MenuControllerTest.EventTargeter #

Total comments: 6

Patch Set 3 : Address comments. #

Patch Set 4 : . #

Unified diffs Side-by-side diffs Delta from patch set Stats (+183 lines, -21 lines) Patch
M ui/events/event_utils.h View 1 2 chunks +6 lines, -0 lines 0 comments Download
M ui/events/event_utils.cc View 1 2 1 chunk +47 lines, -0 lines 0 comments Download
M ui/views/controls/menu/menu_controller.h View 1 2 3 1 chunk +4 lines, -0 lines 0 comments Download
M ui/views/controls/menu/menu_controller_unittest.cc View 1 2 3 6 chunks +105 lines, -20 lines 0 comments Download
M ui/views/controls/menu/menu_event_dispatcher_linux.cc View 1 2 chunks +21 lines, -1 line 0 comments Download

Messages

Total messages: 15 (0 generated)
flackr
Hey, Please take a look! This is basically what we talked about, though I found ...
6 years, 7 months ago (2014-05-13 17:46:40 UTC) #1
sadrul
I think this looks great! Can you add a test in MenuControllerTest for this? https://codereview.chromium.org/284903002/diff/1/ui/events/event_utils.h ...
6 years, 7 months ago (2014-05-14 03:23:10 UTC) #2
flackr
I finally managed to get a test working to verify this. I also realized that ...
6 years, 7 months ago (2014-05-15 21:12:56 UTC) #3
sadrul
https://codereview.chromium.org/284903002/diff/20001/ui/events/event_utils.cc File ui/events/event_utils.cc (right): https://codereview.chromium.org/284903002/diff/20001/ui/events/event_utils.cc#newcode30 ui/events/event_utils.cc:30: event.reset(new TranslatedKeyEvent(native_event, false)); I think this should be a ...
6 years, 7 months ago (2014-05-15 21:53:01 UTC) #4
flackr
https://codereview.chromium.org/284903002/diff/20001/ui/events/event_utils.cc File ui/events/event_utils.cc (right): https://codereview.chromium.org/284903002/diff/20001/ui/events/event_utils.cc#newcode30 ui/events/event_utils.cc:30: event.reset(new TranslatedKeyEvent(native_event, false)); On 2014/05/15 21:53:01, sadrul wrote: > ...
6 years, 7 months ago (2014-05-15 22:13:01 UTC) #5
sadrul
Cool. Thanks! lgtm
6 years, 7 months ago (2014-05-15 22:14:13 UTC) #6
flackr
The CQ bit was checked by flackr@chromium.org
6 years, 7 months ago (2014-05-16 21:15:56 UTC) #7
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/flackr@chromium.org/284903002/60001
6 years, 7 months ago (2014-05-16 21:17:18 UTC) #8
commit-bot: I haz the power
FYI, CQ is re-trying this CL (attempt #1). Please consider checking whether the failures are ...
6 years, 7 months ago (2014-05-17 06:45:15 UTC) #9
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 7 months ago (2014-05-17 07:46:15 UTC) #10
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_chromeos_rel on tryserver.chromium (http://build.chromium.org/p/tryserver.chromium/builders/linux_chromium_chromeos_rel/builds/28116)
6 years, 7 months ago (2014-05-17 07:46:16 UTC) #11
flackr
The CQ bit was checked by flackr@chromium.org
6 years, 7 months ago (2014-05-17 13:19:26 UTC) #12
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/flackr@chromium.org/284903002/60001
6 years, 7 months ago (2014-05-17 13:20:32 UTC) #13
commit-bot: I haz the power
Change committed as 271283
6 years, 7 months ago (2014-05-18 13:53:37 UTC) #14
Nico
6 years, 7 months ago (2014-05-18 18:59:51 UTC) #15
Message was sent while issue was closed.
A revert of this CL has been created in
https://codereview.chromium.org/287233005/ by thakis@chromium.org.

The reason for reverting is: Made the asan bot red:

Direct leak of 664 byte(s) in 1 object(s) allocated from:
    #0 0x4b7c7b in operator new(unsigned long)
/usr/local/google/work/chromium/src/third_party/llvm/projects/compiler-rt/lib/asan/asan_new_delete.cc:62
    #1 0x5a4ffc in RunMenu
ui/views/controls/menu/menu_controller_unittest.cc:158
    #2 0x5a4ffc in views::MenuControllerTest_EventTargeter_Test::TestBody()
ui/views/controls/menu/menu_controller_unittest.cc:218
    #3 0xb2b838 in HandleExceptionsInMethodIfSupported\u003Ctesting::Test, void>
testing/gtest/src/gtest.cc:2045
    #4 0xb2b838 in testing::Test::Run() testing/gtest/src/gtest.cc:2061
    #5 0xb2d2c8 in testing::TestInfo::Run() testing/gtest/src/gtest.cc:2237
    #6 0xb2e006 in testing::TestCase::Run() testing/gtest/src/gtest.cc:2344
    #7 0xb3e7fa in testing::internal::UnitTestImpl::RunAllTests()
testing/gtest/src/gtest.cc:4065
    #8 0xb3de40 in
HandleExceptionsInMethodIfSupported\u003Ctesting::internal::UnitTestImpl, bool>
testing/gtest/src/gtest.cc:2045
    #9 0xb3de40 in testing::UnitTest::Run() testing/gtest/src/gtest.cc:3697
    #10 0xafaee4 in RUN_ALL_TESTS testing/gtest/include/gtest/gtest.h:2231
    #11 0xafaee4 in base::TestSuite::Run() base/test/test_suite.cc:206
    #12 0xaf2656 in Run base/callback.h:401
    #13 0xaf2656 in base::(anonymous namespace)::LaunchUnitTestsInternal(int,
char**, base::Callback\u003Cint ()> const&, int)
base/test/launcher/unit_test_launcher.cc:494
    #14 0x83846a in main ui/views/run_all_unittests.cc:43
    #15 0x7ff88421176c in __libc_start_main
/build/buildd/eglibc-2.15/csu/libc-start.c:226



Probably easy to fix (and thus easy to reland), but from skimming the test it's
not obvious to me what's supposed to free controller_. I'm guessing the second
block in the new test just needs an explicit delete? (An "Owned by X" comment
close to controller_ would've helped me).

Powered by Google App Engine
This is Rietveld 408576698