Closed
Bug 512347
Opened 15 years ago
Closed 15 years ago
synthesizeDrop from EventUtils doesn't work
Categories
(Testing :: Mochitest, defect)
Testing
Mochitest
Tracking
(Not tracked)
RESOLVED
FIXED
mozilla1.9.3a1
People
(Reporter: Natch, Assigned: Natch)
References
Details
(Whiteboard: [fixed1.9.2b1])
Attachments
(1 file, 2 obsolete files)
1.60 KB,
patch
|
enndeakin
:
review+
|
Details | Diff | Splinter Review |
It throws since it doesn't specify enough arguments. Error: uncaught exception: [Exception... "Not enough arguments [nsIDOMDragEvent.initDragEvent]" nsresult: "0x80570001 (NS_ERROR_XPC_NOT_ENOUGH_ARGS)" location: "JS frame :: chrome://mochikit/content/tests/SimpleTest/EventUtils.js :: synthesizeDrop :: line 505" data: no] The code I was using: let data = [[ "text/uri-list: http://example.org" ], [ "text/plain: http://example.org" ]]; dragDropButtons.forEach(function(val) { let button = document.getElementById(val); // This throws now, which is why I've commented it out. When synthesizeDrop // is fixed this should work just fine. - Natch let effectReturned = EventUtils.synthesizeDrop(button, data, "link"); is(effectReturned, "link" || "copyLink", "Wrong dropEffect returned by button: " + val); })
Assignee | ||
Comment 1•15 years ago
|
||
Assignee: nobody → highmind63
Attachment #396314 -
Flags: review?(sayrer)
Assignee | ||
Comment 2•15 years ago
|
||
Whoops, patches got merged.
Attachment #396314 -
Attachment is obsolete: true
Attachment #396315 -
Flags: review?(sayrer)
Attachment #396314 -
Flags: review?(sayrer)
Updated•15 years ago
|
Attachment #396315 -
Flags: review?(sayrer) → review?(enndeakin)
Assignee | ||
Comment 3•15 years ago
|
||
Comment on attachment 396315 [details] [diff] [review] patch [Checkin: Comment 10 & 12] I'm going to try to make this function more useful, currently command handlers are called when this function runs which doesn't work out well when testing elements that have both command handlers and drag handlers.
Attachment #396315 -
Attachment is obsolete: true
Attachment #396315 -
Flags: review?(enndeakin)
Assignee | ||
Comment 4•15 years ago
|
||
This function doesn't really work, the returned dropEffect never matches what actually happens. Another problem is that DragEvents don't set the drag session, so in my case the function fails with an error... Any help here would be appreciated.
Assignee | ||
Comment 5•15 years ago
|
||
->Default owner, this is getting too complicated for me. The above patch *can* be taken, but I've yet to see a correct dropEffect returned from the function. It used to set the dropEffect, then return that, which doesn't sound all that useful to me...
Assignee: highmind63 → nobody
Assignee | ||
Updated•15 years ago
|
Attachment #396315 -
Flags: review?(enndeakin)
Assignee | ||
Comment 6•15 years ago
|
||
Comment on attachment 396315 [details] [diff] [review] patch [Checkin: Comment 10 & 12] This at least gets in not to throw, so should be taken.
Updated•15 years ago
|
Attachment #396315 -
Attachment is obsolete: false
Attachment #396315 -
Flags: review?(enndeakin) → review+
Assignee | ||
Updated•15 years ago
|
Keywords: checkin-needed
Whiteboard: [c-n: NPOTB, 1.9.2 needed]
Assignee | ||
Comment 7•15 years ago
|
||
Maybe once bug 448602 lands, these two functions can just create a pseudo transfer and event object, then call all the event listeners in order and return that? Is that a better hack than the one currently in place?
Comment 8•15 years ago
|
||
Don't this need to land in m-c first?
Assignee | ||
Comment 9•15 years ago
|
||
yes, only this can probably land together, there are no tests that use this function now (they would've failed), and this just makes the method call not throw.
Whiteboard: [c-n: NPOTB, 1.9.2 needed] → [c-n: NPOTB, 1.9.2 and m-c needed]
Comment 10•15 years ago
|
||
Comment on attachment 396315 [details] [diff] [review] patch [Checkin: Comment 10 & 12] http://hg.mozilla.org/mozilla-central/rev/8384b031de64
Attachment #396315 -
Attachment description: patch → patch
[Checkin: Comment 10]
Updated•15 years ago
|
Assignee: nobody → highmind63
Status: NEW → ASSIGNED
Whiteboard: [c-n: NPOTB, 1.9.2 and m-c needed] → [c-n: NPOTB, comment 10 to m-1.9.2]
Assignee | ||
Comment 11•15 years ago
|
||
-> Resolved Fixed Opened bug 514451 to simplify this method somewhat.
Status: ASSIGNED → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
Comment 12•15 years ago
|
||
Comment on attachment 396315 [details] [diff] [review] patch [Checkin: Comment 10 & 12] http://hg.mozilla.org/releases/mozilla-1.9.2/rev/b51ae20ae663
Attachment #396315 -
Attachment description: patch
[Checkin: Comment 10] → patch
[Checkin: Comment 10 & 12]
Updated•15 years ago
|
Attachment #396478 -
Attachment is obsolete: true
Updated•15 years ago
|
Keywords: checkin-needed
Whiteboard: [c-n: NPOTB, comment 10 to m-1.9.2] → [fixed1.9.2b1]
Target Milestone: --- → mozilla1.9.3a1
You need to log in
before you can comment on or make changes to this bug.
Description
•