Closed Bug 1090759 Opened 11 years ago Closed 11 years ago

browserElementTestHelpers.js cleanup

Categories

(Core :: DOM: Core & HTML, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla36

People

(Reporter: kanru, Assigned: kanru)

Details

(Whiteboard: [lang=js])

Attachments

(5 files)

Something I think we could do: 1. Use SpecialPowers.pushPermissions instead of addPermission 2. Use DOM Promise instead of copy Promise.js from addon SDK
Note, a patch in bug 832700 tried to change the file to use normal Promises.
(In reply to Olli Pettay [:smaug] from comment #1) > Note, a patch in bug 832700 tried to change the file to use normal Promises. Thanks for noticing. Looks like it doesn't land on any branch. I have a patch for that too. We can't simply remove the boilerplate because DOM Promise behave slightly differently. The pattern used in priority/ expectOnlyOneProcessCreated().then(function(chid) { childID = chid; return Promise.all( [expectPriorityChange(childID, 'FOREGROUND'), expectMozbrowserEvent(iframe, 'loadend'), expectMozbrowserEvent(iframe, 'showmodalprompt').then(function(e) { is(e.detail.message, 'onplay', 'showmodalprompt message'); })] ); }).then(function() { ... doesn't work because the priority change event is fired before we create the expectPriorityChange promise. I think this is because the DOM Promise uses microtasks so the observer code gets run first.
Assignee: nobody → kchen
Mentor: kchen
Attachment #8514078 - Flags: review?(bugs)
Attachment #8514079 - Flags: review?(bugs)
Attachment #8514086 - Flags: review?(bugs) → review+
Comment on attachment 8514078 [details] [diff] [review] Part 1. Use pushPermissions Note sure why we need lockTestReady/unlockTestReady but I guess those make the tests more reliable, since they are used to prefs etc.
Attachment #8514078 - Flags: review?(bugs) → review+
Attachment #8514084 - Flags: review?(bugs) → review+
Attachment #8514079 - Flags: review?(bugs) → review+
Attachment #8514082 - Flags: review?(bugs) → review+
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: