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

Issue 1829603002: MacViews: Fix flaky MenuRunnerCocoaTests. (Closed)

Created:
4 years, 9 months ago by karandeepb
Modified:
4 years, 8 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 flaky MenuRunnerCocoaTests. MenuRunnerCocoaTests are currently flaky. When run in parallel with other tests, the blocks scheduled using CFRunLoopPerformBlock are sometimes not run, causing the flakiness. Ideally launching a menu should run the current thread's runloop in NSEventTrackingRunLoopMode, causing the scheduled blocks to run. However, when run in parallel with other tests involving UI operations, flakiness probably occurs because the call to launch a menu may fail midway, causing the scheduled blocks to not run. Instead of scheduling the block on a runloop, running them as callbacks on SimpleMenuModel::Delegate::MenuWillShow fixes the flakiness. BUG=521460 Committed: https://crrev.com/e8e08b359c588c9dd8ca4c5132c372ee6cbd2aaf Cr-Commit-Position: refs/heads/master@{#385940}

Patch Set 1 #

Patch Set 2 : Style improvements. #

Total comments: 6

Patch Set 3 : Using base::Callback. #

Total comments: 4

Patch Set 4 : Address review comments. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+48 lines, -26 lines) Patch
M ui/views/controls/menu/menu_runner_cocoa_unittest.mm View 1 2 3 8 chunks +48 lines, -26 lines 0 comments Download

Messages

Total messages: 20 (9 generated)
karandeepb
PTAL Trent. Was there a specific reason why CFRunLoopPerformBlock was used earlier? Some other unit ...
4 years, 9 months ago (2016-03-23 09:15:19 UTC) #4
tapted
Yeah, I never really liked CFRunLoopPerformBlock -- if it's not necessary to test properly, then ...
4 years, 9 months ago (2016-03-24 02:10:36 UTC) #5
karandeepb
PTAL Trent. Thanks. https://codereview.chromium.org/1829603002/diff/20001/ui/views/controls/menu/menu_runner_cocoa_unittest.mm File ui/views/controls/menu/menu_runner_cocoa_unittest.mm (right): https://codereview.chromium.org/1829603002/diff/20001/ui/views/controls/menu/menu_runner_cocoa_unittest.mm#newcode62 ui/views/controls/menu/menu_runner_cocoa_unittest.mm:62: class TestModel : public ui::SimpleMenuModel { ...
4 years, 8 months ago (2016-04-06 05:52:48 UTC) #7
tapted
https://codereview.chromium.org/1829603002/diff/60001/ui/views/controls/menu/menu_runner_cocoa_unittest.mm File ui/views/controls/menu/menu_runner_cocoa_unittest.mm (right): https://codereview.chromium.org/1829603002/diff/60001/ui/views/controls/menu/menu_runner_cocoa_unittest.mm#newcode20 ui/views/controls/menu/menu_runner_cocoa_unittest.mm:20: void MenuCancelCallback(internal::MenuRunnerImplCocoa* runner) { I think these all would ...
4 years, 8 months ago (2016-04-06 06:38:37 UTC) #8
karandeepb
PTAL Trent. https://codereview.chromium.org/1829603002/diff/60001/ui/views/controls/menu/menu_runner_cocoa_unittest.mm File ui/views/controls/menu/menu_runner_cocoa_unittest.mm (right): https://codereview.chromium.org/1829603002/diff/60001/ui/views/controls/menu/menu_runner_cocoa_unittest.mm#newcode20 ui/views/controls/menu/menu_runner_cocoa_unittest.mm:20: void MenuCancelCallback(internal::MenuRunnerImplCocoa* runner) { On 2016/04/06 06:38:37, ...
4 years, 8 months ago (2016-04-06 10:25:16 UTC) #9
tapted
lgtm
4 years, 8 months ago (2016-04-06 11:41:25 UTC) #10
karandeepb
PTAL sky@. Thanks.
4 years, 8 months ago (2016-04-06 22:33:13 UTC) #13
sky
LGTM
4 years, 8 months ago (2016-04-07 19:01:54 UTC) #14
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1829603002/80001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1829603002/80001
4 years, 8 months ago (2016-04-07 23:15:55 UTC) #16
commit-bot: I haz the power
Committed patchset #4 (id:80001)
4 years, 8 months ago (2016-04-08 00:39:49 UTC) #18
commit-bot: I haz the power
4 years, 8 months ago (2016-04-08 00:41:01 UTC) #20
Message was sent while issue was closed.
Patchset 4 (id:??) landed as
https://crrev.com/e8e08b359c588c9dd8ca4c5132c372ee6cbd2aaf
Cr-Commit-Position: refs/heads/master@{#385940}

Powered by Google App Engine
This is Rietveld 408576698