Skip to content

Commit

Permalink
[run-benchmark][WPE] Update cog and minibrowser-wpe browser drivers.
Browse files Browse the repository at this point in the history
https://bugs.webkit.org/show_bug.cgi?id=256061

Reviewed by Philippe Normand.

Simplify the Cog browser driver to only have one browser driver for Cog.
In order to select the platform plugins for Cog the environment variables
COG_PLATFORM_NAME and COG_PLATFORM_PARAMS can be used now. Also allow to
start Cog from the run-minibrowser script.

Finally fix the driver for minibrowser-wpe to run the minibrowser binary
instead of Cog. For that the script sets the env var WPE_BROWSER=minibrowser

* Tools/Scripts/webkitpy/benchmark_runner/browser_driver/linux_cog_driver.py:
(CogBrowserDriver):
(CogBrowserDriver.launch_url):
(CogBrowserDriver.prepare_env):
(CogFdoBrowserDriver): Deleted.
(CogFdoBrowserDriver.launch_url): Deleted.
(CogFdoBrowserDriver.launch_driver): Deleted.
* Tools/Scripts/webkitpy/benchmark_runner/browser_driver/linux_minibrowserwpe_driver.py:
(WPEMiniBrowserDriver.launch_driver):
(WPEMiniBrowserDriver):
(WPEMiniBrowserDriver.prepare_env):

Canonical link: https://commits.webkit.org/263495@main
  • Loading branch information
clopez committed Apr 28, 2023
1 parent 2364ff0 commit 3bfd9bb
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 19 deletions.
@@ -1,4 +1,4 @@
# Copyright (C) 2019 Igalia S.L. All rights reserved.
# Copyright (C) 2019, 2023 Igalia S.L. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
Expand Down Expand Up @@ -29,27 +29,20 @@

class CogBrowserDriver(LinuxBrowserDriver):
browser_name = 'cog'
process_search_list = ['cog']
process_search_list = ['Tools/Scripts/run-minibrowser', 'cog']

# If you want to execute Cog with a specific platform plugin (drm, wayland, etc)
# Then set the environment variables COG_PLATFORM_NAME and COG_PLATFORM_PARAMS
def launch_url(self, url, options, browser_build_path, browser_path):
self._browser_arguments = [url]
super(CogBrowserDriver, self).launch_url(url, options,
browser_build_path,
browser_path)
self._browser_arguments = []
if self.process_name.endswith('run-minibrowser'):
self._browser_arguments.append('--wpe')
self._browser_arguments.append(url)
super(CogBrowserDriver, self).launch_url(url, options, browser_build_path, browser_path)

def launch_driver(self, url, options, browser_build_path):
raise ValueError("Browser {browser} is not available with webdriver".format(browser=self.browser_name))


class CogFdoBrowserDriver(LinuxBrowserDriver):
browser_name = 'cog-fdo'
process_search_list = ['cog']

def launch_url(self, url, options, browser_build_path, browser_path):
self._browser_arguments = ['--platform=fdo', url]
super(CogFdoBrowserDriver, self).launch_url(url, options,
browser_build_path,
browser_path)

def launch_driver(self, url, options, browser_build_path):
raise ValueError("Browser {browser} is not available with webdriver".format(browser=self.browser_name))
def prepare_env(self, config):
super(CogBrowserDriver, self).prepare_env(config)
self._test_environ['WPE_BROWSER'] = 'cog'
Expand Up @@ -40,3 +40,7 @@ def launch_url(self, url, options, browser_build_path, browser_path):

def launch_driver(self, url, options, browser_build_path):
raise ValueError("Browser {browser} is not available with webdriver".format(browser=self.browser_name))

def prepare_env(self, config):
super(WPEMiniBrowserDriver, self).prepare_env(config)
self._test_environ['WPE_BROWSER'] = 'minibrowser'

0 comments on commit 3bfd9bb

Please sign in to comment.