New issue
Advanced search Search tips

Issue 726132 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Closed: Jun 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Mac
Pri: 2
Type: Bug

Blocking:
issue 428044



Sign in to add a comment

BrowserActionInteractiveTest.BrowserClickClosesPopup1 is flaky on Mac

Project Member Reported by tapted@chromium.org, May 24 2017

Issue description

Chrome Version       : r474253


After r474253 tried to bring up BrowserActionInteractiveTest on Mac, failures manifested for this test only, and only on 10.9 and 10.10 bots. Flakily.

One failure on 10.9: https://luci-logdog.appspot.com/v/?s=chromium%2Fbb%2Fchromium.mac%2FMac10.9_Tests%2F41678%2F%2B%2Frecipes%2Fsteps%2Finteractive_ui_tests%2F0%2Flogs%2FBrowserActionInteractiveTest.BrowserClickClosesPopup1%2F0

Three on 10.10 before reverting
https://luci-logdog.appspot.com/v/?s=chromium%2Fbb%2Fchromium.mac%2FMac10.10_Tests%2F18398%2F%2B%2Frecipes%2Fsteps%2Finteractive_ui_tests%2F0%2Fstdout
https://luci-logdog.appspot.com/v/?s=chromium%2Fbb%2Fchromium.mac%2FMac10.10_Tests%2F18400%2F%2B%2Frecipes%2Fsteps%2Finteractive_ui_tests%2F0%2Fstdout
https://luci-logdog.appspot.com/v/?s=chromium%2Fbb%2Fchromium.mac%2FMac10.10_Tests%2F18401%2F%2B%2Frecipes%2Fsteps%2Finteractive_ui_tests%2F0%2Fstdout

One run where it didn't fail on 10.10, not even once
https://luci-logdog.appspot.com/v/?s=chromium%2Fbb%2Fchromium.mac%2FMac10.10_Tests%2F18399%2F%2B%2Frecipes%2Fsteps%2Finteractive_ui_tests%2F0%2Fstdout

failures are all the same

[ RUN      ] BrowserActionInteractiveTest.BrowserClickClosesPopup1
[61010:5123:0524/063903.711830:WARNING:notification_platform_bridge_mac.mm(516)] AlertNotificationService: XPC connection invalidated.
../../chrome/browser/extensions/api/extension_action/browser_action_interactive_test.cc:108: Failure
Value of: BrowserActionTestUtil(browser()).HasPopup()
  Actual: true
Expected: false
[  FAILED  ] BrowserActionInteractiveTest.BrowserClickClosesPopup1, where TypeParam =  and GetParam() =  (1605 ms)

This is 

 ui_test_utils::ClickOnView(browser(), VIEW_ID_OMNIBOX);
 // The window disappears immediately.
 EXPECT_FALSE(BrowserActionTestUtil(browser()).HasPopup());

No other checks fail.

I suspect that the way Cocoa bubbles work we can't guarantee the window disappearing happens immediately -- the test needs to wait for an activation message from the WindowServer process. ClickOnView() spins runloops which is why this sometimes works.
 
Project Member

Comment 1 by bugdroid1@chromium.org, Jun 1 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/9e780e21778e7407ee7f4d5f6b47df9a51f77f7d

commit 9e780e21778e7407ee7f4d5f6b47df9a51f77f7d
Author: tapted <tapted@chromium.org>
Date: Thu Jun 01 06:13:19 2017

[reland] Bring up BrowserActionInteractiveTest on Mac.

Previously landed in r474253 but was still flaky. After attempting
various things, it seems impossible to guarantee the behaviour of
interactive_test_utils:: ClickOnView() on Mac when the target window is
inactive. BrowserActionInteractiveTest is just using ClickOnView to
activate the parent browser window anyway so, on mac, do that
explicitly.

Original message: These were never brought up since they were added in
r229777 (2013). How they are disabled is subtle:
BrowserActionInteractiveTest::ShouldRunPopupTest() returns false on Mac
and the test passes.

The linked bug indicates an error that an existing test extension
repros. This CL brings up the test harness (without changing non-test
code) since the tests may yet be flaky on Mac.

The original problem was,
  // TODO(justinlin): Browser window do not become active on Mac even when
  // Activate() is called on them. Enable when/if it's possible to fix.

Resolve this by invoking BringBrowserWindowToFront(browser()) at the
start of the test on mac and explicitly waiting for the popup window to
be reported as active by the OS.

BUG=428044,  726132 

Review-Url: https://codereview.chromium.org/2908983002
Cr-Commit-Position: refs/heads/master@{#476208}

[modify] https://crrev.com/9e780e21778e7407ee7f4d5f6b47df9a51f77f7d/chrome/browser/extensions/api/extension_action/browser_action_interactive_test.cc
[modify] https://crrev.com/9e780e21778e7407ee7f4d5f6b47df9a51f77f7d/chrome/browser/extensions/browser_action_test_util.h
[modify] https://crrev.com/9e780e21778e7407ee7f4d5f6b47df9a51f77f7d/chrome/browser/ui/BUILD.gn
[modify] https://crrev.com/9e780e21778e7407ee7f4d5f6b47df9a51f77f7d/chrome/browser/ui/cocoa/extensions/browser_action_test_util_mac.mm
[modify] https://crrev.com/9e780e21778e7407ee7f4d5f6b47df9a51f77f7d/chrome/browser/ui/views/toolbar/browser_action_test_util_views.cc

Status: Fixed (was: Started)
No flakes in 10~14 runs on each of those.

Sign in to add a comment