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

Issue 2532793002: Add a TestBrowserDialog helper class for testing browser dialogs in a consistent way. (Closed)

Created:
4 years ago by tapted
Modified:
4 years ago
CC:
chromium-reviews, rouslan+autofill_chromium.org, tfarina, sebsg+autofillwatch_chromium.org, jdonnelly+autofillwatch_chromium.org, mathp+autofillwatch_chromium.org, mac-reviews_chromium.org, vabr+watchlistautofill_chromium.org, estade+watch_chromium.org, chrome-apps-syd-reviews_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Add a TestBrowserDialog helper class for testing browser dialogs in a consistent way. Allows a test harness to opt in to a framework for testing browser dialogs. Merely override a method, `void ShowDialog(const std::string& name)`, and add any number of IN_PROC_BROWSER_TEST_F(FooDialogTest, InvokeDialog_name) { RunDialog(); } to foo_dialog_browsertest.cc. This will - Invoke ShowDialog("name") in the test case and perform some basic checks. - register the test name with the dialog testing framework. Running browser_tests --gtest_filter=BrowserDialogTest.Invoke will list all dialogs registered with the testing framework. And with the additional arguments, --dialog=FooDialogTest.InvokeDialog_name --interactive BrowserDialogTest will invoke the dialog "interactively". This allows for manual testing and screenshots for UI review. A test harness can register multiple "styles" of its dialog by providing multiple tests invoking RunDialog() using different suffixes after "InvokeDialog_". See in-file documentation for more info. BUG=654151 Committed: https://crrev.com/658e7bd30bc3164953da7796a4198b58b5514655 Cr-Commit-Position: refs/heads/master@{#440240}

Patch Set 1 #

Patch Set 2 : Now with options #

Patch Set 3 : More documentation #

Patch Set 4 : Skip InvokeDefault on Mac #

Patch Set 5 : Rebase on native parent thingo #

Patch Set 6 : Better doc. Mac should pass now #

Patch Set 7 : Remove no longer used switches #

Patch Set 8 : Add kEnablePixelOutputInTests #

Total comments: 54

Patch Set 9 : Respond to comments #

Total comments: 15

Patch Set 10 : Respond to comments #

Patch Set 11 : constexpr const it is #

Total comments: 7

Patch Set 12 : Split out browsertest into browsertest.cc #

Total comments: 3

Patch Set 13 : Overhaul #

Total comments: 4

Patch Set 14 : Comment example. Use TestNameWithoutDisabledPrefix #

Unified diffs Side-by-side diffs Delta from patch set Stats (+328 lines, -22 lines) Patch
M base/test/test_timeouts.h View 1 2 3 4 5 6 7 8 9 10 1 chunk +3 lines, -0 lines 0 comments Download
M base/test/test_timeouts.cc View 1 2 3 4 5 6 7 8 9 10 2 chunks +7 lines, -1 line 0 comments Download
M chrome/browser/ui/autofill/card_unmask_prompt_view_browsertest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 7 chunks +17 lines, -20 lines 0 comments Download
A chrome/browser/ui/test/browser_dialog_browsertest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +74 lines, -0 lines 0 comments Download
A chrome/browser/ui/test/test_browser_dialog.h View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +100 lines, -0 lines 0 comments Download
A chrome/browser/ui/test/test_browser_dialog.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +110 lines, -0 lines 0 comments Download
M chrome/test/BUILD.gn View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +3 lines, -0 lines 0 comments Download
M ui/base/test/material_design_controller_test_api.h View 1 2 3 4 5 6 7 8 1 chunk +5 lines, -0 lines 0 comments Download
M ui/base/test/material_design_controller_test_api.cc View 1 2 3 4 5 6 7 8 1 chunk +9 lines, -1 line 0 comments Download

Messages

Total messages: 101 (73 generated)
tapted
Hi Peter, please take a look. I think you're a good reviewer for this - ...
4 years ago (2016-11-29 11:58:10 UTC) #26
Peter Kasting
Let me see if I'm on the same page as you by restating what you ...
4 years ago (2016-11-30 00:08:24 UTC) #27
tapted
On 2016/11/30 00:08:24, Peter Kasting wrote: > Let me see if I'm on the same ...
4 years ago (2016-11-30 00:56:08 UTC) #28
tapted
I've fleshed out some documentation and make a kind of design doc at https://goo.gl/ynxx1l (currently ...
4 years ago (2016-12-06 06:03:23 UTC) #31
tapted
Hi Peter, PTAL. I think this is ready for review. Feedback on the doc (https://goo.gl/ynxx1l) ...
4 years ago (2016-12-14 11:36:05 UTC) #38
Peter Kasting
https://codereview.chromium.org/2532793002/diff/160001/chrome/browser/ui/autofill/card_unmask_prompt_view_browsertest.cc File chrome/browser/ui/autofill/card_unmask_prompt_view_browsertest.cc (right): https://codereview.chromium.org/2532793002/diff/160001/chrome/browser/ui/autofill/card_unmask_prompt_view_browsertest.cc#newcode98 chrome/browser/ui/autofill/card_unmask_prompt_view_browsertest.cc:98: // InProcessBrowserTest: Nit: You don't directly subclass InProcessBrowserTest (or ...
4 years ago (2016-12-15 00:28:56 UTC) #39
tapted
https://codereview.chromium.org/2532793002/diff/160001/chrome/browser/ui/autofill/card_unmask_prompt_view_browsertest.cc File chrome/browser/ui/autofill/card_unmask_prompt_view_browsertest.cc (right): https://codereview.chromium.org/2532793002/diff/160001/chrome/browser/ui/autofill/card_unmask_prompt_view_browsertest.cc#newcode98 chrome/browser/ui/autofill/card_unmask_prompt_view_browsertest.cc:98: // InProcessBrowserTest: On 2016/12/15 00:28:54, Peter Kasting wrote: > ...
4 years ago (2016-12-15 06:08:23 UTC) #44
Peter Kasting
LGTM https://codereview.chromium.org/2532793002/diff/160001/chrome/browser/ui/test/test_browser_dialog.cc File chrome/browser/ui/test/test_browser_dialog.cc (right): https://codereview.chromium.org/2532793002/diff/160001/chrome/browser/ui/test/test_browser_dialog.cc#newcode120 chrome/browser/ui/test/test_browser_dialog.cc:120: if (!command_line.HasSwitch(switches::kExtendMdToSecondaryUi)) On 2016/12/15 06:08:22, tapted wrote: > ...
4 years ago (2016-12-15 08:12:29 UTC) #45
tapted
Took a few attempts to get the right incantation for MSVC: I thought "constexpr const" ...
4 years ago (2016-12-16 04:21:54 UTC) #52
tapted
+ Paweł for base/test OWNERS
4 years ago (2016-12-16 04:23:32 UTC) #54
Peter Kasting
https://codereview.chromium.org/2532793002/diff/180001/base/test/test_timeouts.h File base/test/test_timeouts.h (right): https://codereview.chromium.org/2532793002/diff/180001/base/test/test_timeouts.h#newcode17 base/test/test_timeouts.h:17: static const char kNoTimeoutSwitchValue[]; On 2016/12/16 04:21:53, tapted wrote: ...
4 years ago (2016-12-16 06:30:56 UTC) #57
Paweł Hajdan Jr.
https://codereview.chromium.org/2532793002/diff/220001/chrome/browser/ui/test/test_browser_dialog.cc File chrome/browser/ui/test/test_browser_dialog.cc (right): https://codereview.chromium.org/2532793002/diff/220001/chrome/browser/ui/test/test_browser_dialog.cc#newcode207 chrome/browser/ui/test/test_browser_dialog.cc:207: base::LaunchProcess(command, options); Whoa, this looks quite nontrivial. Do you ...
4 years ago (2016-12-16 20:14:29 UTC) #58
Peter Kasting
https://codereview.chromium.org/2532793002/diff/220001/chrome/browser/ui/test/test_browser_dialog.cc File chrome/browser/ui/test/test_browser_dialog.cc (right): https://codereview.chromium.org/2532793002/diff/220001/chrome/browser/ui/test/test_browser_dialog.cc#newcode207 chrome/browser/ui/test/test_browser_dialog.cc:207: base::LaunchProcess(command, options); On 2016/12/16 20:14:29, Paweł Hajdan Jr. wrote: ...
4 years ago (2016-12-17 03:53:29 UTC) #59
tapted
https://codereview.chromium.org/2532793002/diff/220001/chrome/browser/ui/test/test_browser_dialog.cc File chrome/browser/ui/test/test_browser_dialog.cc (right): https://codereview.chromium.org/2532793002/diff/220001/chrome/browser/ui/test/test_browser_dialog.cc#newcode207 chrome/browser/ui/test/test_browser_dialog.cc:207: base::LaunchProcess(command, options); On 2016/12/17 03:53:28, Peter Kasting wrote: > ...
4 years ago (2016-12-19 01:56:11 UTC) #65
Paweł Hajdan Jr.
+jam Thanks for providing more context. Have all concerns from the design doc been resolved? ...
4 years ago (2016-12-19 18:54:59 UTC) #67
tapted
On 2016/12/19 18:54:59, Paweł Hajdan Jr. wrote: > +jam > > Thanks for providing more ...
4 years ago (2016-12-19 22:21:26 UTC) #68
jam
I glanced through the cl and looked at the design doc. My main question is ...
4 years ago (2016-12-20 00:17:57 UTC) #69
Peter Kasting
https://codereview.chromium.org/2532793002/diff/240001/base/test/test_timeouts.h File base/test/test_timeouts.h (right): https://codereview.chromium.org/2532793002/diff/240001/base/test/test_timeouts.h#newcode17 base/test/test_timeouts.h:17: static constexpr const char kNoTimeoutSwitchValue[] = "-1"; On 2016/12/20 ...
4 years ago (2016-12-20 00:24:23 UTC) #70
tapted
On 2016/12/20 00:17:57, jam wrote: > I glanced through the cl and looked at the ...
4 years ago (2016-12-20 00:25:17 UTC) #71
jam
On 2016/12/20 00:25:17, tapted wrote: > On 2016/12/20 00:17:57, jam wrote: > > I glanced ...
4 years ago (2016-12-20 01:12:33 UTC) #72
tapted
PTAL - ditched the macro. And the whole NameProvider() thing. The framework now hunts for ...
4 years ago (2016-12-20 04:06:35 UTC) #79
Paweł Hajdan Jr.
+dpranke for further infra considerations I think the CL is moving in the right direction. ...
4 years ago (2016-12-20 16:27:15 UTC) #83
jam
Thanks, this looks more straightforward now with the removal of the macro. lgtm My one ...
4 years ago (2016-12-20 17:10:57 UTC) #84
tapted
On 2016/12/20 17:10:57, jam wrote: > My one question is: why is the "name" parameter ...
4 years ago (2016-12-20 23:34:47 UTC) #90
Paweł Hajdan Jr.
LGTM
4 years ago (2016-12-21 21:45:36 UTC) #93
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/2532793002/320001
4 years ago (2016-12-21 22:16:41 UTC) #96
commit-bot: I haz the power
Committed patchset #14 (id:320001)
4 years ago (2016-12-21 22:24:11 UTC) #99
commit-bot: I haz the power
4 years ago (2016-12-21 22:26:03 UTC) #101
Message was sent while issue was closed.
Patchset 14 (id:??) landed as
https://crrev.com/658e7bd30bc3164953da7796a4198b58b5514655
Cr-Commit-Position: refs/heads/master@{#440240}

Powered by Google App Engine
This is Rietveld 408576698