Skip to content
This repository was archived by the owner on Mar 19, 2021. It is now read-only.

Commit 747ffaf

Browse files
Maks OrlovichHexcles
authored andcommitted
Experimental CookieStore API: some additional browser-side validation
Bug: 984646 Change-Id: Icb9721646d0c93ee06b049656b777e86acd05299 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1704356 Commit-Queue: Maks Orlovich <[email protected]> Reviewed-by: Victor Costan <[email protected]> Cr-Commit-Position: refs/heads/master@{#678467}
1 parent 4fd7cb2 commit 747ffaf

5 files changed

+11
-7
lines changed

cookie-store/serviceworker_cookieStore_subscriptions.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ self.addEventListener('install', (event) => {
1111
// cookie change logic that this test aims to cover.
1212
try {
1313
await cookieStore.subscribeToChanges([
14-
{ name: 'cookie-name1', matchType: 'equals', url: '/scope/path1' }]);
14+
{ name: 'cookie-name1', matchType: 'equals', url: '/cookie-store/path1' }]);
1515
await cookieStore.subscribeToChanges([
1616
{ }, // Test the default values for subscription properties.
1717
{ name: 'cookie-prefix', matchType: 'starts-with' },

cookie-store/serviceworker_cookieStore_subscriptions.tentative.https.html

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,14 @@
99
'use strict';
1010

1111
(async () => {
12-
const scope = 'scope';
12+
// Not using an explicit scope here in order for script URL to be in scope,
13+
// to cover implicit subscription URL construction.
1314

14-
let registration = await navigator.serviceWorker.getRegistration(scope);
15+
let registration = await navigator.serviceWorker.getRegistration();
1516
if (registration)
1617
await registration.unregister();
1718
registration = await navigator.serviceWorker.register(
18-
'serviceworker_cookieStore_subscriptions.js', {scope});
19+
'serviceworker_cookieStore_subscriptions.js');
1920

2021
fetch_tests_from_worker(registration.installing);
2122
})();

cookie-store/serviceworker_cookieStore_subscriptions_basic.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ self.addEventListener('install', (event) => {
88
event.waitUntil((async () => {
99
try {
1010
await cookieStore.subscribeToChanges([
11-
{ name: 'cookie-name', matchType: 'equals', url: '/scope/path' }]);
11+
{ name: 'cookie-name', matchType: 'equals',
12+
url: '/cookie-store/scope/path' }]);
1213

1314
// If the worker enters the "redundant" state, the UA may terminate it
1415
// before all tests have been reported to the client. Stifle errors in

cookie-store/serviceworker_cookieStore_subscriptions_eventhandler_attribute.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ self.addEventListener('install', (event) => {
88
event.waitUntil((async () => {
99
try {
1010
await cookieStore.subscribeToChanges([
11-
{ name: 'cookie-name', matchType: 'equals', url: '/scope/path' }]);
11+
{ name: 'cookie-name', matchType: 'equals',
12+
url: '/cookie-store/scope/path' }]);
1213

1314
// If the worker enters the "redundant" state, the UA may terminate it
1415
// before all tests have been reported to the client. Stifle errors in

cookie-store/serviceworker_cookieStore_subscriptions_mismatch.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ self.addEventListener('install', (event) => {
88
event.waitUntil((async () => {
99
try {
1010
await cookieStore.subscribeToChanges([
11-
{ name: 'cookie-name', matchType: 'equals', url: '/scope/path' }]);
11+
{ name: 'cookie-name', matchType: 'equals',
12+
url: '/cookie-store/scope/path' }]);
1213

1314
// If the worker enters the "redundant" state, the UA may terminate it
1415
// before all tests have been reported to the client. Stifle errors in

0 commit comments

Comments
 (0)