Closed Bug 653461 Opened 12 years ago Closed 12 years ago

avoid uses of enablePrivilege in style system mochitests

Categories

(Core :: CSS Parsing and Computation, defect, P4)

defect

Tracking

()

RESOLVED FIXED
mozilla6

People

(Reporter: dbaron, Assigned: dbaron)

Details

Attachments

(4 files)

I have patches to remove all but one of the uses of enablePrivilege in the layout/style/test/ mochitests.

The one remaining use is in test_bug405818.html, which I'm not immediately sure what to do about.
Attachment #528879 - Flags: review?(bzbarsky)
Attachment #528881 - Flags: review?(bzbarsky)
Attachment #528882 - Flags: review?(bzbarsky)
Comment on attachment 528881 [details] [diff] [review]
patch 2: convert uses of DOMWindowUtils

Review of attachment 528881 [details] [diff] [review]:

::: layout/style/test/test_pointer-events.html
@@ +70,5 @@
                               modifiers,           // long
                               ignoreWindowBounds)  // boolean
 {
+  SpecialPowers.DOMWindowUtils.sendMouseEvent(type, x, y, button, clickCount,
+                                              modifiers, ignoreWindowBounds);

Just curious why this is using sendMouseEvent when we have many synthesizeMouse* functions in EventUtils.js?  I sort of prefer this simpler approach.
Not sure; I didn't write it, and I'd rather not change it without doing more retesting that it's still testing the original bug.

That said, I find the EventUtils stuff pretty magical, and prefer this more explicit approach.
This caller is passing true for ignoreWindowBounds, which is not something the synthesizeMouse stuff in EventUtils does.  That my matter in this case.  Or not.  It would take some looking at this test to make sure.
Comment on attachment 528879 [details] [diff] [review]
patch 1: fix use of prefs API

r=me
Attachment #528879 - Flags: review?(bzbarsky) → review+
Comment on attachment 528881 [details] [diff] [review]
patch 2: convert uses of DOMWindowUtils

r=me
Attachment #528881 - Flags: review?(bzbarsky) → review+
Comment on attachment 528882 [details] [diff] [review]
patch 3: convert use of zoom

r=me
Attachment #528882 - Flags: review?(bzbarsky) → review+
https://hg.mozilla.org/mozilla-central/rev/2228e6343c47
https://hg.mozilla.org/mozilla-central/rev/442fe6006bbb
https://hg.mozilla.org/mozilla-central/rev/00d9bc4a9b9c

I'll call this bug fixed despite there being one left (see comment 0).
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Well, SpecialPowers.wrap() makes the last case easy (though I wonder if it's an overused tool), assuming this looks reasonable.
Attachment #659077 - Flags: review?(bzbarsky)
Comment on attachment 659077 [details] [diff] [review]
use SpecialPowers.wrap() for the last case

r=me
Attachment #659077 - Flags: review?(bzbarsky) → review+
You need to log in before you can comment on or make changes to this bug.