0

De-associate the headful mode with debugging

As we are planning to run the headful mode on CI to get performance
data, running in headful mode does not necessary mean debugging.

Add '--no-xvfb' to control if we do not want to start xvfb.

Bug: 1517496
Change-Id: Ia00b2ee0de380c2c8a835d9bce5c9eb71993f57b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5252105
Reviewed-by: Jonathan Lee <jonathanjlee@google.com>
Commit-Queue: Weizhong Xia <weizhong@google.com>
Cr-Commit-Position: refs/heads/main@{#1257627}
This commit is contained in:
Weizhong Xia
2024-02-07 22:47:33 +00:00
committed by Chromium LUCI CQ
parent 13e869ebf9
commit a53c19f563
5 changed files with 13 additions and 38 deletions
docs/testing
third_party/blink/tools/blinkpy

Binary file not shown.

Before

(image error) Size: 247 KiB

@ -88,16 +88,6 @@ To be updated.
## Debugging Support
### Headful Mode
Passing the `--no-headless` flag to `run_wpt_tests.py` will pause execution
after running each test headfully.
You can interact with the paused test page afterwards, including with DevTools:
![Testharness paused](images/web-tests/wptrunner-paused.jpg)
Closing the tab or window will unpause the testharness and run the next test.
### Text-Based Debuggers
To interactively debug WPTs, prefix the `run_wpt_tests.py` command with

@ -223,13 +223,12 @@ def add_configuration_options_group(parser: argparse.ArgumentParser,
group.add_argument('--chrome-branded',
action='store_true',
help='Set the configuration as chrome_branded.')
group.add_argument('--no-xvfb',
action='store_false',
dest='use_xvfb',
help='Do not run tests with Xvfb')
add_common_wpt_options(group)
if rwt:
group.add_argument('--no-xvfb',
action='store_false',
dest='use_xvfb',
help='Do not run tests with Xvfb')
else:
if not rwt:
group.add_argument(
'-p',
'--product',
@ -237,12 +236,10 @@ def add_configuration_options_group(parser: argparse.ArgumentParser,
choices=(product_choices or []),
metavar='PRODUCT',
help='Product (browser or browser component) to test.')
group.add_argument(
'--no-headless',
action='store_false',
dest='headless',
help=('Do not run the browser headlessly; pause after each test '
'until the window is closed. On Linux, do not start Xvfb.'))
group.add_argument('--no-headless',
action='store_false',
dest='headless',
help=('Do not run browser in headless mode.'))
group.add_argument('--webdriver-binary',
metavar='PATH',
type=str,

@ -69,9 +69,9 @@ class Product:
"""Product-specific wptrunner parameters needed to run tests."""
processes = self._options.child_processes
if not processes:
if self._options.wrapper or not self._options.headless:
if self._options.wrapper:
_log.info('Defaulting to 1 worker because of debugging '
'options (`--wrapper` or `--no-headless`)')
'option `--wrapper`')
processes = 1
else:
processes = self._port.default_child_processes()

@ -237,7 +237,8 @@ class WPTAdapter:
runner_options.no_capture_stdio = True
runner_options.manifest_download = False
runner_options.manifest_update = False
runner_options.headless = True
runner_options.pause_after_test = False
runner_options.headless = self.options.headless
# Set up logging as early as possible.
self._set_up_runner_output_options(runner_options)
@ -376,15 +377,6 @@ class WPTAdapter:
'127.0.0.1.pem')
def _set_up_runner_debugging_options(self, runner_options):
self.port.set_option_default('use_xvfb',
self.port.get_option('headless'))
if not self.options.headless:
logger.info('Not headless; default to 1 worker to avoid '
'opening too many windows')
runner_options.headless = False
# Force `--pause-after-test`, since it doesn't make sense to run
# tests headfully without giving a chance for interaction.
runner_options.pause_after_test = True
if self.options.wrapper:
runner_options.debugger = self.options.wrapper[0]
# `wpt run` expects a plain `str`, not a `List[str]`:
@ -703,10 +695,6 @@ def parse_arguments(argv):
# `--no-expectations` to `run_wpt_tests.py`, and skip reporting results when
# the flag is passed.
options.no_expectations = False
# Directly tie Xvfb usage to headless mode. Xvfb can supercede a real X
# server and therefore should never be started in `--no-headless` mode.
# Conversely, the default headless mode should always start Xvfb.
options.use_xvfb = options.headless
return options, args