Closed Bug 666649 Opened 13 years ago Closed 13 years ago

remove enablePrivilege from various places in the harness and chrome tests

Categories

(Testing :: Mochitest, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
mozilla8

People

(Reporter: jmaher, Assigned: jmaher)

References

Details

(Whiteboard: [specialpowers])

Attachments

(1 file, 1 obsolete file)

with SpecialPowers, we can now remove our enablePrivilege calls in our code for things like prefs, domutils, etc... where we have the functionality in SpecialPowers and the code modified to use SpecialPowers instead.
found a bunch of enablePrivilege calls in some tests and in the SimpleTest/ directory. There are plenty more, but these are ones we can easily remove now.
Assignee: nobody → jmaher
Attachment #541433 - Flags: review?(ted.mielczarek)
Comment on attachment 541433 [details] [diff] [review] remove a bunch of enablePrivilege calls (1.0) Review of attachment 541433 [details] [diff] [review]: ----------------------------------------------------------------- The non-SimpleTest bits look fine, pretty straightforward removal. The SimpleTest bits need a little more work. ::: testing/mochitest/tests/SimpleTest/SimpleTest.js @@ +39,5 @@ > var testPluginIsOOP = false; > if (navigator.platform.indexOf("Mac") == 0) { > var xulRuntime = Components.classes["@mozilla.org/xre/app-info;1"] > .getService(Components.interfaces.nsIXULAppInfo) > .QueryInterface(Components.interfaces.nsIXULRuntime); When you remove the enablePrivilege call, this Components.classes bit is going to throw. You'll need to remove this as well. Should be simple enough to expose XPCOMABI via SpecialPowers, I think I even had a half-formed patch that did it: http://hg.mozilla.org/users/tmielczarek_mozilla.com/mq/file/f066da77e5b8/de-privilege#l171 @@ +47,2 @@ > } catch (e) { > + testPluginIsOOP = SpecialPowers.getBoolPref("dom.ipc.plugins.enabled.i386"); This isn't going to work right. SpecialPowers.get*Pref doesn't throw when the pref is unset. I think the patch I linked above had some changes to handle this as well, like this: http://hg.mozilla.org/users/tmielczarek_mozilla.com/mq/file/f066da77e5b8/de-privilege#l194
Attachment #541433 - Flags: review?(ted.mielczarek) → review-
updated patch. I left the enable privilege call in for the osx condition as I have another patch to add in xpcomabi. I did however fix up the _getPref and added some unittests for the exception throwing as well.
Attachment #541433 - Attachment is obsolete: true
Attachment #547364 - Flags: review?(ted.mielczarek)
Comment on attachment 547364 [details] [diff] [review] remove a bunch of enablePrivilege calls (2.0) Review of attachment 547364 [details] [diff] [review]: ----------------------------------------------------------------- ::: testing/mochitest/tests/SimpleTest/SimpleTest.js @@ +40,5 @@ > var testPluginIsOOP = false; > if (navigator.platform.indexOf("Mac") == 0) { > var xulRuntime = Components.classes["@mozilla.org/xre/app-info;1"] > .getService(Components.interfaces.nsIXULAppInfo) > .QueryInterface(Components.interfaces.nsIXULRuntime); You should steal the SpecialPowers.XPCOMABI bit from my old patch and you could drop enablePrivilege from this entire function. Or you could just land this and we could do that later. ::: testing/mochitest/tests/test_SpecialPowersExtension.html @@ +55,5 @@ > + retVal = SpecialPowers.getBoolPref('extensions.checkCompat0123456789'); > + } catch (ex) { > + retVal = ex; > + } > + is(retVal, 'Error getting pref', "we received an exception while getting a boolean pref"); Should probably be more clear, "received an exception trying to get an unset preference value".
Attachment #547364 - Flags: review?(ted.mielczarek) → review+
Whiteboard: [specialpowers] → [specialpowers][inbound]
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Whiteboard: [specialpowers][inbound] → [specialpowers]
Target Milestone: --- → mozilla8
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: