Closed Bug 760410 Opened 12 years ago Closed 12 years ago

Regression in test dnd/testhtml.js ("Unexpectedly found element ID: item1")

Categories

(Testing Graveyard :: Mozmill, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: whimboo, Assigned: ahal)

References

Details

(Keywords: regression, Whiteboard: [mozmill-2.0+])

Attachments

(1 file, 2 obsolete files)

While working on getting all the JS tests enabled again, I have seen that we have a regression in the following test:

https://github.com/mozautomation/mozmill/blob/master/mutt/mutt/tests/js/dnd/testhtml.js

After the drag and drop action the the element item1 is still present for Mozmill while it doesn't exist anymore in the page. I have verified that with Firebug.

This is working fine with Mozmill 1.5.12 but is broken on master. I assume it has been caused by the MozmillElement feature.

Requesting for blocking Mozmill 2.0. I will search for the regression range.
Yeah, that has been broken since the MozElement class has been introduced in bug 632451.
The same applies to the test (test.xul) which runs under chrome.
Blocks: 760418
Ahal, would you mind taking a look at this?
Whiteboard: [mozmill-2.0?] → [mozmill-2.0+]
Assignee: nobody → ahalberstadt
Status: NEW → ASSIGNED
Just a note for you Andrew, I will not touch those affected tests by my patch on bug 760418. So you can work independently on it.
What I meant were the example files which are stored in the extension. But I have moved the dnd tests under mutt/tests/js/controller. Please see the before mentioned bug and my pull request which is still in WIP but hopefully fixed by tomorrow.
No longer blocks: 760418
Depends on: 760418
The test is definitely broken, but I don't think the regression is caused by bug 632451 since the dragToElement function calls EventUtils directly.

It looks like the mouseDown followed by mouseMove works as expected, but then the mouseUp event is not being processed. I'll have to look deeper into EventUtils for this one.
I was mistaken in the previous comment, it is the controller.assertNodeNotExist method that wasn't working. And it was caused by the mozelement refactor.

The problem was that the DOM object was getting stored locally in JS and doesn't get rechecked for existence. Luckily there is a built-in element.exists() method for exactly this reason so the fix is simple.
Attachment #631493 - Flags: review?(hskupin)
Comment on attachment 631493 [details] [diff] [review]
Patch 1.0 - Fix broken controller.assertNode* methods

As already filed as bug 763056, lets get all those crufty old assert methods removed in favor of the assertions module then.
Attachment #631493 - Flags: review?(hskupin) → review-
So lets get the test fixed and re-enabled by using assert/except.ok(elem.exists().
Fixes this test. I left the controller.assert* methods alone as they will be removed in the other bug.
Attachment #631493 - Attachment is obsolete: true
Attachment #631902 - Flags: review?(hskupin)
Comment on attachment 631902 [details] [diff] [review]
Patch 2.0 - Fix controller/dnd_content.js

Please also enable the test in the manifest.
Attachment #631902 - Flags: review?(hskupin) → review-
dnd_chrome.js had the same problem so I fixed and enabled it as well.
Attachment #631902 - Attachment is obsolete: true
Attachment #631944 - Flags: review?(hskupin)
Comment on attachment 631944 [details] [diff] [review]
Patch 3.0 - Fix dnd_content.js and dnd_chrome.js

Wohoo! Great. Thanks Ahal.
Attachment #631944 - Flags: review?(hskupin) → review+
master: https://github.com/mozautomation/mozmill/commit/63f516157dea4844e1e47aec8406f8f0e5f09478
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Product: Testing → Testing Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: