Skip to content

Commit bd45df6

Browse files
authored
Fix emrun.test_no_browser to launch a browser using the BrowserCore harness (#26789)
Fix emrun.test_no_browser to launch a browser using the BrowserCore harness, so that Firefox/Chrome/Safari will be launched with the appropriate startup flags (and not e.g. try to autoupdate, or show modal user prompts during the test run)
1 parent 4efaa6c commit bd45df6

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

test/test_browser.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5730,18 +5730,17 @@ def test_no_browser(self):
57305730
proc = subprocess.Popen([EMRUN, '--no-browser', '.', '--port=3333'], stdout=PIPE)
57315731
try:
57325732
if get_browser():
5733-
print('Starting browser')
5734-
browser_cmd = shlex.split(get_browser())
5735-
browser = subprocess.Popen(browser_cmd + ['http://localhost:3333/hello_world.html'])
5733+
url = 'http://localhost:3333/hello_world.html?argv0'
5734+
print(f'Starting browser to {url}')
5735+
BrowserCore.browser_open(url)
57365736
try:
57375737
while True:
57385738
stdout = proc.stdout.read()
57395739
if b'Dumping out file' in stdout:
57405740
break
57415741
finally:
57425742
print('Terminating browser')
5743-
browser.terminate()
5744-
browser.wait()
5743+
BrowserCore.browser_terminate()
57455744
finally:
57465745
print('Terminating emrun server')
57475746
proc.terminate()

0 commit comments

Comments
 (0)