feat(chromium-tip-of-tree): roll Chromium TOT to 1008 (#14279)
This commit is contained in:
parent
fd452058bb
commit
9a73dfe773
|
|
@ -15,9 +15,9 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "chromium-tip-of-tree",
|
"name": "chromium-tip-of-tree",
|
||||||
"revision": "1007",
|
"revision": "1008",
|
||||||
"installByDefault": false,
|
"installByDefault": false,
|
||||||
"browserVersion": "104.0.5067.0"
|
"browserVersion": "104.0.5071.0"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "firefox",
|
"name": "firefox",
|
||||||
|
|
|
||||||
|
|
@ -40,7 +40,7 @@ it('should get a cookie @smoke', async ({ context, page, server, defaultSameSite
|
||||||
}]);
|
}]);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should get a non-session cookie', async ({ context, page, server, defaultSameSiteCookieValue }) => {
|
it('should get a non-session cookie', async ({ context, page, server, defaultSameSiteCookieValue, browserName, browserMajorVersion }) => {
|
||||||
await page.goto(server.EMPTY_PAGE);
|
await page.goto(server.EMPTY_PAGE);
|
||||||
// @see https://en.wikipedia.org/wiki/Year_2038_problem
|
// @see https://en.wikipedia.org/wiki/Year_2038_problem
|
||||||
const date = +(new Date('1/1/2038'));
|
const date = +(new Date('1/1/2038'));
|
||||||
|
|
@ -50,16 +50,26 @@ it('should get a non-session cookie', async ({ context, page, server, defaultSam
|
||||||
return document.cookie;
|
return document.cookie;
|
||||||
}, date);
|
}, date);
|
||||||
expect(documentCookie).toBe('username=John Doe');
|
expect(documentCookie).toBe('username=John Doe');
|
||||||
expect(await context.cookies()).toEqual([{
|
const cookies = await context.cookies();
|
||||||
|
expect(cookies.length).toBe(1);
|
||||||
|
expect(cookies[0]).toEqual({
|
||||||
name: 'username',
|
name: 'username',
|
||||||
value: 'John Doe',
|
value: 'John Doe',
|
||||||
domain: 'localhost',
|
domain: 'localhost',
|
||||||
path: '/',
|
path: '/',
|
||||||
expires: date / 1000,
|
// We will check this separately.
|
||||||
|
expires: expect.anything(),
|
||||||
httpOnly: false,
|
httpOnly: false,
|
||||||
secure: false,
|
secure: false,
|
||||||
sameSite: defaultSameSiteCookieValue,
|
sameSite: defaultSameSiteCookieValue,
|
||||||
}]);
|
});
|
||||||
|
// Browsers start to cap cookies with 400 days max expires value.
|
||||||
|
// See https://github.com/httpwg/http-extensions/pull/1732
|
||||||
|
// Chromium patch: https://chromium.googlesource.com/chromium/src/+/aaa5d2b55478eac2ee642653dcd77a50ac3faff6
|
||||||
|
// We want to make sure that expires date is at least 400 days in future.
|
||||||
|
const FOUR_HUNDRED_DAYS = 1000 * 60 * 60 * 24 * 400;
|
||||||
|
const FIVE_MINUTES = 1000 * 60 * 5; // relax condition a bit to make sure test is not flaky.
|
||||||
|
expect(cookies[0].expires).toBeGreaterThan((Date.now() + FOUR_HUNDRED_DAYS - FIVE_MINUTES) / 1000);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should properly report httpOnly cookie', async ({ context, page, server }) => {
|
it('should properly report httpOnly cookie', async ({ context, page, server }) => {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue