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

Issue 2660813002: Add WidgetTest::GetAllWidgets() to find dialogs created by TestBrowserDialog. (Closed)

Created:
3 years, 10 months ago by tapted
Modified:
3 years, 10 months ago
Reviewers:
sky
CC:
chromium-reviews, kalyank, mac-reviews_chromium.org, sadrul, tfarina, chrome-apps-syd-reviews_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Add WidgetTest::GetAllWidgets() to find dialogs created by TestBrowserDialog. TestBrowserDialog currently fails to detect some browser dialogs on Windows 10. This is because TestBrowserDialog uses the set difference from calls to Widget::GetAllChildWidgets() to detect when a dialog is added to a browser window. On Aura, this is populated from Aura child windows (in the same WindowTreeHost). However, a parented Widget using a DesktopNativeWidgetAura (e.g. for a top-level Widget on Windows Aero), rather than a NativeWidgetAura, will not be reported in its parent window's "GetAllChildWidgets()" (nor in Widget::GetAllOwnedWidgets()). Ownership of these top-level Widgets is managed in mus-, win-, or x11-specific code. To fix, add WidgetTest::GetAllWidgets() which just returns all Widget*s that can be found in the current process. In addition, this approach is able to detect Widgets created with no parent at all, such as the HungRenderer dialog. BUG=683808, 654151 Review-Url: https://codereview.chromium.org/2660813002 Cr-Commit-Position: refs/heads/master@{#447216} Committed: https://chromium.googlesource.com/chromium/src/+/3b39bb8d4942bbf79cbd36f24ae8a861e3f78fa4

Patch Set 1 #

Patch Set 2 : Fix CrOS maybe? #

Patch Set 3 : fix mac #

Total comments: 6

Patch Set 4 : respond to comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+185 lines, -14 lines) Patch
M chrome/browser/ui/test/test_browser_dialog.h View 1 3 chunks +0 lines, -9 lines 0 comments Download
M chrome/browser/ui/test/test_browser_dialog.cc View 1 2 3 2 chunks +19 lines, -5 lines 0 comments Download
M ui/aura/test/aura_test_helper.h View 1 chunk +3 lines, -0 lines 0 comments Download
M ui/aura/test/aura_test_helper.cc View 3 chunks +13 lines, -0 lines 0 comments Download
M ui/views/BUILD.gn View 1 2 2 chunks +2 lines, -0 lines 0 comments Download
M ui/views/test/widget_test.h View 1 2 3 1 chunk +3 lines, -0 lines 0 comments Download
M ui/views/test/widget_test_aura.cc View 1 2 4 chunks +56 lines, -0 lines 0 comments Download
M ui/views/test/widget_test_mac.mm View 1 chunk +10 lines, -0 lines 0 comments Download
A ui/views/test/widget_test_unittest.cc View 1 2 3 1 chunk +79 lines, -0 lines 0 comments Download

Messages

Total messages: 28 (22 generated)
tapted
Hi sky, please take a look - this is what I came up with as ...
3 years, 10 months ago (2017-01-30 03:49:29 UTC) #15
sky
I definitely like this patch better than the last. https://codereview.chromium.org/2660813002/diff/40001/chrome/browser/ui/test/test_browser_dialog.cc File chrome/browser/ui/test/test_browser_dialog.cc (right): https://codereview.chromium.org/2660813002/diff/40001/chrome/browser/ui/test/test_browser_dialog.cc#newcode20 chrome/browser/ui/test/test_browser_dialog.cc:20: ...
3 years, 10 months ago (2017-01-30 17:07:04 UTC) #17
tapted
https://codereview.chromium.org/2660813002/diff/40001/chrome/browser/ui/test/test_browser_dialog.cc File chrome/browser/ui/test/test_browser_dialog.cc (right): https://codereview.chromium.org/2660813002/diff/40001/chrome/browser/ui/test/test_browser_dialog.cc#newcode20 chrome/browser/ui/test/test_browser_dialog.cc:20: #if defined(USE_ASH) On 2017/01/30 17:07:04, sky wrote: > USE_ASH ...
3 years, 10 months ago (2017-01-30 23:36:31 UTC) #20
sky
LGTM
3 years, 10 months ago (2017-01-31 05:04:55 UTC) #23
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/2660813002/60001
3 years, 10 months ago (2017-01-31 10:57:46 UTC) #25
commit-bot: I haz the power
3 years, 10 months ago (2017-01-31 11:02:28 UTC) #28
Message was sent while issue was closed.
Committed patchset #4 (id:60001) as
https://chromium.googlesource.com/chromium/src/+/3b39bb8d4942bbf79cbd36f24ae8...

Powered by Google App Engine
This is Rietveld 408576698