mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1047268 - Call SpecialPowers.pushPermissions() to ensure permission change is completed before continuing the rest of the tests. r=dhylands
This commit is contained in:
parent
5590faba5b
commit
1d4bc3f2ca
@ -49,18 +49,28 @@ SpecialPowers.pushPrefEnv({
|
||||
|
||||
// Need special permission to access "apps". We always have the permission in B2G
|
||||
// mochitests, but on other platforms, we need to manually add the permission.
|
||||
var needAppsPermission = false;;
|
||||
if (!SpecialPowers.testPermission(
|
||||
"webapps-manage", SpecialPowers.Ci.nsIPermissionManager.ALLOW_ACTION, document)) {
|
||||
ok(!navigator.getDeviceStorage("apps"), "Should not have apps storage without permission");
|
||||
SpecialPowers.addPermission("webapps-manage", true, document);
|
||||
needAppsPermission = true;
|
||||
}
|
||||
ok(navigator.getDeviceStorage("apps"), "Should have apps storage with permission");
|
||||
|
||||
ok(navigator.getDeviceStorage("sdcard"), "Should have sdcard storage");
|
||||
ok(navigator.getDeviceStorage("crashes"), "Should have crashes storage");
|
||||
var testFunction = function() {
|
||||
ok(navigator.getDeviceStorage("apps"), "Should have apps storage with permission");
|
||||
ok(navigator.getDeviceStorage("sdcard"), "Should have sdcard storage");
|
||||
ok(navigator.getDeviceStorage("crashes"), "Should have crashes storage");
|
||||
// The test harness reverts our pref changes automatically.
|
||||
SimpleTest.finish();
|
||||
}
|
||||
|
||||
// The test harness reverts our pref changes automatically.
|
||||
SimpleTest.finish();
|
||||
if (needAppsPermission) {
|
||||
SpecialPowers.pushPermissions(
|
||||
[{ "type":"webapps-manage", "allow": true, "context": document }],
|
||||
testFunction);
|
||||
} else {
|
||||
testFunction();
|
||||
}
|
||||
});
|
||||
|
||||
</script>
|
||||
|
Loading…
Reference in New Issue
Block a user