Commit 63a8a015 authored by Victor Costan's avatar Victor Costan Committed by Commit Bot

Async Cookies: Enable in Origin Trials as CookieStore.

Intent to experiment:
https://groups.google.com/a/chromium.org/d/topic/blink-dev/pdxkBoURmaA/discussion

Notification on experimentation-dev:
https://groups.google.com/a/chromium.org/d/topic/experimentation-dev/xwL0PmF3rq4/discussion

Bug: 729800
Change-Id: I88aa295f164c68b0700713a143821300724d081f
Reviewed-on: https://chromium-review.googlesource.com/1123411
Commit-Queue: Victor Costan <pwnall@chromium.org>
Reviewed-by: default avatarKent Tamura <tkent@chromium.org>
Reviewed-by: default avatarJason Chase <chasej@chromium.org>
Reviewed-by: default avatarJoshua Bell <jsbell@chromium.org>
Cr-Commit-Position: refs/heads/master@{#572440}
parent 3b86aa02
<!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="AuCNc4F6ez8bdiKV6reoNKgzu2afmtUl5FgKkP6jdrbbCqVh8BfddejNqciWMz+V+oZXxJdW1LU5nQuC0Ij2GQkAAABTeyJvcmlnaW4iOiAiaHR0cDovLzEyNy4wLjAuMTo4MDAwIiwgImZlYXR1cmUiOiAiQ29va2llU3RvcmUiLCAiZXhwaXJ5IjogMjAwMDAwMDAwMH0=" />
<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(this, {
'CookieStore': ['get', 'getAll', 'set', 'delete', 'onchange'],
'CookieChangeEvent': ['changed', 'deleted'],
});
}, 'Cookie Store API interfaces and properties in Origin-Trial enabled document.');
test(t => {
assert_true('cookieStore' in self, 'cookieStore property exists on global scope');
}, 'Cookie Store API entry point in Origin-Trial enabled document.');
// Only run "disabled" tests if the feature is not enabled via runtime flags.
if (!self.internals.runtimeFlags.cookieStoreEnabled) {
service_worker_test('resources/cookiestore-origin-trial-interfaces-serviceworker-disabled.js');
}
service_worker_test('resources/cookiestore-origin-trial-interfaces-serviceworker-enabled.php');
</script>
importScripts('/resources/testharness.js',
'/resources/origin-trials-helper.js');
test(t => {
OriginTrialsHelper.check_interfaces_missing(
self,
['CookieStore', 'ExtendableCookieChangeEvent']);
}, 'Cookie Store API interfaces in Origin-Trial disabled worker.');
test(t => {
assert_false('cookieStore' in self,
'cookieStore property does not exist on global scope');
assert_false('oncookiechange' in self,
'oncookiechange property does not exist on global scope');
}, 'Cookie Store API entry points in Origin-Trial disabled worker.');
done();
<?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(this, {
'CookieStore': ['get', 'getAll', 'set', 'delete', 'subscribeToChanges',
'getChangeSubscriptions'],
'ExtendableCookieChangeEvent': ['changed', 'deleted'],
});
}, 'Cookie Store API interfaces and properties in Origin-Trial enabled serviceworker.');
test(t => {
assert_true('cookieStore' in self, 'cookieStore property exists on global');
assert_true('oncookiechange' in self,
'oncookiechange property exists on global');
}, 'Cookie Store API entry points in Origin-Trial enabled serviceworker.');
done();
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
[ [
Exposed=Window, Exposed=Window,
RuntimeEnabled=AsyncCookies, OriginTrialEnabled=CookieStore,
SecureContext, SecureContext,
Constructor(DOMString type, optional CookieChangeEventInit eventInitDict) Constructor(DOMString type, optional CookieChangeEventInit eventInitDict)
] interface CookieChangeEvent : Event { ] interface CookieChangeEvent : Event {
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
[ [
Exposed=(ServiceWorker,Window), Exposed=(ServiceWorker,Window),
RuntimeEnabled=AsyncCookies, OriginTrialEnabled=CookieStore,
SecureContext SecureContext
] interface CookieStore : EventTarget { ] interface CookieStore : EventTarget {
// https://wicg.github.io/cookie-store/explainer.html#the-query-api // https://wicg.github.io/cookie-store/explainer.html#the-query-api
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
[ [
Exposed=ServiceWorker, Exposed=ServiceWorker,
RuntimeEnabled=AsyncCookies, OriginTrialEnabled=CookieStore,
Constructor(DOMString type, optional ExtendableCookieChangeEventInit eventInitDict) Constructor(DOMString type, optional ExtendableCookieChangeEventInit eventInitDict)
] interface ExtendableCookieChangeEvent : ExtendableEvent { ] interface ExtendableCookieChangeEvent : ExtendableEvent {
[Measure] readonly attribute CookieList changed; [Measure] readonly attribute CookieList changed;
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
// https://github.com/WICG/async-cookies-api/blob/gh-pages/explainer.md // https://github.com/WICG/async-cookies-api/blob/gh-pages/explainer.md
[ [
RuntimeEnabled=AsyncCookies, OriginTrialEnabled=CookieStore,
ImplementedAs=ServiceWorkerGlobalScopeCookieStore ImplementedAs=ServiceWorkerGlobalScopeCookieStore
] partial interface ServiceWorkerGlobalScope { ] partial interface ServiceWorkerGlobalScope {
[Replaceable, SameObject] readonly attribute CookieStore cookieStore; [Replaceable, SameObject] readonly attribute CookieStore cookieStore;
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
// https://github.com/WICG/async-cookies-api/blob/gh-pages/explainer.md // https://github.com/WICG/async-cookies-api/blob/gh-pages/explainer.md
[ [
RuntimeEnabled=AsyncCookies, OriginTrialEnabled=CookieStore,
ImplementedAs=WindowCookieStore, ImplementedAs=WindowCookieStore,
SecureContext SecureContext
] partial interface Window { ] partial interface Window {
......
...@@ -91,10 +91,6 @@ ...@@ -91,10 +91,6 @@
name: "AsyncClipboard", name: "AsyncClipboard",
status: "experimental", status: "experimental",
}, },
{
name: "AsyncCookies",
status: "experimental",
},
{ {
name: "AudioOutputDevices", name: "AudioOutputDevices",
status: "stable", status: "stable",
...@@ -233,6 +229,11 @@ ...@@ -233,6 +229,11 @@
name: "ContextMenu", name: "ContextMenu",
status: "experimental", status: "experimental",
}, },
{
name: "CookieStore",
origin_trial_feature_name: "CookieStore",
status: "experimental",
},
{ {
name: "CorsRFC1918", name: "CorsRFC1918",
}, },
......
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