Bug 1457048 - Fix permissions tests to accomodate autoplay-media. r=johannh

MozReview-Commit-ID: E0BPcXPox7p

--HG--
extra : rebase_source : 54894acffa355de817783ae7ed5b6dadeea5b2f9
This commit is contained in:
Chris Pearce 2018-05-04 13:49:14 +12:00
Родитель ed8a27f065
Коммит 4c40136611
2 изменённых файлов: 4 добавлений и 3 удалений

Просмотреть файл

@ -28,6 +28,7 @@ state.multichoice.allow = Allow
state.multichoice.allowForSession = Allow for Session
state.multichoice.block = Block
permission.autoplay-media.label = Automatically Play Media with Sound
permission.cookie.label = Set Cookies
permission.desktop-notification2.label = Receive Notifications
permission.image.label = Load Images

Просмотреть файл

@ -10,7 +10,7 @@ const RESIST_FINGERPRINTING_ENABLED = Services.prefs.getBoolPref("privacy.resist
const MIDI_ENABLED = Services.prefs.getBoolPref("dom.webmidi.enabled");
add_task(async function testPermissionsListing() {
let expectedPermissions = ["camera", "cookie", "desktop-notification", "focus-tab-by-prompt",
let expectedPermissions = ["autoplay-media", "camera", "cookie", "desktop-notification", "focus-tab-by-prompt",
"geo", "image", "install", "microphone", "plugin:flash", "popup", "screen", "shortcuts",
"persistent-storage"];
if (RESIST_FINGERPRINTING_ENABLED) {
@ -106,7 +106,7 @@ add_task(async function testExactHostMatch() {
let uri = Services.io.newURI("https://example.com");
let subUri = Services.io.newURI("https://test1.example.com");
let exactHostMatched = ["desktop-notification", "focus-tab-by-prompt", "camera",
let exactHostMatched = ["autoplay-media", "desktop-notification", "focus-tab-by-prompt", "camera",
"microphone", "screen", "geo", "persistent-storage"];
if (RESIST_FINGERPRINTING_ENABLED) {
// Canvas permission should be hidden unless privacy.resistFingerprinting
@ -127,7 +127,7 @@ add_task(async function testExactHostMatch() {
if (exactHostMatched.includes(permission)) {
// Check that the sub-origin does not inherit the permission from its parent.
Assert.equal(SitePermissions.get(subUri, permission).state, SitePermissions.UNKNOWN,
Assert.equal(SitePermissions.get(subUri, permission).state, SitePermissions.getDefault(permission),
`${permission} should exact-host match`);
} else if (nonExactHostMatched.includes(permission)) {
// Check that the sub-origin does inherit the permission from its parent.