|
|
Created:
3 years, 6 months ago by tapted Modified:
3 years, 6 months ago Reviewers:
Devlin CC:
chromium-reviews, chromium-apps-reviews_chromium.org, mac-reviews_chromium.org, tfarina, extensions-reviews_chromium.org, chrome-apps-syd-reviews_chromium.org Target Ref:
refs/heads/master Project:
chromium Visibility:
Public. |
Description[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}
Committed: https://chromium.googlesource.com/chromium/src/+/9e780e21778e7407ee7f4d5f6b47df9a51f77f7d
Patch Set 1 : baseline-nofix #Patch Set 2 : guarantee flake #Patch Set 3 : Confirm fix with flake guaranteed #Patch Set 4 : add back content::RunMessageLoop() #Patch Set 5 : still flaky - more robust answer #
Total comments: 2
Patch Set 6 : ClosePopupViaFocusLoss #Patch Set 7 : #else #
Total comments: 6
Patch Set 8 : respond to comments #
Messages
Total messages: 37 (30 generated)
The CQ bit was checked by tapted@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
Patchset #1 (id:1) has been deleted
Description was changed from ========== [reland] Bring up BrowserActionInteractiveTest on Mac. Previously landed in r474253 but was still flaky. Fix by pumping the event loop when detecting dismissal as well as open. 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 ========== to ========== [reland] Bring up BrowserActionInteractiveTest on Mac. Previously landed in r474253 but was still flaky. It flaked because ui_test_utils:: ClickOnView() does content::RunMessageLoop() to run until the message loop is idle, but sometimes the message loop becomes idle before the IPC from the WindowServer arrives that activates the browser window. Fix by pumping the event loop and waiting for a notification. 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 ==========
tapted@chromium.org changed reviewers: + rdevlin.cronin@chromium.org
The CQ bit was checked by tapted@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was checked by tapted@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
Description was changed from ========== [reland] Bring up BrowserActionInteractiveTest on Mac. Previously landed in r474253 but was still flaky. It flaked because ui_test_utils:: ClickOnView() does content::RunMessageLoop() to run until the message loop is idle, but sometimes the message loop becomes idle before the IPC from the WindowServer arrives that activates the browser window. Fix by pumping the event loop and waiting for a notification. 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 ========== to ========== [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 ==========
Description was changed from ========== [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 ========== to ========== [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 ==========
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
Hi Devlin, please take a look. I looked at other tests that might be using ClickOnView for inactive windows -- https://codereview.chromium.org/2910033002/ -- there's one, but it uses an event monitor to close the window synchronously so isn't affected. But really the problem is that there are a stack of disabled interactive tests using ClickOnView and other methods that end up in ui_controls::SendMouseMoveNotifyWhenDone(). I want to phase that out entirely.. which will be much simpler once I start deleting some cocoa ui.
https://codereview.chromium.org/2908983002/diff/100001/chrome/browser/extensi... File chrome/browser/extensions/api/extension_action/browser_action_interactive_test.cc (right): https://codereview.chromium.org/2908983002/diff/100001/chrome/browser/extensi... chrome/browser/extensions/api/extension_action/browser_action_interactive_test.cc:108: EXPECT_TRUE(ui_test_utils::BringBrowserWindowToFront(browser())); One worry: Extension popups are non-modal and dismiss on deactivation (which is all kind of hand-rolled for the class, unfortunately). If we call BringBrowserWindowToFront(), since that focuses a different NativeWindow, it seems like that could result in dismissing the popup directly (since the popup would no longer be the focused window). Is that a concern? If not, can we explain why in a comment? At a higher level, this might not be entirely bad - ClosePopupViaClick() basically tests that the popup is dismissed via focus loss, which this would still accomplish, and ideally we'd notice if clicking the omnibox no longer focuses the browser's native window. So if this is necessary and this alone *does* dismiss the popup, that wouldn't be entirely bad - but we should rename things appropriately (e.g. ClosePopupViaFocusLoss()), and maybe coalesce more code (call BringBrowserWindowToFront for all platforms? You'd know better than I if that's sane).
The CQ bit was checked by tapted@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: linux_chromium_chromeos_ozone_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_...)
The CQ bit was checked by tapted@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: ios-simulator on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios-simulator/bui...)
https://codereview.chromium.org/2908983002/diff/100001/chrome/browser/extensi... File chrome/browser/extensions/api/extension_action/browser_action_interactive_test.cc (right): https://codereview.chromium.org/2908983002/diff/100001/chrome/browser/extensi... chrome/browser/extensions/api/extension_action/browser_action_interactive_test.cc:108: EXPECT_TRUE(ui_test_utils::BringBrowserWindowToFront(browser())); On 2017/05/30 15:12:27, Devlin wrote: > One worry: Extension popups are non-modal and dismiss on deactivation (which is > all kind of hand-rolled for the class, unfortunately). If we call > BringBrowserWindowToFront(), since that focuses a different NativeWindow, it > seems like that could result in dismissing the popup directly (since the popup > would no longer be the focused window). Is that a concern? If not, can we > explain why in a comment? > > At a higher level, this might not be entirely bad - ClosePopupViaClick() > basically tests that the popup is dismissed via focus loss, which this would > still accomplish, and ideally we'd notice if clicking the omnibox no longer > focuses the browser's native window. So if this is necessary and this alone > *does* dismiss the popup, that wouldn't be entirely bad - but we should rename > things appropriately (e.g. ClosePopupViaFocusLoss()), and maybe coalesce more > code (call BringBrowserWindowToFront for all platforms? You'd know better than > I if that's sane). Yeah I think the goal of this test step is merely to trigger that dismissal in a cross-platform way. The mechanism doesn't matter so much. Using BringBrowserWindowToFront on all platforms is problematic since if the popup is not a 'toplevel' window the browser widget is seen as always active. I've renamed to ClosePopupViaFocusLoss() and added comments - see what you think.
lgtm! https://codereview.chromium.org/2908983002/diff/140001/chrome/browser/extensi... File chrome/browser/extensions/api/extension_action/browser_action_interactive_test.cc (right): https://codereview.chromium.org/2908983002/diff/140001/chrome/browser/extensi... chrome/browser/extensions/api/extension_action/browser_action_interactive_test.cc:108: // explicitly. This works because bubbles on Mac are always toplevel. nit: I'd add something like "activating the browser window causes the bubble window to lose focus" (feel free to wordsmith) somewhere. https://codereview.chromium.org/2908983002/diff/140001/chrome/browser/extensi... chrome/browser/extensions/api/extension_action/browser_action_interactive_test.cc:283: IN_PROC_BROWSER_TEST_F(BrowserActionInteractiveTest, BrowserClickClosesPopup1) { should we rename this test and update the comment? https://codereview.chromium.org/2908983002/diff/140001/chrome/browser/extensi... chrome/browser/extensions/api/extension_action/browser_action_interactive_test.cc:298: MAYBE_BrowserClickClosesPopup2) { ditto
The CQ bit was checked by tapted@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
https://codereview.chromium.org/2908983002/diff/140001/chrome/browser/extensi... File chrome/browser/extensions/api/extension_action/browser_action_interactive_test.cc (right): https://codereview.chromium.org/2908983002/diff/140001/chrome/browser/extensi... chrome/browser/extensions/api/extension_action/browser_action_interactive_test.cc:108: // explicitly. This works because bubbles on Mac are always toplevel. On 2017/05/31 14:39:00, Devlin wrote: > nit: I'd add something like "activating the browser window causes the bubble > window to lose focus" (feel free to wordsmith) somewhere. Done. https://codereview.chromium.org/2908983002/diff/140001/chrome/browser/extensi... chrome/browser/extensions/api/extension_action/browser_action_interactive_test.cc:283: IN_PROC_BROWSER_TEST_F(BrowserActionInteractiveTest, BrowserClickClosesPopup1) { On 2017/05/31 14:39:00, Devlin wrote: > should we rename this test and update the comment? Yup - Done. https://codereview.chromium.org/2908983002/diff/140001/chrome/browser/extensi... chrome/browser/extensions/api/extension_action/browser_action_interactive_test.cc:298: MAYBE_BrowserClickClosesPopup2) { On 2017/05/31 14:39:00, Devlin wrote: > ditto Done.
The CQ bit was unchecked by tapted@chromium.org
The CQ bit was checked by tapted@chromium.org
The patchset sent to the CQ was uploaded after l-g-t-m from rdevlin.cronin@chromium.org Link to the patchset: https://codereview.chromium.org/2908983002/#ps160001 (title: "respond to comments")
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
CQ is committing da patch. Bot data: {"patchset_id": 160001, "attempt_start_ts": 1496294644155300, "parent_rev": "82df308c87cb67ae50f5f05196f25e238492adba", "commit_rev": "9e780e21778e7407ee7f4d5f6b47df9a51f77f7d"}
Message was sent while issue was closed.
Description was changed from ========== [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 ========== to ========== [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} Committed: https://chromium.googlesource.com/chromium/src/+/9e780e21778e7407ee7f4d5f6b47... ==========
Message was sent while issue was closed.
Committed patchset #8 (id:160001) as https://chromium.googlesource.com/chromium/src/+/9e780e21778e7407ee7f4d5f6b47... |