Closed Bug 515133 Opened 15 years ago Closed 15 years ago

Intermittent failure of test_bug420863.html: td3: 'click' action hasn't been performed

Categories

(Core :: Disability Access APIs, defect)

x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla1.9.3a1

People

(Reporter: ehsan.akhgari, Assigned: MarcoZ)

References

()

Details

(Keywords: intermittent-failure)

Attachments

(1 file, 3 obsolete files)

http://tinderbox.mozilla.org/showlog.cgi?log=Firefox/1252384967.1252389966.720.gz
OS X 10.5.2 mozilla-central unit test on 2009/09/07 21:42:47

640 INFO Running chrome://mochikit/content/a11y/accessible/test_bug420863.html...
641 INFO TEST-PASS | chrome://mochikit/content/a11y/accessible/test_bug420863.html | td1: shouldn't have actions
642 INFO TEST-PASS | chrome://mochikit/content/a11y/accessible/test_bug420863.html | td2: should have one action
643 INFO TEST-PASS | chrome://mochikit/content/a11y/accessible/test_bug420863.html | td2: should have 'click' action
644 INFO TEST-PASS | chrome://mochikit/content/a11y/accessible/test_bug420863.html | td2: 'click' action hasn't been performed
645 INFO TEST-PASS | chrome://mochikit/content/a11y/accessible/test_bug420863.html | td3: should have one action
646 INFO TEST-PASS | chrome://mochikit/content/a11y/accessible/test_bug420863.html | td3: should have 'click' action
647 ERROR TEST-UNEXPECTED-FAIL | chrome://mochikit/content/a11y/accessible/test_bug420863.html | td3: 'click' action hasn't been performed
648 INFO TEST-KNOWN-FAIL | chrome://mochikit/content/a11y/accessible/test_bug420863.html | gAcc.numActions should not throw after click handler was removed!
Whiteboard: [orange]
Taking.
Status: NEW → ASSIGNED
Attached patch WIP, doesn't work yet (obsolete) — Splinter Review
This patch doesn't seem to work yet. It has 1 test failure in the test before the removal of the event listener, and all subsequent files give an error "nsIAccessibleEvent hasn't been defined" and other epic failures.

Alex, any idea what I'm doing wrong?
Assignee: nobody → marco.zehe
I don't understand why you saved addEventListener stuffs. The problem can lie
in you call SimpleTest.finish() manually, however it is called by testActions
function. I think you fnished tests before they were testActions did the work
and therefore it didn't remove a11y event listeners (that's the reason of
nsIAccessibleEvent I think).
Attached patch WIP2 (obsolete) — Splinter Review
With this, I get the following:

651 INFO Running chrome://mochikit/content/a11y/accessible/test_bug420863.html...
652 INFO TEST-PASS | chrome://mochikit/content/a11y/accessible/test_bug420863.html | Simple table cell shouldn't have any actions
653 INFO TEST-PASS | chrome://mochikit/content/a11y/accessible/test_bug420863.html | No actions on the accessible for  'td2' 
654 INFO TEST-PASS | chrome://mochikit/content/a11y/accessible/test_bug420863.html | Wrong action name of the accessible for  'td2' 
655 INFO TEST-PASS | chrome://mochikit/content/a11y/accessible/test_bug420863.html | test with ID = 'mousedown event handling' failed. No mousedown event.
656 INFO TEST-PASS | chrome://mochikit/content/a11y/accessible/test_bug420863.html | test with ID = 'mouseup event handling' failed. No mouseup event.
657 INFO TEST-PASS | chrome://mochikit/content/a11y/accessible/test_bug420863.html | test with ID = 'click event handling' failed. No click event.
658 ERROR TEST-UNEXPECTED-FAIL | chrome://mochikit/content/a11y/accessible/test_bug420863.html | [SimpleTest/SimpleTest.js, window.onerror] An error occurred - uncaught exception: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIAccessible.numActions]"  nsresult: "0x80004005 (NS_ERROR_FAILURE)"  location: "JS frame :: chrome://mochikit/content/a11y/accessible/actions.js :: actionInvoker_invoke :: line 103"  data: no]

Alex, any idea why the accessible seems to be invalid for this call? I suspect it's trying to do something with td3Acc.
Attachment #399420 - Attachment is obsolete: true
I have no ideas on the glance, it's needed to debug I think.
One thing: gClickHandler is not defined
getNode(this.ID).removeEventListener("click", gClickHandler, false);

I think you meant gTdClickEventHandler.

HTH
Or you need to wrap the gTdClickHandler with gClickHandler = { handleEvent:...
The other thing that can confound this is that doAction is essentially asynchronous. So when we call myAcc.doAction(0) our C++ code eventually ends up in nsAccessible::DoCommand where we use a one shot timer for the actual click.

This should be quick, but maybe js wins sometimes (perhaps layout is busy) and we get ahead of ourselves?

I actually like the original test, but maybe try increasing the timer delay in:
      gAcc.doAction(0);

      // actions are performed via timeout
      window.setTimeout(doTest3, 0);

Perhaps window.setTimeout(doTest3, 50); would suffice.
Attached patch Patch (obsolete) — Splinter Review
Got it working! Had to fix a typo (see David's comment above), and also had to keepe the click handler as a global var. I also had to pass the node into the array instead of the acc, and now it works.
Attachment #399440 - Attachment is obsolete: true
Attachment #399687 - Flags: review?(surkov.alexander)
Comment on attachment 399687 [details] [diff] [review]
Patch


> 
>       // register 'click' event handler
>       gClickHandler = {
>         handleEvent: function handleEvent(aEvent)
>         {
>           gTdClickEventHandler = true;
>         }
>       };

>+          ID: td3Node,
>+          actionName: "click",
>+          actionIndex: 0,
>+          events: CLICK_EVENTS,
>+          checkOnClickEvent: function check(aEvent)
>+          {
>+            ok(gTdClickEventHandler,
>+               "td3: 'click' action hasn't been performed");

it doesn't make sense to use and check gTdClickEventHandler variable because checkOnClickEvent means click event was handled already.


>+            // check actions
>+            // XXX see bug 456347, sometimes after removing the event listener, the
>+            // accessible is no longer valid.
>+            var numActions = -1;
>+            try {
>+              numActions = getAccessible(this.ID).numActions;
>+            } catch(e) {}
> 
>-      // unregister click event handler
>-      gNode.removeEventListener("click", gClickHandler, false);
>+            if (numActions == -1)
>+              todo(false,
>+                   "gAcc.numActions should not throw after click handler was removed!");
>+            else
>+              is(numActions, 0, "td3 shouldn't have actions");
>+          }

bug 456347 is worksforme, so we don't need this code. Just check numActions.
Attachment #399687 - Flags: review?(surkov.alexander)
Attachment #399687 - Attachment is obsolete: true
Attachment #399693 - Flags: review?(surkov.alexander)
Comment on attachment 399693 [details] [diff] [review]
Patch2, addresses Surkov's comments


>+          checkOnClickEvent: function check(aEvent)
>+          {
>+            ok(true,
>+               "td3: 'click' action hasn't been performed");

this ok is not necessary as well because there is ok inside of evenQueue when click is handled, otherwise should ok.
Attachment #399693 - Flags: review?(surkov.alexander) → review+
Pushed with comment addressed: http://hg.mozilla.org/mozilla-central/rev/0a71e9c0cdec
Status: ASSIGNED → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
Flags: in-testsuite+
Target Milestone: --- → mozilla1.9.3a1
Whiteboard: [orange]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: