Commit 4aeaa0f5 authored by Ayu Ishii's avatar Ayu Ishii Committed by Chromium LUCI CQ

CookieStore: Cleanup Origin Trial

Cookie Store has shipped in M87. This change removes
origin trial integration that is no longer used.

Bug: 1044245
Change-Id: I312d9e8d181cec908b15e2f999e6f78a2177bb1a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2612102Reviewed-by: default avatarVictor Costan <pwnall@chromium.org>
Reviewed-by: default avatarKentaro Hara <haraken@chromium.org>
Commit-Queue: Ayu Ishii <ayui@chromium.org>
Cr-Commit-Position: refs/heads/master@{#841357}
parent 82fccc55
......@@ -177,8 +177,6 @@ public class CookieManagerTest {
@Test
@MediumTest
@Feature({"AndroidWebView", "Privacy"})
@CommandLineFlags.Add({"enable-blink-features=CookieStoreDocument"})
// TODO(https://crbug.com/968649) Remove switch when CookieStore launched.
public void testAcceptCookie_falseWontSetCookies() throws Throwable {
testAcceptCookieHelper(false, "-disabled");
}
......@@ -186,8 +184,6 @@ public class CookieManagerTest {
@Test
@MediumTest
@Feature({"AndroidWebView", "Privacy"})
@CommandLineFlags.Add({"enable-blink-features=CookieStoreDocument"})
// TODO(https://crbug.com/968649) Remove switch when CookieStore launched.
public void testAcceptCookie_trueWillSetCookies() throws Throwable {
testAcceptCookieHelper(true, "-enabled");
}
......@@ -686,8 +682,6 @@ public class CookieManagerTest {
@Test
@MediumTest
@Feature({"AndroidWebView", "Privacy"})
@CommandLineFlags.Add({"enable-blink-features=CookieStoreDocument"})
// TODO(https://crbug.com/968649) Remove switch when CookieStore launched.
public void testCookieStoreListener() throws Throwable {
TestWebServer webServer = TestWebServer.startSsl();
try {
......@@ -1005,8 +999,6 @@ public class CookieManagerTest {
@Test
@MediumTest
@Feature({"AndroidWebView", "Privacy"})
@CommandLineFlags.Add({"enable-blink-features=CookieStoreDocument"})
// TODO(https://crbug.com/968649) Remove switch when CookieStore launched.
public void testThirdPartyJavascriptCookie() throws Throwable {
// Using SSL server here since CookieStore API requires a secure schema.
TestWebServer webServer = TestWebServer.startSsl();
......@@ -1033,8 +1025,6 @@ public class CookieManagerTest {
@Test
@MediumTest
@Feature({"AndroidWebView", "Privacy"})
@CommandLineFlags.Add({"enable-blink-features=CookieStoreDocument"})
// TODO(https://crbug.com/968649) Remove switch when CookieStore launched.
public void testThirdPartyCookiesArePerWebview() throws Throwable {
// Using SSL server here since CookieStore API requires a secure schema.
TestWebServer webServer = TestWebServer.startSsl();
......
......@@ -186,12 +186,6 @@ class CookieSettingsTest
set_secure_scheme();
}
void SetUpCommandLine(base::CommandLine* cmd) override {
// Get access to CookieStore API.
cmd->AppendSwitch(switches::kEnableExperimentalWebPlatformFeatures);
ContentSettingsTest::SetUpCommandLine(cmd);
}
void set_secure_scheme() { secure_scheme_ = true; }
std::string ReadCookie(Browser* browser) {
......@@ -963,13 +957,6 @@ class ContentSettingsWorkerModulesBrowserTest : public ContentSettingsTest {
ContentSettingsWorkerModulesBrowserTest() = default;
~ContentSettingsWorkerModulesBrowserTest() override = default;
void SetUpCommandLine(base::CommandLine* cmd) override {
// Module scripts on Dedicated Worker is still an experimental feature.
// Likewise for CookieStore.
// TODO(crbug/680046,crbug/729800): Remove this after shipping.
cmd->AppendSwitch(switches::kEnableExperimentalWebPlatformFeatures);
}
protected:
void RegisterStaticFile(net::EmbeddedTestServer* server,
const std::string& relative_url,
......
......@@ -51,8 +51,6 @@ class CookiePolicyBrowserTest : public InProcessBrowserTest {
// HTTPS server only serves a valid cert for localhost, so this is needed
// to load pages from other hosts without an error.
command_line->AppendSwitch(switches::kIgnoreCertificateErrors);
command_line->AppendSwitchASCII(switches::kEnableBlinkFeatures,
"CookieStoreDocument");
}
GURL GetURL(const std::string& host) {
......
......@@ -45,11 +45,6 @@ class CookieStoreSameSiteTest : public InProcessBrowserTest,
ASSERT_TRUE(https_server_.Start());
}
void SetUpCommandLine(base::CommandLine* command_line) override {
command_line->AppendSwitchASCII(switches::kEnableBlinkFeatures,
"CookieStoreDocument");
}
void NavigateToPageWithFrame(const std::string& host) {
GURL main_url(https_server_.GetURL(host, "/iframe.html"));
ui_test_utils::NavigateToURL(browser(), main_url);
......
......@@ -63,8 +63,6 @@ class StorageAccessAPIBrowserTest : public InProcessBrowserTest {
// HTTPS server only serves a valid cert for localhost, so this is needed
// to load pages from other hosts without an error.
command_line->AppendSwitch(switches::kIgnoreCertificateErrors);
command_line->AppendSwitchASCII(switches::kEnableBlinkFeatures,
"CookieStoreDocument");
}
GURL GetURL(const std::string& host) {
......
......@@ -3,14 +3,13 @@
// found in the LICENSE file.
// Used to signal cookie changes to Document contexts.
// https://github.com/WICG/async-cookies-api/blob/gh-pages/explainer.md
// https://wicg.github.io/cookie-store/explainer.html
//
// See extendable_cookie_change_event.idl for the equivalent event in
// ServiceWorker contexts.
[
Exposed=Window,
RuntimeEnabled=CookieStoreDocument,
SecureContext
] interface CookieChangeEvent : Event {
constructor(DOMString type, optional CookieChangeEventInit eventInitDict = {});
......
......@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// https://github.com/WICG/async-cookies-api/blob/gh-pages/explainer.md
// https://wicg.github.io/cookie-store/explainer.html
dictionary CookieChangeEventInit : EventInit {
CookieList changed;
......
......@@ -6,7 +6,6 @@
[
Exposed=(ServiceWorker,Window),
RuntimeEnabled=CookieStoreDocument,
SecureContext
] interface CookieStore : EventTarget {
// https://wicg.github.io/cookie-store/explainer.html#the-query-api
......
......@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// https://github.com/WICG/async-cookies-api/blob/gh-pages/explainer.md
// https://wicg.github.io/cookie-store/explainer.html
dictionary CookieStoreDeleteOptions {
required USVString name;
......
......@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// https://github.com/WICG/async-cookies-api/blob/gh-pages/explainer.md
// https://wicg.github.io/cookie-store/explainer.html
dictionary CookieStoreGetOptions {
USVString name;
......
......@@ -5,7 +5,7 @@
// https://wicg.github.io/cookie-store/explainer.html#the-change-events-api
[
Exposed(ServiceWorker CookieStoreWorker, Window CookieStoreDocument),
Exposed=(ServiceWorker,Window),
SecureContext
] interface CookieStoreManager {
[CallWith=ScriptState, MeasureAs=CookieStoreAPI, RaisesException]
......
......@@ -3,13 +3,12 @@
// found in the LICENSE file.
// Used to signal cookie changes to ServiceWorker contexts.
// https://github.com/WICG/async-cookies-api/blob/gh-pages/explainer.md
// https://wicg.github.io/cookie-store/explainer.html
//
// See cookie_change_event.idl for the equivalent event in Document contexts.
[
Exposed=ServiceWorker,
RuntimeEnabled=CookieStoreWorker
Exposed=ServiceWorker
] interface ExtendableCookieChangeEvent : ExtendableEvent {
constructor(DOMString type, optional ExtendableCookieChangeEventInit eventInitDict = {});
[
......
......@@ -2,10 +2,9 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// https://github.com/WICG/async-cookies-api/blob/gh-pages/explainer.md
// https://wicg.github.io/cookie-store/explainer.html
[
RuntimeEnabled=CookieStoreWorker,
ImplementedAs=GlobalCookieStore
] partial interface ServiceWorkerGlobalScope {
[SameObject] readonly attribute CookieStore cookieStore;
......
......@@ -4,7 +4,6 @@
[
Exposed=(ServiceWorker,Window),
RuntimeEnabled=CookieStoreWorker,
ImplementedAs=CookieStoreManager
] partial interface ServiceWorkerRegistration {
[SameObject] readonly attribute CookieStoreManager cookies;
......
......@@ -2,10 +2,9 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// https://github.com/WICG/async-cookies-api/blob/gh-pages/explainer.md
// https://wicg.github.io/cookie-store/explainer.html
[
RuntimeEnabled=CookieStoreDocument,
ImplementedAs=GlobalCookieStore,
SecureContext
] partial interface Window {
......
......@@ -405,14 +405,6 @@
name: "CookieDeprecationMessages",
status: "experimental",
},
{
name: "CookieStoreDocument",
status: "stable",
},
{
name: "CookieStoreWorker",
status: "stable",
},
{
name: "CookiesWithoutSameSiteMustBeSecure",
status: "test",
......
<!DOCTYPE html>
<meta charset="utf-8">
<!-- Generate token with the command:
generate_token.py http://127.0.0.1:8000 CookieStore --expire-timestamp=2000000000
-- -->
<meta http-equiv="origin-trial" content="A/tS990j7n9VjcZbX16/nUmZ8VdMMUzvcPOC6lSkRjLCqhbITiPki31a3TpeDuSZzcSKeZ7bik7JB0c+M/i6UQQAAABTeyJvcmlnaW4iOiAiaHR0cDovLzEyNy4wLjAuMTo4MDAwIiwgImZlYXR1cmUiOiAiQ29va2llU3RvcmUiLCAiZXhwaXJ5IjogMjAwMDAwMDAwMH0=" />
<title>Cookie Store API - interfaces exposed by origin trial</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/resources/origin-trials-helper.js"></script>
<script src="/serviceworker/resources/test-helpers.js"></script>
<script>
test(t => {
OriginTrialsHelper.check_properties_exist(this, {
'CookieStore': ['get', 'getAll', 'set', 'delete', 'onchange'],
'CookieStoreManager': ['getSubscriptions', 'subscribe', 'unsubscribe'],
'CookieChangeEvent': ['changed', 'deleted'],
'ServiceWorkerRegistration': ['cookies'],
});
}, 'Cookie Store API interfaces and properties in Origin-Trial enabled document.');
test(t => {
assert_true('cookieStore' in self, 'cookieStore property exists on global scope');
assert_not_equals(window.cookieStore, undefined, 'cookieStore property can be accessed on window');
}, 'Cookie Store API entry point in Origin-Trial enabled document.');
service_worker_test('resources/cookiestore-origin-trial-interfaces-serviceworker-enabled.php');
</script>
<?php
// Generate token with the command:
// generate_token.py http://127.0.0.1:8000 CookieStore --expire-timestamp=2000000000
header("Origin-Trial: AuCNc4F6ez8bdiKV6reoNKgzu2afmtUl5FgKkP6jdrbbCqVh8BfddejNqciWMz+V+oZXxJdW1LU5nQuC0Ij2GQkAAABTeyJvcmlnaW4iOiAiaHR0cDovLzEyNy4wLjAuMTo4MDAwIiwgImZlYXR1cmUiOiAiQ29va2llU3RvcmUiLCAiZXhwaXJ5IjogMjAwMDAwMDAwMH0=");
header('Content-Type: application/javascript');
?>
importScripts('/resources/testharness.js',
'/resources/origin-trials-helper.js');
test(t => {
OriginTrialsHelper.check_properties_exist(this, {
'CookieStore': ['get', 'getAll', 'set', 'delete'],
'CookieStoreManager': ['getSubscriptions', 'subscribe', 'unsubscribe'],
'ExtendableCookieChangeEvent': ['changed', 'deleted'],
'ServiceWorkerRegistration': ['cookies'],
});
}, 'Cookie Store API interfaces and properties in Origin-Trial enabled serviceworker.');
test(t => {
assert_true('cookieStore' in self, 'cookieStore property exists on global');
assert_not_equals(self.cookieStore, undefined, 'cookieStore property can be accessed on self');
assert_true('oncookiechange' in self,
'oncookiechange property exists on global');
}, 'Cookie Store API entry points in Origin-Trial enabled serviceworker.');
done();
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