From 5f8de423f190bbb79a62f804151bc24824fa32d8 Mon Sep 17 00:00:00 2001 From: "Matt A. Tobin" Date: Fri, 2 Feb 2018 04:16:08 -0500 Subject: Add m-esr52 at 52.6.0 --- accessible/tests/mochitest/hyperlink/a11y.ini | 7 + accessible/tests/mochitest/hyperlink/hyperlink.js | 42 ++++ .../tests/mochitest/hyperlink/test_general.html | 279 +++++++++++++++++++++ .../tests/mochitest/hyperlink/test_general.xul | 97 +++++++ 4 files changed, 425 insertions(+) create mode 100644 accessible/tests/mochitest/hyperlink/a11y.ini create mode 100644 accessible/tests/mochitest/hyperlink/hyperlink.js create mode 100644 accessible/tests/mochitest/hyperlink/test_general.html create mode 100644 accessible/tests/mochitest/hyperlink/test_general.xul (limited to 'accessible/tests/mochitest/hyperlink') diff --git a/accessible/tests/mochitest/hyperlink/a11y.ini b/accessible/tests/mochitest/hyperlink/a11y.ini new file mode 100644 index 000000000..f37dca8e1 --- /dev/null +++ b/accessible/tests/mochitest/hyperlink/a11y.ini @@ -0,0 +1,7 @@ +[DEFAULT] +support-files = hyperlink.js + !/accessible/tests/mochitest/*.js + !/accessible/tests/mochitest/letters.gif + +[test_general.html] +[test_general.xul] diff --git a/accessible/tests/mochitest/hyperlink/hyperlink.js b/accessible/tests/mochitest/hyperlink/hyperlink.js new file mode 100644 index 000000000..4daa16275 --- /dev/null +++ b/accessible/tests/mochitest/hyperlink/hyperlink.js @@ -0,0 +1,42 @@ +/** + * Focus hyperlink invoker. + * + * @param aID [in] hyperlink identifier + * @param aSelectedAfter [in] specifies if hyperlink is selected/focused after + * the focus + */ +function focusLink(aID, aSelectedAfter) +{ + this.node = getNode(aID); + this.accessible = getAccessible(this.node); + + this.eventSeq = []; + this.unexpectedEventSeq = []; + + var checker = new invokerChecker(EVENT_FOCUS, this.accessible); + if (aSelectedAfter) + this.eventSeq.push(checker); + else + this.unexpectedEventSeq.push(checker); + + this.invoke = function focusLink_invoke() + { + var expectedStates = (aSelectedAfter ? STATE_FOCUSABLE : 0); + var unexpectedStates = (!aSelectedAfter ? STATE_FOCUSABLE : 0) | STATE_FOCUSED; + testStates(aID, expectedStates, 0, unexpectedStates, 0); + + this.node.focus(); + } + + this.finalCheck = function focusLink_finalCheck() + { + var expectedStates = (aSelectedAfter ? STATE_FOCUSABLE | STATE_FOCUSED : 0); + var unexpectedStates = (!aSelectedAfter ? STATE_FOCUSABLE | STATE_FOCUSED : 0); + testStates(aID, expectedStates, 0, unexpectedStates, 0); + } + + this.getID = function focusLink_getID() + { + return "focus hyperlink " + prettyName(aID); + } +} diff --git a/accessible/tests/mochitest/hyperlink/test_general.html b/accessible/tests/mochitest/hyperlink/test_general.html new file mode 100644 index 000000000..e6e098ecc --- /dev/null +++ b/accessible/tests/mochitest/hyperlink/test_general.html @@ -0,0 +1,279 @@ + + + + + nsIHyperLinkAccessible chrome tests + + + + + + + + + + + + + + + +Mozilla Bug 418368

+  

Simple link:
Mozilla Foundation
ARIA link:
Mozilla Foundation Home
Invalid, non-focusable hyperlink:
Invalid link
Image map:
ba
Empty link:

Link with embedded span
Heise Online
Named anchor, must not have "linked" state for it to be exposed correctly:
This should never be of state_linked
Link having no attributes, must not have "linked" state:This should never be of state_linked
Link with registered 'click' event: This should have state_linked
Link with title attribute (no name from subtree):
Link with title attribute (name from subtree): the name from subtree
Link with title attribute (name from nested image): The title for link

Map that is used to group links (www.w3.org/TR/WCAG10-HTML-TECHS/#group-bypass), also see the bug 431615:
+ diff --git a/accessible/tests/mochitest/hyperlink/test_general.xul b/accessible/tests/mochitest/hyperlink/test_general.xul new file mode 100644 index 000000000..c7b838a15 --- /dev/null +++ b/accessible/tests/mochitest/hyperlink/test_general.xul @@ -0,0 +1,97 @@ + + + + + + + + + + + Mozilla Bug 421066 + +

+ +
+    
+ + + +
-- cgit v1.2.3