avoid uses of enablePrivilege in style system mochitests

RESOLVED FIXED in mozilla6

Status

()

defect
P4
normal
RESOLVED FIXED
8 years ago
7 years ago

People

(Reporter: dbaron, Assigned: dbaron)

Tracking

Trunk
mozilla6
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(4 attachments)

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.
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+
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.