test: fix cookie tests on WebKit (#2359)

WebKit does not allow third party cookies.
This commit is contained in:
Dmitry Gozman 2020-05-26 10:22:53 -07:00 committed by GitHub
parent 43eed027bd
commit d532cd5d9f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -111,9 +111,9 @@ describe('launchPersistentContext()', function() {
document.cookie = 'username=John Doe';
return document.cookie;
});
expect(documentCookie).toBe('username=John Doe');
await page.waitForTimeout(2000);
const allowsThirdParty = CHROMIUM || FFOX;
expect(documentCookie).toBe(allowsThirdParty ? 'username=John Doe' : '');
const cookies = await context.cookies(server.CROSS_PROCESS_PREFIX + '/grid.html');
if (allowsThirdParty) {
expect(cookies).toEqual([

View File

@ -96,9 +96,9 @@ describe('Headful', function() {
document.cookie = 'username=John Doe';
return document.cookie;
});
expect(documentCookie).toBe('username=John Doe');
await page.waitForTimeout(2000);
const allowsThirdParty = CHROMIUM || FFOX;
expect(documentCookie).toBe(allowsThirdParty ? 'username=John Doe' : '');
const cookies = await page.context().cookies(server.CROSS_PROCESS_PREFIX + '/grid.html');
if (allowsThirdParty) {
expect(cookies).toEqual([