-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Enable support for running the test harness in Safari. #25499
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
test/common.py
Outdated
# by the delta before->after. | ||
cls.browser_procs = list(set(procs_after).difference(set(procs_before))) | ||
if len(cls.browser_procs) == 0: | ||
logger.warning('Could not detect the launched browser subprocesses. The test harness may not be able to close browser windows if a test hangs, and at harness exit.') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can this be an error instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can make it an error, but it is only so when running with EMTEST_BROWSER_AUTO_CONFIG enabled. (I think btw disabling EMTEST_BROWSER_AUTO_CONFIG might currently be broken and atm not possible)
If user adds a custom browser string, and EMTEST_BROWSER_AUTO_CONFIG is not enabled, then the browser might run in a tab on an existing browser, in which case this detection will not work.
test/common.py
Outdated
# --fresh: do not restore old tabs (e.g. if user had old navigated windows open) | ||
# --background: Open the new Safari window behind the current Terminal window, to make following the test run more pleasing (this is for convenience only) | ||
# -a <exe_name>: The path to the executable to open, in this case Safari | ||
browser_args = ['open', '--new', '--fresh', '--background', '-a'] + browser_args |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't these args go in SafariConfig
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or maybe these should be used also for Chrome and FF on macOS? i.e. is open
the way we should be launching all browsers on macOS?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It'll need a new construct in the configs, there is no current way to model a prefix of args in the existing set of config fields. I can do that in a moment.
Using open
is not needed for Firefox at least. Not sure about Chrome, but I presume not.
test/common.py
Outdated
else: | ||
exit_with_error(f'EMTEST_BROWSER_AUTO_CONFIG only currently works with firefox or chrome. EMTEST_BROWSER was "{EMTEST_BROWSER}"') | ||
if not config: | ||
exit_with_error(f'EMTEST_BROWSER_AUTO_CONFIG only currently works with firefox, chrome and safari. EMTEST_BROWSER was "{EMTEST_BROWSER}"') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This error seems like its unreachable since its inside the if EMTEST_BROWSER_AUTO_CONFIG and config
block?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, good catch.
Add support for running the
browser
harness withEMTEST_BROWSER=/Applications/Safari.App/Contents/MacOS/Safari
on a macOS system.This fixes both the singlethreaded and multithreaded harness runs.