зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1058319 - Add a geolocation-noprompt permission part 2: tests r=fabrice
This commit is contained in:
Родитель
4df0ccbe35
Коммит
24dab05837
|
@ -50,6 +50,21 @@ function do_check_set_eq(a1, a2) {
|
|||
}
|
||||
}
|
||||
|
||||
function test_substitute_does_not_break_substituted(scope) {
|
||||
const Ci = Components.interfaces;
|
||||
|
||||
// geolocation-noprompt substitutes for geolocation ...
|
||||
do_check_eq(scope.PermissionsTable["geolocation-noprompt"].substitute[0],
|
||||
"geolocation");
|
||||
// ... and sets silent allow ...
|
||||
do_check_eq(scope.PermissionsTable["geolocation-noprompt"].certified,
|
||||
Ci.nsIPermissionManager.ALLOW_ACTION)
|
||||
// ... which works ...
|
||||
do_check_false(scope.isExplicitInPermissionsTable("geolocation-noprompt", Ci.nsIPrincipal.APP_STATUS_CERTIFIED));
|
||||
// ... but does not interfere with geolocation's PROMPT value
|
||||
do_check_true(scope.isExplicitInPermissionsTable("geolocation", Ci.nsIPrincipal.APP_STATUS_CERTIFIED));
|
||||
}
|
||||
|
||||
function run_test() {
|
||||
var scope = {};
|
||||
Cu.import("resource://gre/modules/PermissionsTable.jsm", scope);
|
||||
|
@ -59,4 +74,5 @@ function run_test() {
|
|||
gData[i].access);
|
||||
do_check_set_eq(perms, gData[i].expected);
|
||||
}
|
||||
test_substitute_does_not_break_substituted(scope);
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче