Closed Bug 898378 Opened 12 years ago Closed 12 years ago

Mutt test failure "keypress() with pressed shift key succeeded. - '' should equal 'F'" in "mutt/mutt/tests/js/controller/synthesize_events.js"

Categories

(Testing Graveyard :: Mozmill, defect, P1)

x86
macOS
defect

Tracking

(firefox22 unaffected, firefox23 unaffected, firefox24 unaffected, firefox25 affected, firefox26 affected, firefox-esr17 unaffected)

RESOLVED FIXED
Tracking Status
firefox22 --- unaffected
firefox23 --- unaffected
firefox24 --- unaffected
firefox25 --- affected
firefox26 --- affected
firefox-esr17 --- unaffected

People

(Reporter: andrei, Assigned: andrei)

Details

(Whiteboard: [mozmill-2.0][ateamtrack: p=mozmill q=2013q3 m=2])

Attachments

(2 files, 3 obsolete files)

Failure seen on Nightly from 2013-07-26 Build from 2013-07-25 works fine Getting an accurate regression range now. Nightly pushlog: http://hg.mozilla.org/mozilla-central/pushloghtml?changeset=76fb8f815ac7
Accurate pushlog from inbound builds: http://hg.mozilla.org/integration/mozilla-inbound/pushloghtml?changeset=949a5e125a8d See bug 501496 I think me might need to update our library code
Assignee: nobody → andrei.eftimie
Status: NEW → ASSIGNED
Priority: -- → P1
*Sigh*, updating EventUtils does not solve the issue. The context menu referenced above is not getting closed by hitting ESC. It seems to be stuck: I've put up a sleep, and I can't even manually close is by pressing ESC. We can hack this error to go away by issuing a restart between the tests, but that would only avoid the real problem.
Attached file testcase.js (obsolete) —
Simplified testcase
Attached file testcase.js
Masayuki since bug 501496 has landed we're getting a failure in our automated tests. Attached is a testcase. You can run the file via mozmill: > pip install mozmill > mozmill --v // mozmill 2.0rc4 > mozmill -t testcase.js -b %path/to/firefox/binary% We are failing to close a contextmenu by pressing VK_ESCAPE. I am not sure if this is a regression, or as you say in bug 501496 comment 85 that we might have a hacky eventhandler that might cause problems. Mozmill's code is on github: https://github.com/mozilla/mozmill The keypress event gets handled by EventUtils.js here: https://github.com/mozilla/mozmill/blob/master/mozmill/mozmill/extension/resource/stdlib/EventUtils.js#L255 Could you please look into this. Thanks
Attachment #785718 - Attachment is obsolete: true
Flags: needinfo?(masayuki)
Does the testcase causes keydown event of escape key? nsXULPopupManager handles keydown event for non-printable key operation like pressing escape key.
Flags: needinfo?(masayuki)
We are issuing a keypress event through nsIDOMWindowUtils Just to make sure, should we switch to issuing all/most keydown/press/up events through nsXULPopupManager? Or are only some specific type of events that should go through nsXULPopupManager? Thanks for the fast response!
Flags: needinfo?(masayuki)
> controller.keypress(null, "VK_ESCAPE", {type: "keypress"}); If |{type: "keypress"}| this is an argument of EventUtils.synthesizeKey(), it causes *only* keypress event. If so, there is no keydown event, which causes nsXULPopupManager failing to close any popup. Any testcases should dispatch a set of keydown, keypress (if necessary), keyup because one of the key event handlers of them might cause a bug even if you want to test one of the key events. http://mxr.mozilla.org/mozilla-central/source/layout/xul/base/src/nsXULPopupManager.cpp?rev=d26846484b7c#2201 http://mxr.mozilla.org/mozilla-central/source/layout/xul/base/src/nsXULPopupManager.cpp?rev=d26846484b7c#1964
Flags: needinfo?(masayuki)
Whiteboard: [mozmill-2.0?]
Hm, that sounds like a blocker then for Mozmill 2.0. Thanks for the information Masayuki! Andrei, can you please focus on this bug the next days? Also it would be good to know if that is something we have to fix for Mozmill 1.5.
As per Masayuki's explanation, I've fixed our mutt test by issuing a keydown event when trying to close the context menu. I haven't found any problems in 1.5 (we haven't seen anything in our daily runs) If we do, we'll have to make sure our tests also issue a keydown before a keypress.
Attachment #790158 - Flags: review?(hskupin)
Attachment #790158 - Flags: review?(dave.hunt)
I believe that for testing key operation, a set of keydown/keypress(only when keydown isn't consumed)/keyup should be fired because combination of each key event handlers may cause unexpected behavior. E.g., two or more actions occur for one key operation.
We're failing here not when testing a specific event, but when dismissing a context menu after a test. I've initially triggered both a keydown then a keypress, but it seems to work just as well with only a keydown. I guess we could leave it with both events fired for increased stability.
Updated to trigger both keydown and keypress for increased stability.
Attachment #790158 - Attachment is obsolete: true
Attachment #790158 - Flags: review?(hskupin)
Attachment #790158 - Flags: review?(dave.hunt)
Attachment #790171 - Flags: review?(hskupin)
Attachment #790171 - Flags: review?(dave.hunt)
Comment on attachment 790171 [details] [diff] [review] 0001-Bug-898378-Triggered-a-keydown-event-before-a-keypre.patch > + controller.keypress(lname, "VK_ESCAPE", {type: "keydown"}); > controller.keypress(lname, "VK_ESCAPE", {type: "keypress"}); If keydown is consumed by somebody, the keypress event shouldn't be fired since it's the new correct behavior.
Attachment #790171 - Attachment is obsolete: true
Attachment #790171 - Flags: review?(hskupin)
Attachment #790171 - Flags: review?(dave.hunt)
Comment on attachment 790158 [details] [diff] [review] 0001-Bug-898378-Triggered-a-keydown-event-before-a-keypre.patch Uhm, reverted to initial patch where we only trigger the keydown.
Attachment #790158 - Attachment is obsolete: false
Attachment #790158 - Flags: review?(hskupin)
Attachment #790158 - Flags: review?(dave.hunt)
Wow, that sounds complicated and I hope at some time we will get native events for Mozmill. At latest when we move to Marionette. Looks like there is no easy way to generalize the keypress actions. But good to know how that works now. Thanks Masayuki.
Comment on attachment 790158 [details] [diff] [review] 0001-Bug-898378-Triggered-a-keydown-event-before-a-keypre.patch Review of attachment 790158 [details] [diff] [review]: ----------------------------------------------------------------- Andrei, for the future please keep by our patch version names and don't take the default as what Bugzilla proposes. That makes it hard to find the right revisions of the patch for diff. ::: mutt/mutt/tests/js/testController/testExpectedEvents.js @@ +47,4 @@ > expect.throws(function () { > controller.rightClick(lname, 2, 2, {type: "click"}); > }, "Error", "Opening a context menu shouldn't raise a click event."); > + controller.keypress(lname, "VK_ESCAPE", {type: "keydown"}); Please update the test so we do not use controller.keypress but %elem%.keypress. It might be helpful to spun off a new bug for all the other tests which make use of controller.* keyboard and mouse actions. Also not sure what happened here and why the modifier has been added to this function call. Removing it should also fix our problem. @@ +51,4 @@ > > expect.doesNotThrow(function () { > controller.rightClick(lname, 2, 2, {type: "contextmenu"}); > + }, "Error", "Opening a context menu does faire a contextmenu event."); Something is broken with that message. Can you please fix the 'faire' part?
Attachment #790158 - Flags: review?(hskupin)
Attachment #790158 - Flags: review?(dave.hunt)
Attachment #790158 - Flags: review-
Opened bug 905939 for updating all controller.* deprecated methods.
Attached patch patch v3Splinter Review
Removed the modifier altogether. Good idea! We just want to dismiss the context menu, we don't really care in these 2 cases about the specific event. Updated code from deprecated controller.method to elem.method All instances expect elem.type which we seem to miss, opened bug 905959 to fix that. And fixed message typo. Running a complete mutt testjs run, if we pass all tests, we get 0 in the final reporting, if we have at least 1 failure we got correct readings. Tested and it is not related to this bug, will investigate and file one appropriately.
Attachment #790158 - Attachment is obsolete: true
Attachment #791213 - Flags: review?(hskupin)
Attachment #791213 - Flags: review?(dave.hunt)
Comment on attachment 791213 [details] [diff] [review] patch v3 Review of attachment 791213 [details] [diff] [review]: ----------------------------------------------------------------- Landed on master: https://github.com/mozilla/mozmill/commit/fe9ba4b43c7ffdbf455bc39fa6d2911fabdd147f
Attachment #791213 - Flags: review?(hskupin)
Attachment #791213 - Flags: review?(dave.hunt)
Attachment #791213 - Flags: review+
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Whiteboard: [mozmill-2.0?] → [mozmill-2.0][ateamtrack: p=mozmill q=2013q3 m=2]
Product: Testing → Testing Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: