Skip to content

Conversation

juj
Copy link
Collaborator

@juj juj commented Sep 14, 2025

This is a cleaned up version 2 of #25237.


Two problems that I run into with the parallel browser harness on Windows with Firefox:

  1. On Windows, all the browser windows open up in the exact same X,Y coordinate. Firefox has "is browser in the background" detection, which causes all but one test foreground harness to hang when running any requestAnimationFrame() based test.

  2. Killing a Firefox browser process with

proc = subprocess.Popen(['firefox'])
proc.kill()

does not work. This is because Firefox is a multiprocess browser, and does not have a process hierarchy where the first launched process would be some kind of a master process. (this is an old known issue, that can be seen also in existing emrun.py code) There seems to be about 12 processes that come alive when running subprocess.Popen(['firefox']).


To fix these issues:

  1. ask the Windows Win32 API to move each spawned process to its own X,Y location. Use a file-based multiprocessing lock + counter file to get unique counter to each process.

  2. Snapshot alive processes before spawning Firefox, and after. Then acquire the delta of these two to find which process IDs correspond to the launched Firefox.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant