Closed Bug 441737 Opened 12 years ago Closed 12 years ago

Create nsIAccessibleDocument mochitests

Categories

(Core :: Disability Access APIs, defect)

defect
Not set

Tracking

()

RESOLVED FIXED
mozilla1.9.1a1

People

(Reporter: MarcoZ, Assigned: MarcoZ)

References

(Blocks 1 open bug)

Details

(Keywords: access)

Attachments

(1 file)

Test that value contains URL (see bug 438784) and test the interface methods.
Only problem is that nsDocAccessible::getDocType alwways returns NS_ERROR_FAILURE.

Questions:
1. I have no idea what to pass into the getNameSpaceURIForID method to get something useful.
2. What should I pass into the getAccessibleInParentChain method, and what should I compare it against (if applicable)?
Assignee: nobody → marco.zehe
Status: NEW → ASSIGNED
Attachment #326638 - Flags: review?(surkov.alexander)
Bug 438784 only exposes the URL in platform specific code and cannot be tested here. Removing dependency.
No longer blocks: 438784
Comment on attachment 326638 [details] [diff] [review]
nsIAccessibleDocument mochitest file


>+        // nsIAccessibleDocument
>+        is(docAcc.URL, "chrome://mochikit/content/a11y/accessible/test_nsIAccessibleDocument.html",
>+           "Wrong URL for document!");
>+        is(docAcc.title, "nsIAccessibleDocument chrome tests",        
>+           "Wrong title for document!");
>+        is(docAcc.mimeType, "text/html",
>+           "Wrong mime type for document!");
>+        // nsDocAccessible::getDocType currently returns NS_ERROR_FAILURE
>+//        is(docAcc.docType, "HTML",
>+//           "Wrong type of document!");

what about this?

>+
>+        // Test for correct nsIDOMDocument retrieval.
>+        var domDoc = null;
>+        try {
>+          domDoc = docAcc.document.QueryInterface(nsIDOMDocument);
>+        } catch(e) {}
>+        ok(domDoc, "no nsIDOMDocument for this doc accessible!");
>+
>+        // Test for correct nsIDOMWindow retrieval.
>+        var domWindow = null;
>+        try {
>+          domWindow = docAcc.window.QueryInterface(nsIDOMWindow);
>+        } catch(e) {}
>+        ok(domWindow, "no nsIDOMWindow for this doc accessible!");
>+      }

you could compare them additionally with document and window objects, right?

I don't think we want to test for getNameSpaceURIForID, getAccessibleInParentChain because it's utility methods and I"m not sure about the reason they are public.

it makes sense to put similar test for XUL.
Attachment #326638 - Flags: review?(surkov.alexander) → review+
Depends on: 442005
(In reply to comment #3)
> >+        // nsDocAccessible::getDocType currently returns NS_ERROR_FAILURE
> >+//        is(docAcc.docType, "HTML",
> >+//           "Wrong type of document!");
> what about this?

My experiment didn't work out, filed bug 442005 on this one.

> you could compare them additionally with document and window objects, right?

Done!

> it makes sense to put similar test for XUL.

I tried, but it seems XUL documents don't implement the nsIAccessibleDocument interface. xul:window etc. are windows, not documents in the traditional sense. The only place where XUL could be visible inside a document is in an XHTML document I believe.

Or there is XUL markup which I'm not aware of that may cause nsIAccessibleDocument to get used, but I'd need pointers on that.
Pushed to mozilla-central in changeset:
http://hg.mozilla.org/mozilla-central/index.cgi/rev/693eeff71d52
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla1.9.1a1
No longer blocks: 735805
Depends on: 735805
You need to log in before you can comment on or make changes to this bug.