Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: skip non-standard cookie asserts on Firefox #6994

Merged
merged 2 commits into from Mar 17, 2021

Conversation

juliandescottes
Copy link
Contributor

Fix for #6976

This change adds a dedicated assert helper for cookies which will only check the non-standard properties sameParty, sourcePort and sourceScheme when running against chrome.

All cookie asserts are replaced to use this helper.

3 tests marked as failing with Firefox are enabled:

  • Page.cookies should get a cookie
  • Page.cookies should get multiple cookies
  • DefaultBrowserContext page.cookies() should work

@google-cla
Copy link

google-cla bot commented Mar 15, 2021

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here with @googlebot I signed it! and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

ℹ️ Googlers: Go here for more info.

export const expectCookieEquals = (cookies, expectedCookies) => {
const { isChrome } = getTestState();
if (!isChrome) {
for (const expectedCookie of expectedCookies) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you think about changing this to check to only checking the standard properties instead of removing the non standard ones?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the review! Tried to keep it simple and just copied over all the standard/shared values to a new object. Let me know if you had something else in mind.

@juliandescottes
Copy link
Contributor Author

@googlebot I signed it!

@google-cla google-cla bot added cla: yes and removed cla: no labels Mar 15, 2021
@juliandescottes
Copy link
Contributor Author

A test failed at https://github.com/puppeteer/puppeteer/pull/6994/checks?check_run_id=2114890609
Looks like the failing tests are:

  Workers
    1) "before all" hook for "Page.workers"
    2) "after all" hook for "should report errors"

Any chance this could be an intermittent failure or is it really something my patch broke?

@whimboo
Copy link
Collaborator

whimboo commented Mar 15, 2021

I triggered a re-run of all the jobs. Lets see...

@whimboo
Copy link
Collaborator

whimboo commented Mar 15, 2021

All the checks passed this time.

@jschfflr
Copy link
Contributor

Yes, this is what I had in mind. Now, you should also be able to remove the isChrome branch.

@juliandescottes
Copy link
Contributor Author

Yes, this is what I had in mind. Now, you should also be able to remove the isChrome branch.

Sorry, I don't have a isChrome branch in the current patch. Are you referring to the change in test/mocha-utils.ts or to something else?

@jschfflr jschfflr enabled auto-merge (squash) March 17, 2021 15:53
@jschfflr jschfflr merged commit b8d72cb into puppeteer:main Mar 17, 2021
@juliandescottes
Copy link
Contributor Author

Thanks for merging @jschfflr !
I was ok with updating the patch, and would have done so later today. I hope you're fine with the version you merged. If not, I'm really happy to provide another patch.

moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this pull request Mar 18, 2021
…Firefox (sync #6994) r=remote-protocol-reviewers,whimboo

Depends on D108099

Synchronize the upstream change merged at puppeteer/puppeteer#6994

Differential Revision: https://phabricator.services.mozilla.com/D108859
@jschfflr
Copy link
Contributor

Sorry for the late reply - I was OOO. No, I'm more than happy with the current version. Thanks!

@juliandescottes juliandescottes deleted the fix-cookie-tests-ff branch March 23, 2021 08:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants