If you think a bug might affect users in the 57 release, please set the correct tracking and status flags for Release Management.

Create nsIAccessibleDocument mochitests

RESOLVED FIXED in mozilla1.9.1a1

Status

()

Core
Disability Access APIs
RESOLVED FIXED
9 years ago
6 years ago

People

(Reporter: MarcoZ, Assigned: MarcoZ)

Tracking

(Blocks: 1 bug, {access})

Trunk
mozilla1.9.1a1
access
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Assignee)

Description

9 years ago
Test that value contains URL (see bug 438784) and test the interface methods.
(Assignee)

Comment 1

9 years ago
Created attachment 326638 [details] [diff] [review]
nsIAccessibleDocument mochitest file

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)
(Assignee)

Comment 2

9 years ago
Bug 438784 only exposes the URL in platform specific code and cannot be tested here. Removing dependency.
No longer blocks: 438784

Comment 3

9 years ago
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+
(Assignee)

Updated

9 years ago
Depends on: 442005
(Assignee)

Comment 4

9 years ago
(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.
(Assignee)

Comment 5

9 years ago
Pushed to mozilla-central in changeset:
http://hg.mozilla.org/mozilla-central/index.cgi/rev/693eeff71d52
Status: ASSIGNED → RESOLVED
Last Resolved: 9 years ago
Resolution: --- → FIXED
(Assignee)

Updated

9 years ago
Target Milestone: --- → mozilla1.9.1a1
Blocks: 735805
Depends on: 736886
No longer blocks: 735805
Depends on: 735805
You need to log in before you can comment on or make changes to this bug.