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

Issue 2094193002: Deflake Mac views_unittest's MenuRunnerCocoaTest.RunMenuAndCancel (Closed)

Created:
4 years, 5 months ago by tapted
Modified:
4 years, 5 months ago
Reviewers:
sadrul
CC:
chromium-reviews, tfarina, tdresser+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

Deflake Mac views_unittest's MenuRunnerCocoaTest.RunMenuAndCancel The test occasionally fails with menu_runner_cocoa_unittest.mm:182: Failure Expected: (runner_->GetClosingEventTime()) <= (ui::EventTimeForNow() - base::TimeTicks())), actual: 13647.4s vs 0.002s It happens because menu_runner_impl_cocoa.mm uses base::TimeTicks::Now(), but the test uses ui::EventTimeForNow() to set expectations. Usually this isn't a problem, but if another unit test in the same process has created a ui::EventGenerator, this sets a mock time source with ui::SetEventTickClockForTesting(..) which isn't cleared when the EventGenerator is destroyed. Fix both problems. The EventGenerator destructor should reset the global state it created, and menu_runner_impl_cocoa.mm should use ui::EventTimeForNow() for better consistency. BUG=623455, 624555 Committed: https://crrev.com/80f15fe17e9095bd4d6c11d94db8e1dd42556458 Cr-Commit-Position: refs/heads/master@{#403373}

Patch Set 1 #

Total comments: 1

Patch Set 2 : Clear ui::EventGenerator global state #

Patch Set 3 : rebase #

Patch Set 4 : rebase #

Patch Set 5 : Lint #

Unified diffs Side-by-side diffs Delta from patch set Stats (+4 lines, -2 lines) Patch
M ui/events/test/event_generator.cc View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M ui/views/controls/menu/menu_runner_cocoa_unittest.mm View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M ui/views/controls/menu/menu_runner_impl_cocoa.mm View 1 2 3 4 2 chunks +2 lines, -1 line 0 comments Download

Messages

Total messages: 13 (7 generated)
tapted
Hi sadrul, please take a look https://codereview.chromium.org/2094193002/diff/1/ui/events/base_event_utils.cc File ui/events/base_event_utils.cc (right): https://codereview.chromium.org/2094193002/diff/1/ui/events/base_event_utils.cc#newcode54 ui/events/base_event_utils.cc:54: DCHECK(!g_tick_clock.Get()); So I ...
4 years, 5 months ago (2016-06-30 07:02:49 UTC) #5
sadrul
lgtm
4 years, 5 months ago (2016-06-30 14:11:21 UTC) #6
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/2094193002/80001
4 years, 5 months ago (2016-07-01 00:04:55 UTC) #8
commit-bot: I haz the power
Committed patchset #5 (id:80001)
4 years, 5 months ago (2016-07-01 00:37:06 UTC) #10
commit-bot: I haz the power
CQ bit was unchecked.
4 years, 5 months ago (2016-07-01 00:37:08 UTC) #11
commit-bot: I haz the power
4 years, 5 months ago (2016-07-01 00:39:19 UTC) #13
Message was sent while issue was closed.
Patchset 5 (id:??) landed as
https://crrev.com/80f15fe17e9095bd4d6c11d94db8e1dd42556458
Cr-Commit-Position: refs/heads/master@{#403373}

Powered by Google App Engine
This is Rietveld 408576698