Skip to content

Commit

Permalink
test: fix some ff cookie tests (#12039)
Browse files Browse the repository at this point in the history
  • Loading branch information
sadym-chromium committed Mar 4, 2024
1 parent 2ef161b commit 43f2453
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 25 deletions.
15 changes: 4 additions & 11 deletions test/TestExpectations.json
Original file line number Diff line number Diff line change
Expand Up @@ -1215,13 +1215,6 @@
"expectations": ["FAIL", "PASS"],
"comment": "TODO: add a comment explaining why this expectation is required (include links to issues)"
},
{
"testIdPattern": "[cookies.spec] Cookie specs Page.cookies should get cookies from multiple urls",
"platforms": ["darwin", "linux", "win32"],
"parameters": ["firefox", "webDriverBiDi"],
"expectations": ["FAIL"],
"comment": "TODO: add a comment explaining why this expectation is required (include links to issues)"
},
{
"testIdPattern": "[cookies.spec] Cookie specs Page.cookies should get cookies from nested path",
"platforms": ["darwin", "linux", "win32"],
Expand Down Expand Up @@ -1296,8 +1289,8 @@
"testIdPattern": "[cookies.spec] Cookie specs Page.setCookie should default to setting secure cookie for HTTPS websites",
"platforms": ["darwin", "linux", "win32"],
"parameters": ["firefox", "webDriverBiDi"],
"expectations": ["FAIL"],
"comment": "TODO: add a comment explaining why this expectation is required (include links to issues)"
"expectations": ["SKIP"],
"comment": "Chromium-specific test. The test relies on the cookie in secure context to be secure. This is not the case for Firefox."
},
{
"testIdPattern": "[cookies.spec] Cookie specs Page.setCookie should isolate cookies in browser contexts",
Expand Down Expand Up @@ -1373,8 +1366,8 @@
"testIdPattern": "[cookies.spec] Cookie specs Page.setCookie should set secure same-site cookies from a frame",
"platforms": ["darwin", "linux", "win32"],
"parameters": ["firefox", "webDriverBiDi"],
"expectations": ["FAIL"],
"comment": "TODO: add a comment explaining why this expectation is required (include links to issues)"
"expectations": ["SKIP"],
"comment": "Chromium-specific test. The test relies on the cookie in secure context to be secure. This is not the case for Firefox."
},
{
"testIdPattern": "[cookies.spec] Cookie specs Page.setCookie should work",
Expand Down
3 changes: 0 additions & 3 deletions test/src/cookies.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,6 @@ describe('Cookie specs', () => {
expires: -1,
size: 11,
httpOnly: false,
secure: true,
session: true,
sourceScheme: 'Secure',
},
Expand All @@ -163,7 +162,6 @@ describe('Cookie specs', () => {
expires: -1,
size: 10,
httpOnly: false,
secure: true,
session: true,
sourceScheme: 'Secure',
},
Expand Down Expand Up @@ -436,7 +434,6 @@ describe('Cookie specs', () => {
expires: -1,
size: 18,
httpOnly: false,
secure: true,
session: true,
sourceScheme: 'Secure',
},
Expand Down
26 changes: 15 additions & 11 deletions test/src/mocha-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -378,17 +378,21 @@ export const expectCookieEquals = async (
if (!processVariables.isChrome) {
// Only keep standard properties when testing on a browser other than Chrome.
expectedCookies = expectedCookies.map(cookie => {
return {
domain: cookie.domain,
expires: cookie.expires,
httpOnly: cookie.httpOnly,
name: cookie.name,
path: cookie.path,
secure: cookie.secure,
session: cookie.session,
size: cookie.size,
value: cookie.value,
};
return Object.fromEntries(
Object.entries(cookie).filter(([key]) => {
return [
'domain',
'expires',
'httpOnly',
'name',
'path',
'secure',
'session',
'size',
'value',
].includes(key);
})
);
});
}

Expand Down

0 comments on commit 43f2453

Please sign in to comment.