Skip to content

Commit d532cd5

Browse files
authored
test: fix cookie tests on WebKit (#2359)
WebKit does not allow third party cookies.
1 parent 43eed02 commit d532cd5

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

test/defaultbrowsercontext.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,9 +111,9 @@ describe('launchPersistentContext()', function() {
111111
document.cookie = 'username=John Doe';
112112
return document.cookie;
113113
});
114-
expect(documentCookie).toBe('username=John Doe');
115114
await page.waitForTimeout(2000);
116115
const allowsThirdParty = CHROMIUM || FFOX;
116+
expect(documentCookie).toBe(allowsThirdParty ? 'username=John Doe' : '');
117117
const cookies = await context.cookies(server.CROSS_PROCESS_PREFIX + '/grid.html');
118118
if (allowsThirdParty) {
119119
expect(cookies).toEqual([

test/headful.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,9 +96,9 @@ describe('Headful', function() {
9696
document.cookie = 'username=John Doe';
9797
return document.cookie;
9898
});
99-
expect(documentCookie).toBe('username=John Doe');
10099
await page.waitForTimeout(2000);
101100
const allowsThirdParty = CHROMIUM || FFOX;
101+
expect(documentCookie).toBe(allowsThirdParty ? 'username=John Doe' : '');
102102
const cookies = await page.context().cookies(server.CROSS_PROCESS_PREFIX + '/grid.html');
103103
if (allowsThirdParty) {
104104
expect(cookies).toEqual([

0 commit comments

Comments
 (0)