Closed Bug 1301617 Opened 6 years ago Closed

test for firstParty and userContextId documents with nsIPermissionManager

Categories

(Core :: DOM: Security, defect, P3)

defect

Tracking

()

RESOLVED FIXED
mozilla52
Tracking Status
firefox52 --- fixed

People

(Reporter: allstars.chh, Assigned: jhao)

References

(Blocks 2 open bugs)

Details

(Whiteboard: [OA-testing][domsecurity-backlog1][tor-testing])

Attachments

(1 file)

In Bug 1280497, 1233885 and Bug 1301274 we use default value for userContextId and firstPartyDomain, so the page could still use the same permission.

Said, for documents whose nodePrincipal are
- https://example.com^firstPartyDomain=example.com
- https://example.com^userContextId=1
- https://example.com^userContextId=1&firstPartyDomain=example.com

They could still use the same permission with
"https://example.com"

So we should have a test for this.
Depends on: ContextualIdentity
Whiteboard: [OA-testing][domsecurity-backlog1] → [OA-testing][domsecurity-backlog1][tor-testing]
Assignee: nobody → jhao
Status: NEW → ASSIGNED
I added some unit tests about nsIPermissionManager.  Yoshi, do you think we also need integration tests (browser mochitests)?
Attachment #8790144 - Flags: feedback?(allstars.chh)
Comment on attachment 8790144 [details] [diff] [review]
Tests for firstPartyDomain and userContextId with nsIPermissionManager.

Review of attachment 8790144 [details] [diff] [review]:
-----------------------------------------------------------------

Perhaps we could add some tests in 
extensions/cookie/test/unit/test_permmanager_matches.js
extensions/cookie/test/unit/test_permmanager_matchesuri.js 

to verify your comment https://bugzilla.mozilla.org/show_bug.cgi?id=1301274#c6

I am okay if we only have unit test right now, and focus on other isolation tests first.
But if you already have a patch, it's even better.
Attachment #8790144 - Flags: feedback?(allstars.chh) → feedback+
Comment on attachment 8790144 [details] [diff] [review]
Tests for firstPartyDomain and userContextId with nsIPermissionManager.

Thanks, Yoshi.  I opened bug 1301274 for permission matches.

Baku, would you also review these tests please?
Attachment #8790144 - Flags: review?(amarchesini)
Attachment #8790144 - Flags: review?(amarchesini) → review+
No longer depends on: ContextualIdentity
Priority: -- → P3
Keywords: checkin-needed
Pushed by ryanvm@gmail.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/791d2d978ef7
Add tests for firstPartyDomain and userContextId with nsIPermissionManager. r=baku
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/791d2d978ef7
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla52
https://hg.mozilla.org/mozilla-central/rev/791d2d978ef7
Closed: 6 years ago6 years ago
See Also: → 1282655
You need to log in before you can comment on or make changes to this bug.