diff --git a/docs/running-tests/webkitgtk_minibrowser.md b/docs/running-tests/webkitgtk_minibrowser.md index 7aac81e5fce660..5dd047536ed055 100644 --- a/docs/running-tests/webkitgtk_minibrowser.md +++ b/docs/running-tests/webkitgtk_minibrowser.md @@ -12,9 +12,11 @@ The WebKitGTK MiniBrowser is not installed on the default binary path. The `wpt` script will try to automatically locate it, but if you need to run it manually you can find it on any of this paths: -* Fedora: `/usr/libexec/webkit2gtk-4.0/MiniBrowser` -* Debian or Ubuntu: `/usr/lib/x86_64-linux-gnu/webkit2gtk-4.0/MiniBrowser` - * Note: if the machine architecture is not `x86_64`, then it will be located - inside: - `/usr/lib/${TRIPLET}/webkit2gtk-4.0/MiniBrowser` - where `TRIPLET=$(gcc -dumpmachine)` +* Fedora: `/usr/libexec/webkit2gtk-${VERSION}/MiniBrowser` +* Debian or Ubuntu: `/usr/lib/x86_64-linux-gnu/webkit2gtk-${VERSION}/MiniBrowser` +* Note: + * `VERSION` is `4.0` or `4.1`. + * If not Fedora and the machine architecture is not `x86_64`, then it will + be located inside: + `/usr/lib/${TRIPLET}/webkit2gtk-${VERSION}/MiniBrowser` + where `TRIPLET=$(gcc -dumpmachine)` diff --git a/tools/wpt/browser.py b/tools/wpt/browser.py index 932604397013ba..e553d83a628448 100644 --- a/tools/wpt/browser.py +++ b/tools/wpt/browser.py @@ -2467,7 +2467,6 @@ def find_binary(self, venv_path=None, channel=None): if minibrowser_path: return minibrowser_path - libexecpaths = ["/usr/libexec/webkit2gtk-4.0"] # Fedora path triplet = "x86_64-linux-gnu" # Try to use GCC to detect this machine triplet gcc = which("gcc") @@ -2476,8 +2475,16 @@ def find_binary(self, venv_path=None, channel=None): triplet = call(gcc, "-dumpmachine").strip() except subprocess.CalledProcessError: pass - # Add Debian/Ubuntu path - libexecpaths.append("/usr/lib/%s/webkit2gtk-4.0" % triplet) + + versions = ["4.0", "4.1"] + libexecpaths = [] + + for version in versions: + # Fedora paths. + libexecpaths.append(f"/usr/libexec/webkit2gtk-{version}") + # Debian/Ubuntu paths + libexecpaths.append(f"/usr/lib/{triplet}/webkit2gtk-{version}") + return which("MiniBrowser", path=os.pathsep.join(libexecpaths)) def find_webdriver(self, venv_path=None, channel=None):