Dana Fried | 005eebdf | 2025-06-03 16:29:36 | [diff] [blame] | 1 | # Testing Chrome browser UI with Pixel Tests |
tapted | f38739a | 2017-02-09 04:34:52 | [diff] [blame] | 2 | |
Dana Fried | 005eebdf | 2025-06-03 16:29:36 | [diff] [blame] | 3 | Pixel Tests compare one or more screenshots with already-approved images using |
| 4 | [Skia Gold](/docs/ui/learn/glossary.md#skia-gold). They guarantee that the UI |
| 5 | does not change its appearance unexpectedly and are a good addition to a |
| 6 | portfolio of regression tests. |
tapted | f38739a | 2017-02-09 04:34:52 | [diff] [blame] | 7 | |
Dana Fried | 005eebdf | 2025-06-03 16:29:36 | [diff] [blame] | 8 | There are two ways that pixel tests can be written: |
| 9 | - Kombucha, using the `Screenshot` test verbs (preferred) |
| 10 | - Using the `TestBrowserUi` API (provided for legacy support; do not use) |
tapted | f38739a | 2017-02-09 04:34:52 | [diff] [blame] | 11 | |
| 12 | [TOC] |
| 13 | |
Dana Fried | 005eebdf | 2025-06-03 16:29:36 | [diff] [blame] | 14 | ## Common Requirements |
tapted | f38739a | 2017-02-09 04:34:52 | [diff] [blame] | 15 | |
Dana Fried | 005eebdf | 2025-06-03 16:29:36 | [diff] [blame] | 16 | All pixel tests must be placed in |
| 17 | [pixel_tests.filter](/testing/buildbot/filters/pixel_tests.filter). |
| 18 | |
| 19 | Tests in `browser_tests` will also be run in the `pixel_browser_tests` job on |
| 20 | eligible builders. Tests in `interactive_ui_tests` will also be run in the |
| 21 | `pixel_interactive_ui_tests` job on eligible builders. |
| 22 | |
| 23 | ### Baseline CLs |
| 24 | |
| 25 | All methods of taking screenshots allow you to set a baseline CL. This ensures |
| 26 | that old expected images are thrown away when the UI is modified. If the |
| 27 | baseline were not set, a regression that caused some new UI to appear might pass |
| 28 | a pixel test because it matched an older version of the UI surface. |
| 29 | |
| 30 | The procedure for baseline CLs is: |
| 31 | 1. Put in a placeholder string. |
| 32 | 1. Upload your CL to Gerrit. |
| 33 | 1. Find the number of your new CL (e.g. from the URL) |
| 34 | 1. Replace the placeholder with the number. |
| 35 | 1. Re-upload the CL. |
| 36 | |
| 37 | ### Running Tests Locally |
| 38 | |
| 39 | To run a pixel test locally, use: |
| 40 | ```sh |
| 41 | test_executable --gtest_filter=Test.Name --browser-ui-tests-verify-pixels --enable-pixel-output-in-tests --test-launcher-retry-limit=0 |
| 42 | ``` |
| 43 | Where `<test_executable>` is either `browser_tests` or `interactive_ui_tests`, |
| 44 | and `<Test.Name>` is the full name of your test, with dot. |
| 45 | |
| 46 | If you want to see UI as it's being screenshot, replace |
| 47 | `--enable-pixel-output-in-tests` with `--test-launcher-interactive` - this will |
| 48 | freeze the test just after the screenshot is taken. Dismiss the UI to continue |
| 49 | the test. |
| 50 | |
| 51 | ### Diagnosing Test Failures |
| 52 | |
| 53 | Failed pixel tests will have a URL link to Skia Gold in the test output through |
| 54 | which you can view the expected and actual screenshot images. Log in and either |
| 55 | accept or reject images that do not match the baseline. Once you've accepted a |
| 56 | new image, future tests that produce the same output won't fail. |
| 57 | |
| 58 | ## Writing Pixel Tests with Kombucha |
| 59 | |
| 60 | [Kombucha](/chrome/test/interaction/README.md) tests use a declarative syntax to |
| 61 | perform interaction testing on the browser. They are the preferred way to create |
| 62 | end-to-end interaction and critical user journey regression tests for Chrome |
| 63 | Desktop. |
| 64 | |
| 65 | Nearly all Kombucha tests can derive directly from |
| 66 | [InteractiveBrowserTest](/chrome/test/interaction/interactive_browser_test.h). |
| 67 | `InteractiveBrowserTest` is a strict superset of `InProcessBrowserTest` so it is |
| 68 | usually safe to simply swap one for the other. |
| 69 | |
| 70 | ### Taking Screenshots |
| 71 | |
| 72 | To use Kombucha to pixel-test UI, use the `Screenshot` or `ScreenshotSurface` |
| 73 | verb. Because these tests will also be run in non-pixel-test mode, you will need |
| 74 | to precede the first screenshot with `SetOnIncompatibleAction()` with an option |
| 75 | other than `kFailTest` (which is the default). |
| 76 | |
| 77 | The `Screenshot` verb takes a picture of _exactly the UI element specified_. |
| 78 | |
| 79 | The `ScreenshotSurface` verb takes a picture of the entire dialog or window |
| 80 | containing the element. Be careful not to capture other elements that are likely |
| 81 | to change on their own! |
| 82 | |
| 83 | Example: |
| 84 | |
| 85 | ```cpp |
| 86 | // Inherit from InteractiveBrowserTest[Api]: |
| 87 | class MyNewDialogUiTest : public InteractiveBrowserTest { ... }; |
| 88 | |
| 89 | // Baseline Gerrit CL number of the most recent CL that modified the UI. |
| 90 | constexpr char kScreenshotBaselineCL[] = "12345678"; |
| 91 | |
| 92 | // Screenshot the feature's entrypoint button, then click it, wait for the |
| 93 | // feature's dialog, then screenshot the entire dialog. |
| 94 | IN_PROC_BROWSER_TEST_F(MyNewDialogUiTest, OpenAndVerifyContents) { |
| 95 | RunTestSequence( |
| 96 | SetOnIncompatibleAction( |
| 97 | OnIncompatibleAction::kIgnoreAndContinue |
| 98 | "Screenshots not supported in all testing environments."), |
| 99 | |
| 100 | // Grab a screenshot of the toolbar button that is the entry point for the feature. |
| 101 | Screenshot(kMyNewToolbarButtonElementId, |
| 102 | /*screenshot_name=*/"entry_point", |
| 103 | /*baseline_cl=*/kScreenshotBaselineCL) |
| 104 | |
| 105 | PressButton(kMyNewToolbarButtonElementId), |
| 106 | |
| 107 | WaitForShow(MyNewDialog::kDialogElementId), |
| 108 | |
| 109 | // Grab a screenshot of the entire dialog that pops up. |
| 110 | ScreenshotSurface(MyNewDialog::kDialogElementId, |
| 111 | /*screenshot_name=*/"whole_dialog", |
| 112 | /*baseline_cl=*/kScreenshotBaselineCL)); |
| 113 | } |
| 114 | ``` |
| 115 | |
| 116 | Note that a test can take multiple screenshots; they must have unique names. In |
| 117 | the above example, `entry_point` and `whole_dialog` will be treated as two |
| 118 | separate screenshots to be compared against separate Skia Gold masters. |
| 119 | |
| 120 | ## Writing Pixel Tests with TestBrowserUi |
| 121 | |
| 122 | `UiBrowserTest` and `DialogBrowserTest` provide an alternate (and older) method |
| 123 | of capturing a surface for pixel testing. These are also base classes your test |
| 124 | harness needs to inherit from, and also replace `InProcessBrowserTest`. |
| 125 | |
| 126 | For example, assume the existing |
Peter Kasting | cf49b7b79 | 2017-12-18 23:27:45 | [diff] [blame] | 127 | `InProcessBrowserTest` is in `foo_browsertest.cc`: |
Dana Fried | 005eebdf | 2025-06-03 16:29:36 | [diff] [blame] | 128 | ``` |
Peter Kasting | cf49b7b79 | 2017-12-18 23:27:45 | [diff] [blame] | 129 | class FooUiTest : public InProcessBrowserTest { ... |
Dana Fried | 005eebdf | 2025-06-03 16:29:36 | [diff] [blame] | 130 | ``` |
Peter Kasting | cf49b7b79 | 2017-12-18 23:27:45 | [diff] [blame] | 131 | Change this to inherit from `DialogBrowserTest` (for dialogs) or `UiBrowserTest` |
| 132 | (for non-dialogs), and override `ShowUi(std::string)`. For non-dialogs, also |
| 133 | override `VerifyUi()` and `WaitForUserDismissal()`. See |
| 134 | [Advanced Usage](#Advanced-Usage) for details. |
tapted | f38739a | 2017-02-09 04:34:52 | [diff] [blame] | 135 | |
| 136 | ```cpp |
Peter Kasting | cf49b7b79 | 2017-12-18 23:27:45 | [diff] [blame] | 137 | class FooUiTest : public UiBrowserTest { |
tapted | f38739a | 2017-02-09 04:34:52 | [diff] [blame] | 138 | public: |
| 139 | .. |
Peter Kasting | cf49b7b79 | 2017-12-18 23:27:45 | [diff] [blame] | 140 | // UiBrowserTest: |
| 141 | void ShowUi(const std::string& name) override { |
| 142 | /* Show Ui attached to browser() and leave it open. */ |
| 143 | } |
| 144 | // These next two are not necessary if subclassing DialogBrowserTest. |
| 145 | bool VerifyUi() override { |
| 146 | /* Return true if the UI was successfully shown. */ |
| 147 | } |
| 148 | void WaitForUserDismissal() override { |
| 149 | /* Block until the UI has been dismissed. */ |
tapted | f38739a | 2017-02-09 04:34:52 | [diff] [blame] | 150 | } |
| 151 | .. |
| 152 | }; |
| 153 | ``` |
| 154 | |
Peter Kasting | cf49b7b79 | 2017-12-18 23:27:45 | [diff] [blame] | 155 | Finally, add test invocations using the usual GTest macros, in |
| 156 | `foo_browsertest.cc`: |
tapted | f38739a | 2017-02-09 04:34:52 | [diff] [blame] | 157 | |
| 158 | ```cpp |
Peter Kasting | cf49b7b79 | 2017-12-18 23:27:45 | [diff] [blame] | 159 | IN_PROC_BROWSER_TEST_F(FooUiTest, InvokeUi_default) { |
| 160 | ShowAndVerifyUi(); |
tapted | f38739a | 2017-02-09 04:34:52 | [diff] [blame] | 161 | } |
| 162 | ``` |
| 163 | |
| 164 | Notes: |
| 165 | |
Peter Kasting | cf49b7b79 | 2017-12-18 23:27:45 | [diff] [blame] | 166 | * The body of the test is always just "`ShowAndVerifyUi();`". |
| 167 | * "`default`" is the `std::string` passed to `ShowUi()` and can be |
tapted | f38739a | 2017-02-09 04:34:52 | [diff] [blame] | 168 | customized. See |
Peter Kasting | cf49b7b79 | 2017-12-18 23:27:45 | [diff] [blame] | 169 | [Testing additional UI "styles"](#Testing-additional-ui-styles). |
| 170 | * The text before `default` (in this case) must always be "`InvokeUi_`". |
tapted | f38739a | 2017-02-09 04:34:52 | [diff] [blame] | 171 | |
| 172 | ### Concrete examples |
| 173 | |
| 174 | * [chrome/browser/ui/ask_google_for_suggestions_dialog_browsertest.cc] |
Peter Kasting | cf49b7b79 | 2017-12-18 23:27:45 | [diff] [blame] | 175 | * [chrome/browser/infobars/infobars_browsertest.cc] |
tapted | f38739a | 2017-02-09 04:34:52 | [diff] [blame] | 176 | |
Dana Fried | 005eebdf | 2025-06-03 16:29:36 | [diff] [blame] | 177 | ### Running the tests |
tapted | f38739a | 2017-02-09 04:34:52 | [diff] [blame] | 178 | |
Dana Fried | 005eebdf | 2025-06-03 16:29:36 | [diff] [blame] | 179 | List the available `TestBrowserUi` tests: |
tapted | f38739a | 2017-02-09 04:34:52 | [diff] [blame] | 180 | |
Peter Kasting | cf49b7b79 | 2017-12-18 23:27:45 | [diff] [blame] | 181 | $ ./browser_tests --gtest_filter=BrowserUiTest.Invoke |
Keren Zhu | 1f7b99da | 2023-10-04 23:47:32 | [diff] [blame] | 182 | $ ./interactive_ui_tests --gtest_filter=BrowserInteractiveUiTest.Invoke |
tapted | f38739a | 2017-02-09 04:34:52 | [diff] [blame] | 183 | |
Peter Kasting | cf49b7b79 | 2017-12-18 23:27:45 | [diff] [blame] | 184 | E.g. `FooUiTest.InvokeUi_default` should be listed. To show the UI |
tapted | f38739a | 2017-02-09 04:34:52 | [diff] [blame] | 185 | interactively, run |
| 186 | |
Keren Zhu | 1f7b99da | 2023-10-04 23:47:32 | [diff] [blame] | 187 | # If FooUiTest is a browser test. |
Peter Boström | e2732ef | 2018-02-21 21:53:24 | [diff] [blame] | 188 | $ ./browser_tests --gtest_filter=BrowserUiTest.Invoke \ |
| 189 | --test-launcher-interactive --ui=FooUiTest.InvokeUi_default |
tapted | f38739a | 2017-02-09 04:34:52 | [diff] [blame] | 190 | |
Keren Zhu | 1f7b99da | 2023-10-04 23:47:32 | [diff] [blame] | 191 | # If FooUiTest is an interactive UI test. |
| 192 | $ ./interactive_ui_tests --gtest_filter=BrowserInteractiveUiTest.Invoke \ |
| 193 | --test-launcher-interactive --ui=FooUiTest.InvokeUi_default |
| 194 | |
tapted | f38739a | 2017-02-09 04:34:52 | [diff] [blame] | 195 | ### Implementation |
| 196 | |
Peter Kasting | cf49b7b79 | 2017-12-18 23:27:45 | [diff] [blame] | 197 | `BrowserUiTest.Invoke` searches for gtests that have "`InvokeUi_`" in their |
| 198 | names, so they can be collected in a list. Providing a `--ui` argument will |
Peter Boström | e2732ef | 2018-02-21 21:53:24 | [diff] [blame] | 199 | invoke that test case in a subprocess. Including `--test-launcher-interactive` |
| 200 | will set up an environment for that subprocess that allows interactivity, e.g., |
| 201 | to take screenshots. The test ends once the UI is dismissed. |
tapted | f38739a | 2017-02-09 04:34:52 | [diff] [blame] | 202 | |
Peter Kasting | cf49b7b79 | 2017-12-18 23:27:45 | [diff] [blame] | 203 | The `FooUiTest.InvokeUi_default` test case **will still be run in the usual |
| 204 | browser_tests test suite**. Ensure it passes, and isn’t flaky. This will |
| 205 | give your UI some regression test coverage. `ShowAndVerifyUi()` checks to ensure |
| 206 | UI is actually created when it invokes `ShowUi("default")`. |
tapted | f38739a | 2017-02-09 04:34:52 | [diff] [blame] | 207 | |
Keren Zhu | 1f7b99da | 2023-10-04 23:47:32 | [diff] [blame] | 208 | `BrowserInteractiveUiTest` is the equivalent of `BrowserUiTest` for |
| 209 | interactive_ui_tests. |
| 210 | |
Peter Kasting | cf49b7b79 | 2017-12-18 23:27:45 | [diff] [blame] | 211 | ### BrowserUiTest.Invoke |
tapted | f38739a | 2017-02-09 04:34:52 | [diff] [blame] | 212 | |
| 213 | This is also run in browser_tests but, when run that way, the test case just |
| 214 | lists the registered test harnesses (it does *not* iterate over them). A |
Peter Kasting | cf49b7b79 | 2017-12-18 23:27:45 | [diff] [blame] | 215 | subprocess is never created unless --ui is passed on the command line. |
tapted | f38739a | 2017-02-09 04:34:52 | [diff] [blame] | 216 | |
| 217 | ## Advanced Usage |
| 218 | |
| 219 | If your test harness inherits from a descendant of `InProcessBrowserTest` (one |
Peter Kasting | cf49b7b79 | 2017-12-18 23:27:45 | [diff] [blame] | 220 | example: [ExtensionBrowserTest]) then the `SupportsTestUi<>` and |
| 221 | `SupportsTestDialog` templates are provided. E.g. |
tapted | f38739a | 2017-02-09 04:34:52 | [diff] [blame] | 222 | |
| 223 | ```cpp |
| 224 | class ExtensionInstallDialogViewTestBase : public ExtensionBrowserTest { ... |
| 225 | ``` |
| 226 | |
| 227 | becomes |
| 228 | |
| 229 | ```cpp |
| 230 | class ExtensionInstallDialogViewTestBase : |
| 231 | public SupportsTestDialog<ExtensionBrowserTest> { ... |
| 232 | ``` |
| 233 | |
Peter Kasting | cf49b7b79 | 2017-12-18 23:27:45 | [diff] [blame] | 234 | If you need to do any setup before `ShowUi()` is called, or any teardown in the |
| 235 | non-interactive case, you can override the `PreShow()` and `DismissUi() |
| 236 | methods. |
tapted | f38739a | 2017-02-09 04:34:52 | [diff] [blame] | 237 | |
Peter Kasting | cf49b7b79 | 2017-12-18 23:27:45 | [diff] [blame] | 238 | ### Testing additional UI "styles" |
| 239 | |
| 240 | Add additional test cases, with a different string after "`InvokeUi_`". |
tapted | f38739a | 2017-02-09 04:34:52 | [diff] [blame] | 241 | Example: |
| 242 | |
| 243 | ```cpp |
Peter Kasting | cf49b7b79 | 2017-12-18 23:27:45 | [diff] [blame] | 244 | IN_PROC_BROWSER_TEST_F(CardUnmaskViewBrowserTest, InvokeUi_expired) { |
| 245 | ShowAndVerifyUi(); |
tapted | f38739a | 2017-02-09 04:34:52 | [diff] [blame] | 246 | } |
| 247 | |
Peter Kasting | cf49b7b79 | 2017-12-18 23:27:45 | [diff] [blame] | 248 | IN_PROC_BROWSER_TEST_F(CardUnmaskViewBrowserTest, InvokeUi_valid) { |
| 249 | ShowAndVerifyUi(); |
tapted | f38739a | 2017-02-09 04:34:52 | [diff] [blame] | 250 | } |
| 251 | ``` |
| 252 | |
| 253 | The strings "`expired`" or “`valid`” will be given as arguments to |
Peter Kasting | cf49b7b79 | 2017-12-18 23:27:45 | [diff] [blame] | 254 | `ShowUi(std::string)`. |
tapted | f38739a | 2017-02-09 04:34:52 | [diff] [blame] | 255 | |
| 256 | ## Rationale |
| 257 | |
| 258 | Bug reference: [Issue 654151](http://crbug.com/654151). |
| 259 | |
Peter Kasting | cf49b7b79 | 2017-12-18 23:27:45 | [diff] [blame] | 260 | Chrome has a lot of browser UI; often for obscure use-cases and often hard to |
| 261 | invoke. It has traditionally been difficult to be systematic while checking UI |
| 262 | for possible regressions. For example, to investigate changes to shared layout |
| 263 | parameters which are testable only with visual inspection. |
tapted | f38739a | 2017-02-09 04:34:52 | [diff] [blame] | 264 | |
| 265 | For Chrome UI review, screenshots need to be taken. Iterating over all the |
Peter Kasting | cf49b7b79 | 2017-12-18 23:27:45 | [diff] [blame] | 266 | "styles" that UI may appear with is fiddly. E.g. a login or particular web |
tapted | f38739a | 2017-02-09 04:34:52 | [diff] [blame] | 267 | server setup may be required. It’s important to provide a consistent “look” for |
| 268 | UI review (e.g. same test data, same browser size, anchoring position, etc.). |
| 269 | |
Peter Kasting | cf49b7b79 | 2017-12-18 23:27:45 | [diff] [blame] | 270 | Some UI lacks tests. Some UI has zero coverage on the bots. UI elements can have |
| 271 | tricky lifetimes and common mistakes are repeated. TestBrowserUi runs simple |
| 272 | "Show UI" regression tests and can be extended to do more. |
tapted | f38739a | 2017-02-09 04:34:52 | [diff] [blame] | 273 | |
Peter Kasting | cf49b7b79 | 2017-12-18 23:27:45 | [diff] [blame] | 274 | Even discovering the full set of UI present for each platform in Chrome is |
tapted | f38739a | 2017-02-09 04:34:52 | [diff] [blame] | 275 | [difficult](http://crbug.com/686239). |
| 276 | |
| 277 | ### Why browser_tests? |
| 278 | |
| 279 | * `browser_tests` already provides a `browser()->window()` of a consistent |
| 280 | size that can be used as a dialog anchor and to take screenshots for UI |
| 281 | review. |
| 282 | * UI review have requested that screenshots be provided with the entire |
Peter Kasting | cf49b7b79 | 2017-12-18 23:27:45 | [diff] [blame] | 283 | browser window so that the relative size of the UI element/change under |
tapted | f38739a | 2017-02-09 04:34:52 | [diff] [blame] | 284 | review can be assessed. |
| 285 | |
Peter Kasting | cf49b7b79 | 2017-12-18 23:27:45 | [diff] [blame] | 286 | * Some UI already has a test harness with appropriate setup (e.g. test data) |
| 287 | running in browser_tests. |
| 288 | * Supporting `BrowserUiTest` should require minimal setup and minimal |
tapted | f38739a | 2017-02-09 04:34:52 | [diff] [blame] | 289 | ongoing maintenance. |
| 290 | |
| 291 | * An alternative is to maintain a working end-to-end build target executable |
| 292 | to do this, but this has additional costs (and is hard). |
Peter Kasting | c6fd7f2d | 2020-03-10 21:21:08 | [diff] [blame] | 293 | * E.g. setup/teardown of low-level functions |
| 294 | (`InitializeGLOneOffPlatform()`, etc.). |
tapted | f38739a | 2017-02-09 04:34:52 | [diff] [blame] | 295 | |
| 296 | * Why not chrome.exe? |
Peter Kasting | cf49b7b79 | 2017-12-18 23:27:45 | [diff] [blame] | 297 | * E.g. a scrappy chrome:// page with links to invoke UI would be great! |
tapted | f38739a | 2017-02-09 04:34:52 | [diff] [blame] | 298 | * But... |
Peter Kasting | cf49b7b79 | 2017-12-18 23:27:45 | [diff] [blame] | 299 | * UI may have test data (e.g. credit card info) which shouldn’t be in |
| 300 | the release build. |
| 301 | * UI may use EmbeddedTestServer. |
tapted | f38739a | 2017-02-09 04:34:52 | [diff] [blame] | 302 | * Higher maintenance cost - can’t leverage existing test harnesses. |
| 303 | |
| 304 | ## Future Work |
| 305 | |
Peter Kasting | cf49b7b79 | 2017-12-18 23:27:45 | [diff] [blame] | 306 | * Opt in more UI! |
| 307 | * Eventually, all of it. |
tapted | f38739a | 2017-02-09 04:34:52 | [diff] [blame] | 308 | |
| 309 | * Automatically generate screenshots (for each platform, in various languages) |
| 310 | * Build upon [CL 2008283002](https://codereview.chromium.org/2008283002/) |
| 311 | |
| 312 | * (maybe) Try removing the subprocess |
| 313 | * Probably requires altering the browser_test suite code directly rather |
| 314 | than just adding a test case as in the current approach |
| 315 | |
Peter Kasting | cf49b7b79 | 2017-12-18 23:27:45 | [diff] [blame] | 316 | * Find obscure workflows for invoking UI that has no test coverage and causes |
| 317 | crashes (e.g. [http://crrev.com/426302](http://crrev.com/426302)) |
tapted | f38739a | 2017-02-09 04:34:52 | [diff] [blame] | 318 | * Supporting window-modal dialogs with a null parent window. |
| 319 | |
| 320 | * Find memory leaks, e.g. [http://crrev.com/432320](http://crrev.com/432320) |
| 321 | * "Fix memory leak for extension uninstall dialog". |
| 322 | |
| 323 | ## Appendix: Sample output |
| 324 | |
Peter Kasting | cf49b7b79 | 2017-12-18 23:27:45 | [diff] [blame] | 325 | **$ ./out/gn_Debug/browser_tests --gtest_filter=BrowserUiTest.Invoke** |
tapted | f38739a | 2017-02-09 04:34:52 | [diff] [blame] | 326 | ``` |
Peter Kasting | cf49b7b79 | 2017-12-18 23:27:45 | [diff] [blame] | 327 | Note: Google Test filter = BrowserUiTest.Invoke |
tapted | f38739a | 2017-02-09 04:34:52 | [diff] [blame] | 328 | [==========] Running 1 test from 1 test case. |
| 329 | [----------] Global test environment set-up. |
Peter Kasting | cf49b7b79 | 2017-12-18 23:27:45 | [diff] [blame] | 330 | [----------] 1 test from BrowserUiTest |
| 331 | [ RUN ] BrowserUiTest.Invoke |
| 332 | [26879:775:0207/134949.118352:30434675...:INFO:browser_ui_browsertest.cc(46) |
| 333 | Pass one of the following after --ui= |
| 334 | AppInfoDialogBrowserTest.InvokeUi_default |
| 335 | AskGoogleForSuggestionsDialogTest.DISABLED_InvokeUi_default |
| 336 | BluetoothChooserBrowserTest.InvokeUi_ConnectedBubble |
| 337 | BluetoothChooserBrowserTest.InvokeUi_ConnectedModal |
| 338 | /* and many more */ |
| 339 | [ OK ] BrowserUiTest.Invoke (0 ms) |
| 340 | [----------] 1 test from BrowserUiTest (0 ms total) |
tapted | f38739a | 2017-02-09 04:34:52 | [diff] [blame] | 341 | [----------] Global test environment tear-down |
| 342 | [==========] 1 test from 1 test case ran. (1 ms total) |
| 343 | [ PASSED ] 1 test. |
Peter Kasting | cf49b7b79 | 2017-12-18 23:27:45 | [diff] [blame] | 344 | [1/1] BrowserUiTest.Invoke (334 ms) |
tapted | f38739a | 2017-02-09 04:34:52 | [diff] [blame] | 345 | SUCCESS: all tests passed. |
| 346 | ``` |
| 347 | |
Peter Kasting | cf49b7b79 | 2017-12-18 23:27:45 | [diff] [blame] | 348 | **$ ./out/gn_Debug/browser_tests --gtest_filter=BrowserUiTest.Invoke |
| 349 | --ui=CardUnmaskPromptViewBrowserTest.InvokeUi_expired** |
tapted | f38739a | 2017-02-09 04:34:52 | [diff] [blame] | 350 | |
| 351 | ``` |
Peter Kasting | cf49b7b79 | 2017-12-18 23:27:45 | [diff] [blame] | 352 | Note: Google Test filter = BrowserUiTest.Invoke |
tapted | f38739a | 2017-02-09 04:34:52 | [diff] [blame] | 353 | [==========] Running 1 test from 1 test case. |
| 354 | [----------] Global test environment set-up. |
Peter Kasting | cf49b7b79 | 2017-12-18 23:27:45 | [diff] [blame] | 355 | [----------] 1 test from BrowserUiTest |
| 356 | [ RUN ] BrowserUiTest.Invoke |
tapted | f38739a | 2017-02-09 04:34:52 | [diff] [blame] | 357 | Note: Google Test filter = CardUnmaskPromptViewBrowserTest.InvokeDefault |
| 358 | [==========] Running 1 test from 1 test case. |
| 359 | [----------] Global test environment set-up. |
| 360 | [----------] 1 test from CardUnmaskPromptViewBrowserTest, where TypeParam = |
Peter Kasting | cf49b7b79 | 2017-12-18 23:27:45 | [diff] [blame] | 361 | [ RUN ] CardUnmaskPromptViewBrowserTest.InvokeUi_expired |
tapted | f38739a | 2017-02-09 04:34:52 | [diff] [blame] | 362 | /* 7 lines of uninteresting log spam */ |
Peter Kasting | cf49b7b79 | 2017-12-18 23:27:45 | [diff] [blame] | 363 | [ OK ] CardUnmaskPromptViewBrowserTest.InvokeUi_expired (1324 ms) |
tapted | f38739a | 2017-02-09 04:34:52 | [diff] [blame] | 364 | [----------] 1 test from CardUnmaskPromptViewBrowserTest (1324 ms total) |
| 365 | [----------] Global test environment tear-down |
| 366 | [==========] 1 test from 1 test case ran. (1325 ms total) |
| 367 | [ PASSED ] 1 test. |
Peter Kasting | cf49b7b79 | 2017-12-18 23:27:45 | [diff] [blame] | 368 | [ OK ] BrowserUiTest.Invoke (1642 ms) |
| 369 | [----------] 1 test from BrowserUiTest (1642 ms total) |
tapted | f38739a | 2017-02-09 04:34:52 | [diff] [blame] | 370 | [----------] Global test environment tear-down |
| 371 | [==========] 1 test from 1 test case ran. (1642 ms total) |
| 372 | [ PASSED ] 1 test. |
Peter Kasting | cf49b7b79 | 2017-12-18 23:27:45 | [diff] [blame] | 373 | [1/1] BrowserUiTest.Invoke (2111 ms) |
tapted | f38739a | 2017-02-09 04:34:52 | [diff] [blame] | 374 | SUCCESS: all tests passed. |
| 375 | ``` |
| 376 | |
Peter Kasting | cf49b7b79 | 2017-12-18 23:27:45 | [diff] [blame] | 377 | **$ ./out/gn_Debug/browser_tests --gtest_filter=BrowserUiTest.Invoke |
Peter Boström | e2732ef | 2018-02-21 21:53:24 | [diff] [blame] | 378 | --ui=CardUnmaskPromptViewBrowserTest.InvokeUi_expired |
| 379 | --test-launcher-interactive** |
tapted | f38739a | 2017-02-09 04:34:52 | [diff] [blame] | 380 | ``` |
| 381 | /* |
| 382 | * Output as above, except the test are not interleaved, and the browser window |
Peter Kasting | cf49b7b79 | 2017-12-18 23:27:45 | [diff] [blame] | 383 | * should remain open until the UI is dismissed |
tapted | f38739a | 2017-02-09 04:34:52 | [diff] [blame] | 384 | */ |
| 385 | ``` |
| 386 | |
Peter Kasting | cf49b7b79 | 2017-12-18 23:27:45 | [diff] [blame] | 387 | [chrome/browser/ui/test/test_browser_ui.h]: https://cs.chromium.org/chromium/src/chrome/browser/ui/test/test_browser_ui.h |
tapted | f38739a | 2017-02-09 04:34:52 | [diff] [blame] | 388 | [chrome/browser/ui/test/test_browser_dialog.h]: https://cs.chromium.org/chromium/src/chrome/browser/ui/test/test_browser_dialog.h |
Peter Kasting | cf49b7b79 | 2017-12-18 23:27:45 | [diff] [blame] | 389 | [chrome/browser/ui/ask_google_for_suggestions_dialog_browsertest.cc]: https://cs.chromium.org/chromium/src/chrome/browser/ui/ask_google_for_suggestions_dialog_browsertest.cc?l=18&q=ShowUi |
| 390 | [chrome/browser/infobars/infobars_browsertest.cc]: https://cs.chromium.org/chromium/src/chrome/browser/infobars/infobars_browsertest.cc?l=134&q=UiBrowserTest |
tapted | f38739a | 2017-02-09 04:34:52 | [diff] [blame] | 391 | [ExtensionBrowserTest]: https://cs.chromium.org/chromium/src/chrome/browser/extensions/extension_browsertest.h?q=extensionbrowsertest&l=40 |