Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

No more enablePrivilege(*) in tests from now on.

35 views
Skip to first unread message

Johnny Stenback

unread,
Mar 15, 2011, 7:55:08 PM3/15/11
to dev-pl...@lists.mozilla.org
Hello everyone,

We're finally taking the last steps towards being able to eliminate the
baggage we've been carrying for over a decade now in order to support
the API that is netscape.security.PrivilegeManager.enablePrivilege().
This Mozilla specific API that's not even exposed to (or usable on) the
web by default and its removal has already been discussed and decided on
in the past. Supporting it is costing us in many ways and giving us very
very little in return, and thus it will be completely removed in a
future version.

Right now, the only thing holding us back from removing the API
completely is the use of the API in our own tests. There's a lot of
that, and Clint Talbert and team are working on a plan to address what's
left there. Given their heroic efforts, it's now time to stop piling
onto the already large task they're dealing with.

That means that starting now, we'll be asking developers to STOP ADDING
MORE uses of enablePrivilege(). And we're also asking reviewers to NOT
let any code land that adds more uses of enablePrivilege() from this
point on.

So what do you do when you need elevated privileges in order to test
whatever you're working on? There's basically two options, one is to
make your test a chrome test, which automatically runs with full
privileges, the other option is to use the new SpecialPowers object [1].
The API that SpecialPowers exposes right now is pretty limited, but it's
trivial to add more, and that API is being expanded as I write this as
well. This is the way forward here, please use it whenever necessary.

[1]
http://mxr.mozilla.org/mozilla-central/source/testing/mochitest/specialpowers/content/specialpowers.js?force=1#42

--
jst

0 new messages