Commit 530907b5 authored by Xianzhu Wang's avatar Xianzhu Wang Committed by Commit Bot

Move temporary option for SameSite into Driver.cmd_line()

The previous method of temporary option for SameSite affected
flag-specific expectatations because the temporary option was treated
as the flag-specific name. This broke local rebaselines of tests.

Move the temporary option into Driver.cmd_line() to prevent it from
affecting flag-specific feature.

Bug: 961439
Change-Id: I1b2c30feebb42a0a701b2085b63b0fde4ab2ea93
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1914196Reviewed-by: default avatarLily Chen <chlily@chromium.org>
Commit-Queue: Xianzhu Wang <wangxianzhu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#714996}
parent 03c9f1f8
...@@ -464,6 +464,13 @@ class Driver(object): ...@@ -464,6 +464,13 @@ class Driver(object):
cmd.extend(self._port.additional_driver_flags()) cmd.extend(self._port.additional_driver_flags())
if self._port.get_option('enable_leak_detection'): if self._port.get_option('enable_leak_detection'):
cmd.append('--enable-leak-detection') cmd.append('--enable-leak-detection')
# Run tests with the new SameSite cookie behavior by default.
# By appending the features to --enable-features, they will be enabled if
# they are not also explicitly disabled (as base::FeatureList disables a
# feature that appears in both --disable-features and --enable-features).
cmd.append('--enable-features=SameSiteByDefaultCookies,CookiesWithoutSameSiteMustBeSecure')
cmd.extend(per_test_args) cmd.extend(per_test_args)
cmd = coalesce_repeated_switches(cmd) cmd = coalesce_repeated_switches(cmd)
cmd.append('-') cmd.append('-')
......
...@@ -46,13 +46,6 @@ _log = logging.getLogger(__name__) ...@@ -46,13 +46,6 @@ _log = logging.getLogger(__name__)
def main(argv, stderr): def main(argv, stderr):
options, args = parse_args(argv) options, args = parse_args(argv)
# Run tests with the new SameSite cookie behavior by default.
# By appending the features to --enable-features, they will be enabled if
# they are not also explicitly disabled (as base::FeatureList disables a
# feature that appears in both --disable-features and --enable-features).
samesite_feature_names = ['SameSiteByDefaultCookies', 'CookiesWithoutSameSiteMustBeSecure']
options.additional_driver_flag.append('--enable-features=' + ','.join(samesite_feature_names))
if options.platform and 'test' in options.platform and not 'browser_test' in options.platform: if options.platform and 'test' in options.platform and not 'browser_test' in options.platform:
# It's a bit lame to import mocks into real code, but this allows the user # It's a bit lame to import mocks into real code, but this allows the user
# to run tests against the test platform interactively, which is useful for # to run tests against the test platform interactively, which is useful for
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment