Commit 2fbb8e5c authored by Lily Chen's avatar Lily Chen Committed by Commit Bot

Remove SameSite features from experimental web platform features

SameSiteByDefaultCookies and CookiesWithoutSameSiteMustBeSecure were
added to the set of features enabled with
--enable-experimental-web-platform-features in
https://crrev.com/c/1691522.

This CL removes those features from the experimental web platform
features but retains test coverage for them.

Bug: 953306, 954551, 961439
Change-Id: Ia13753f8f89ff5e93371c3ec9932c9d0499cd9fe
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1904870Reviewed-by: default avatarXianzhu Wang <wangxianzhu@chromium.org>
Reviewed-by: default avatarJohn Abd-El-Malek <jam@chromium.org>
Reviewed-by: default avatarBalazs Engedy <engedy@chromium.org>
Reviewed-by: default avatarChris Harrelson <chrishtr@chromium.org>
Commit-Queue: Lily Chen <chlily@chromium.org>
Cr-Commit-Position: refs/heads/master@{#714747}
parent 16b4985d
...@@ -169,8 +169,6 @@ class CookieSettingsTest ...@@ -169,8 +169,6 @@ class CookieSettingsTest
void SetUpCommandLine(base::CommandLine* cmd) override { void SetUpCommandLine(base::CommandLine* cmd) override {
// Get access to CookieStore API. // Get access to CookieStore API.
// Also enables SameSiteByDefaultCookies and
// CookiesWithoutSameSiteMustBeSecure.
cmd->AppendSwitch(switches::kEnableExperimentalWebPlatformFeatures); cmd->AppendSwitch(switches::kEnableExperimentalWebPlatformFeatures);
ContentSettingsTest::SetUpCommandLine(cmd); ContentSettingsTest::SetUpCommandLine(cmd);
} }
......
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
#include "base/task/post_task.h" #include "base/task/post_task.h"
#include "base/test/bind_test_util.h" #include "base/test/bind_test_util.h"
#include "base/test/metrics/histogram_tester.h" #include "base/test/metrics/histogram_tester.h"
#include "base/test/scoped_feature_list.h"
#include "content/browser/bad_message.h" #include "content/browser/bad_message.h"
#include "content/browser/frame_host/frame_tree.h" #include "content/browser/frame_host/frame_tree.h"
#include "content/browser/frame_host/render_frame_message_filter.h" #include "content/browser/frame_host/render_frame_message_filter.h"
...@@ -32,6 +33,7 @@ ...@@ -32,6 +33,7 @@
#include "content/shell/browser/shell.h" #include "content/shell/browser/shell.h"
#include "content/test/content_browser_test_utils_internal.h" #include "content/test/content_browser_test_utils_internal.h"
#include "ipc/ipc_security_test_util.h" #include "ipc/ipc_security_test_util.h"
#include "net/base/features.h"
#include "net/cookies/canonical_cookie.h" #include "net/cookies/canonical_cookie.h"
#include "net/cookies/cookie_util.h" #include "net/cookies/cookie_util.h"
#include "net/dns/mock_host_resolver.h" #include "net/dns/mock_host_resolver.h"
...@@ -113,6 +115,10 @@ class RenderFrameMessageFilterBrowserTest : public ContentBrowserTest { ...@@ -113,6 +115,10 @@ class RenderFrameMessageFilterBrowserTest : public ContentBrowserTest {
void SetUp() override { void SetUp() override {
base::CommandLine::ForCurrentProcess()->AppendSwitch( base::CommandLine::ForCurrentProcess()->AppendSwitch(
switches::kEnableExperimentalWebPlatformFeatures); switches::kEnableExperimentalWebPlatformFeatures);
feature_list_.InitWithFeatures(
{net::features::kSameSiteByDefaultCookies,
net::features::kCookiesWithoutSameSiteMustBeSecure} /* enabled */,
{} /* disabled */);
ContentBrowserTest::SetUp(); ContentBrowserTest::SetUp();
} }
...@@ -120,6 +126,9 @@ class RenderFrameMessageFilterBrowserTest : public ContentBrowserTest { ...@@ -120,6 +126,9 @@ class RenderFrameMessageFilterBrowserTest : public ContentBrowserTest {
// Support multiple sites on the test server. // Support multiple sites on the test server.
host_resolver()->AddRule("*", "127.0.0.1"); host_resolver()->AddRule("*", "127.0.0.1");
} }
private:
base::test::ScopedFeatureList feature_list_;
}; };
// Exercises basic cookie operations via javascript, including an http page // Exercises basic cookie operations via javascript, including an http page
......
...@@ -6,7 +6,6 @@ ...@@ -6,7 +6,6 @@
#include "content/public/common/content_features.h" #include "content/public/common/content_features.h"
#include "content/public/common/content_switches.h" #include "content/public/common/content_switches.h"
#include "net/base/features.h"
namespace content { namespace content {
...@@ -22,13 +21,6 @@ GetSwitchDependentFeatureOverrides(const base::CommandLine& command_line) { ...@@ -22,13 +21,6 @@ GetSwitchDependentFeatureOverrides(const base::CommandLine& command_line) {
// State to override the feature with. // State to override the feature with.
base::FeatureList::OverrideState override_state; base::FeatureList::OverrideState override_state;
} override_info[] = { } override_info[] = {
// Experimental Cookie SameSite features.
{switches::kEnableExperimentalWebPlatformFeatures,
std::cref(net::features::kSameSiteByDefaultCookies),
base::FeatureList::OVERRIDE_ENABLE_FEATURE},
{switches::kEnableExperimentalWebPlatformFeatures,
std::cref(net::features::kCookiesWithoutSameSiteMustBeSecure),
base::FeatureList::OVERRIDE_ENABLE_FEATURE},
{switches::kEnableExperimentalWebPlatformFeatures, {switches::kEnableExperimentalWebPlatformFeatures,
std::cref(features::kCookieDeprecationMessages), std::cref(features::kCookieDeprecationMessages),
base::FeatureList::OVERRIDE_ENABLE_FEATURE}, base::FeatureList::OVERRIDE_ENABLE_FEATURE},
......
...@@ -363,7 +363,7 @@ ...@@ -363,7 +363,7 @@
}, },
{ {
name: "CookiesWithoutSameSiteMustBeSecure", name: "CookiesWithoutSameSiteMustBeSecure",
status: "experimental", status: "test",
}, },
{ {
name: "CooperativeScheduling" name: "CooperativeScheduling"
...@@ -1447,7 +1447,7 @@ ...@@ -1447,7 +1447,7 @@
}, },
{ {
name: "SameSiteByDefaultCookies", name: "SameSiteByDefaultCookies",
status: "experimental", status: "test",
}, },
// Exposes the displays connected to the device and provides the display // Exposes the displays connected to the device and provides the display
// properties needed for window placement features. // properties needed for window placement features.
......
...@@ -46,6 +46,13 @@ _log = logging.getLogger(__name__) ...@@ -46,6 +46,13 @@ _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