Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
with
50 additions
and 40 deletions.
- +1 −0 browser/components/originattributes/test/browser/browser.ini
- +46 −0 browser/components/originattributes/test/browser/browser_permissions_isolation.js
- +0 −24 caps/BasePrincipal.cpp
- +0 −4 caps/BasePrincipal.h
- +1 −1 dom/permission/PermissionStatus.cpp
- +2 −2 extensions/cookie/nsPermission.cpp
- +0 −9 extensions/cookie/nsPermissionManager.cpp
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
| @@ -70,3 +70,4 @@ support-files = | ||
| [browser_clientAuth.js] | ||
| [browser_cacheAPI.js] | ||
| [browser_permissions.js] | ||
| [browser_permissions_isolation.js] | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
| @@ -0,0 +1,46 @@ | ||
| /** | ||
| * Tor Bug 21569 - A test case for permissions isolation. | ||
| */ | ||
|
|
||
| const TEST_PAGE = "http://mochi.test:8888/browser/browser/components/" + | ||
| "originattributes/test/browser/file_firstPartyBasic.html"; | ||
|
|
||
| function* init() { | ||
| let permPromise = TestUtils.topicObserved("perm-changed"); | ||
| Services.perms.removeAll(); | ||
| info("called removeAll"); | ||
| yield permPromise; | ||
| info("cleared permissions for new test"); | ||
| } | ||
|
|
||
| // Define the testing function | ||
| function* doTest(aBrowser) { | ||
| // Promise will result when permissions popup appears: | ||
| let popupShowPromise = BrowserTestUtils.waitForEvent(PopupNotifications.panel, "popupshown"); | ||
| let originalStatus = yield ContentTask.spawn(aBrowser, null, function* (key) { | ||
| let status = (yield content.navigator.permissions.query({name: "notifications"})).state; | ||
| content.Notification.requestPermission(); | ||
| return status; | ||
| }); | ||
| info(`originalStatus: '${originalStatus}'`); | ||
| if (originalStatus === "prompt") { | ||
| // Wait for the popup requesting permission to show notifications: | ||
| yield popupShowPromise; | ||
| let popupHidePromise = BrowserTestUtils.waitForEvent(PopupNotifications.panel, "popuphidden"); | ||
| let popupNotification = PopupNotifications.panel.childNodes[0]; | ||
| // Click to grant permission: | ||
| popupNotification.button.click(); | ||
| // Wait for popup to hide again. | ||
| yield popupHidePromise; | ||
| } | ||
| return originalStatus; | ||
| } | ||
|
|
||
| add_task(function* () { | ||
| yield SpecialPowers.pushPrefEnv({ | ||
| set: [["dom.webnotifications.enabled", true]] | ||
| }); | ||
| IsolationTestTools.runTests(TEST_PAGE, doTest, | ||
| (isolated, val1, val2) => (isolated === ( val2 === "prompt")), | ||
| init, true); | ||
| }); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters