From 37697e3d9fc7db00ad1d9f6931928443dfee51c9 Mon Sep 17 00:00:00 2001 From: Sam Macbeth Date: Mon, 28 Feb 2022 16:46:22 +0100 Subject: [PATCH] Add cookieStore API --- .../storage-blocking/helpers/commonTests.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/privacy-protections/storage-blocking/helpers/commonTests.js b/privacy-protections/storage-blocking/helpers/commonTests.js index 7327439..3428d0f 100644 --- a/privacy-protections/storage-blocking/helpers/commonTests.js +++ b/privacy-protections/storage-blocking/helpers/commonTests.js @@ -1,4 +1,5 @@ /* exported commonTests */ +/* global cookieStore */ // tests that are common for both main frame and an iframe const commonTests = [ { @@ -92,5 +93,18 @@ const commonTests = [ .then(r => r.text()); }); } + }, + { + id: 'CookieStore', + store: (data) => { + return cookieStore.set({ + name: 'cookiestoredata', + value: data, + expires: new Date('Wed, 21 Aug 2030 20:00:00 UTC').getTime() + }); + }, + retrive: async () => { + return (await cookieStore.get('cookiestoredata')).value; + } } ];