Skip to content

Commit

Permalink
Enable site isolation for headless shell (#49605)
Browse files Browse the repository at this point in the history
* Defaultly enable SiteIsolation in headless shell

This turns on SiteIsolation in headless shell by default, if that is not
explicitly disabled through flag specific config or VTS.

Bug: None

* fix function call

* fix lint
  • Loading branch information
WeizhongX authored Dec 10, 2024
1 parent 64e2195 commit bc62de4
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion tools/wptrunner/wptrunner/browsers/headless_shell.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

from .base import require_arg
from .base import get_timeout_multiplier # noqa: F401
from .chrome import ChromeBrowser, debug_args, executor_kwargs # noqa: F401
from .chrome import ChromeBrowser, debug_args # noqa: F401
from .chrome import executor_kwargs as chrome_executor_kwargs
from ..executors.base import WdspecExecutor # noqa: F401
from ..executors.executorchrome import ( # noqa: F401
ChromeDriverCrashTestExecutor,
Expand Down Expand Up @@ -41,6 +42,17 @@ def browser_kwargs(logger, test_type, run_info_data, config, **kwargs):
"debug_info": kwargs["debug_info"]}


def executor_kwargs(logger, test_type, test_environment, run_info_data, subsuite,
**kwargs):
executor_kwargs = chrome_executor_kwargs(logger, test_type, test_environment, run_info_data,
subsuite, **kwargs)
chrome_options = executor_kwargs["capabilities"]["goog:chromeOptions"]
# Defaultly enable SiteIsolation in headless shell
if "--disable-site-isolation-trials" not in chrome_options["args"]:
chrome_options["args"].append("--site-per-process")
return executor_kwargs


def env_extras(**kwargs):
return []

Expand Down

0 comments on commit bc62de4

Please sign in to comment.