Closed Bug 482537 Opened 16 years ago Closed 16 years ago

Safeguard against exceptions in event-chained tests

Categories

(Core :: Disability Access APIs, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: davidb, Assigned: davidb)

References

(Blocks 1 open bug)

Details

(Keywords: access)

Attachments

(1 file, 2 obsolete files)

Attached file patch 1 (obsolete) —
This came up while I was working on bug 473732. If an exception occurs in testActions things, I've seen the test sort of "restart"... which raising concerns. Attaching proposed defense patch.
Attachment #366605 - Flags: review?(marco.zehe)
Assignee: nobody → david.bolter
Status: NEW → ASSIGNED
Comment on attachment 366605 [details]
patch 1

Could you fix the typo in nsIAccessible_actions.js where the "," is where the ";" should be?
Running with this patch and the test_nsIAccessible_combobox.xul file enabled, I get a semi-endless loop. The first run goes up to the point where the comboboxes file should be running, then starts over. In this second run, I get the following errors:

28 INFO TEST-PASS | chrome://mochikit/content/a11y/accessible/test_actions.xul | click hasn't been fired for buttonmenu
29 ERROR TEST-UNEXPECTED-FAIL | chrome://mochikit/content/a11y/accessible/test_actions.xul | Can't get accessible for buttonmenu_item
30 ERROR TEST-UNEXPECTED-FAIL | chrome://mochikit/content/a11y/accessible/test_actions.xul | Error thrown during test: acc is null - got 0, expected 1

The test run also runs up to test_nsIAccessible_comboboxes.xul.

A third test run passes with all tests also up to test_nsIAccessible_comboboxes.xul.

The fourth test run runs up to this point, then hangs indefinitely:

35 INFO Running chrome://mochikit/content/a11y/accessible/test_actions_aria.html...
36 ERROR TEST-UNEXPECTED-FAIL | chrome://mochikit/content/a11y/accessible/test_actions_aria.html | Error thrown during test: uncaught exception: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIDOMNSDocument.hasFocus]"  nsresult: "0x80004005 (NS_ERROR_FAILURE)"  location: "JS frame :: chrome://mochikit/content/tests/SimpleTest/TestRunner.js :: anonymous :: line 75"  data: no] - got 0, expected 1
38 INFO Running chrome://mochikit/content/a11y/accessible/test_actions_inputs.html...
Attached patch patch 2 (obsolete) — Splinter Review
Might as well, since we are here.
Attachment #366605 - Attachment is obsolete: true
Attachment #366647 - Flags: review?(marco.zehe)
Attachment #366605 - Flags: review?(marco.zehe)
(In reply to comment #2)
> Running with this patch and the test_nsIAccessible_combobox.xul file enabled, I
> get a semi-endless loop.

The whole accessible test suite passes for me with these patches (on Mac).
Comment on attachment 366647 [details] [diff] [review]
patch 2

r=me. Thanks!
Attachment #366647 - Flags: review?(marco.zehe) → review+
On second thought, it might be better to move the try catch block into nsIAccessible_actions.js. I'll do that soonish.
Attached patch patch 3Splinter Review
Attachment #366647 - Attachment is obsolete: true
Attachment #367095 - Flags: review?(marco.zehe)
Comment on attachment 367095 [details] [diff] [review]
patch 3

Yes, that's the way to go, thanks!
Attachment #367095 - Flags: review?(marco.zehe) → review+
Attachment #367095 - Flags: review?(surkov.alexander)
Comment on attachment 367095 [details] [diff] [review]
patch 3

fine with me
Attachment #367095 - Flags: review?(surkov.alexander) → review+
Pushed on David's behalf in changeset:
http://hg.mozilla.org/mozilla-central/rev/b0aeb469c2d4
Status: ASSIGNED → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: