mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-13 19:41:49 +00:00
Bug 739612 - Cleanup A11y tests and test-suite organization, r=marcoz, f=surkov
--HG-- rename : accessible/tests/mochitest/elm/test_landmarks.html => accessible/tests/mochitest/attributes/test_tag.html rename : accessible/tests/mochitest/test_aria_roles.html => accessible/tests/mochitest/role/test_aria.html rename : accessible/tests/mochitest/test_aria_roles.xul => accessible/tests/mochitest/role/test_aria.xul rename : accessible/tests/mochitest/test_role_nsHyperTextAcc.html => accessible/tests/mochitest/role/test_general.html
This commit is contained in:
parent
83fa298fda
commit
14c2edb2f1
@ -56,6 +56,7 @@ DIRS = \
|
||||
name \
|
||||
pivot \
|
||||
relations \
|
||||
role \
|
||||
selectable \
|
||||
states \
|
||||
table \
|
||||
@ -92,17 +93,12 @@ _TEST_FILES =\
|
||||
states.js \
|
||||
table.js \
|
||||
value.js \
|
||||
test_aria_role_article.html \
|
||||
test_aria_role_equation.html \
|
||||
test_aria_roles.html \
|
||||
test_aria_roles.xul \
|
||||
test_aria_token_attrs.html \
|
||||
test_bug420863.html \
|
||||
test_descr.html \
|
||||
test_nsIAccessibleDocument.html \
|
||||
test_nsIAccessibleImage.html \
|
||||
test_OuterDocAccessible.html \
|
||||
test_role_nsHyperTextAcc.html \
|
||||
test_textboxes.html \
|
||||
test_textboxes.xul \
|
||||
testTextboxes.js \
|
||||
|
@ -52,7 +52,9 @@ _TEST_FILES =\
|
||||
test_obj_group.html \
|
||||
test_obj_group.xul \
|
||||
test_obj_group_tree.xul \
|
||||
test_tag.html \
|
||||
test_text.html \
|
||||
test_xml-roles.html \
|
||||
$(NULL)
|
||||
|
||||
libs:: $(_TEST_FILES)
|
||||
|
@ -19,24 +19,6 @@
|
||||
|
||||
function doTest()
|
||||
{
|
||||
testRole("nav", ROLE_SECTION);
|
||||
testRole("header", ROLE_HEADER);
|
||||
testRole("footer", ROLE_FOOTER);
|
||||
testRole("article", ROLE_DOCUMENT);
|
||||
testRole("aside", ROLE_NOTE);
|
||||
testRole("section", ROLE_SECTION); // XXX bug 739612: not a landmark
|
||||
|
||||
testRole("main", ROLE_DOCUMENT);
|
||||
testRole("form", ROLE_FORM);
|
||||
|
||||
// Some AT may look for this
|
||||
testAttrs("nav", {"xml-roles" : "navigation"}, true);
|
||||
testAttrs("footer", {"xml-roles" : "contentinfo"}, true);
|
||||
testAttrs("aside", {"xml-roles" : "complementary"}, true);
|
||||
testAttrs("section", {"xml-roles" : "region"}, true);
|
||||
testAttrs("main", {"xml-roles" : "main"}, true); // // ARIA override
|
||||
testAttrs("form", {"xml-roles" : "form"}, true);
|
||||
|
||||
// And some AT may look for this
|
||||
testAttrs("nav", {"tag" : "nav"}, true);
|
||||
testAttrs("header", {"tag" : "header"}, true);
|
77
accessible/tests/mochitest/attributes/test_xml-roles.html
Normal file
77
accessible/tests/mochitest/attributes/test_xml-roles.html
Normal file
@ -0,0 +1,77 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>XML landmark tests</title>
|
||||
<link rel="stylesheet" type="text/css"
|
||||
href="chrome://mochikit/content/tests/SimpleTest/test.css" />
|
||||
|
||||
<script type="application/javascript"
|
||||
src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
|
||||
|
||||
<script type="application/javascript"
|
||||
src="../common.js"></script>
|
||||
<script type="application/javascript"
|
||||
src="../role.js"></script>
|
||||
<script type="application/javascript"
|
||||
src="../attributes.js"></script>
|
||||
|
||||
<script type="application/javascript">
|
||||
|
||||
function doTest()
|
||||
{
|
||||
// Some AT may look for this
|
||||
testAttrs("nav", {"xml-roles" : "navigation"}, true);
|
||||
testAttrs("footer", {"xml-roles" : "contentinfo"}, true);
|
||||
testAttrs("aside", {"xml-roles" : "complementary"}, true);
|
||||
testAttrs("section", {"xml-roles" : "region"}, true);
|
||||
testAttrs("main", {"xml-roles" : "main"}, true); // // ARIA override
|
||||
testAttrs("form", {"xml-roles" : "form"}, true);
|
||||
|
||||
SimpleTest.finish();
|
||||
}
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
addA11yLoadEvent(doTest);
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<a target="_blank"
|
||||
title="Provide mappings for html5 <nav> <header> <footer> <article>"
|
||||
href="https://bugzilla.mozilla.org/show_bug.cgi?id=593368">
|
||||
Bug 593368
|
||||
</a><br/>
|
||||
<a target="_blank"
|
||||
href="https://bugzilla.mozilla.org/show_bug.cgi?id=613502"
|
||||
title="Map <article> like we do aria role article">
|
||||
Bug 613502
|
||||
</a>
|
||||
<a target="_blank"
|
||||
href="https://bugzilla.mozilla.org/show_bug.cgi?id=610650"
|
||||
title="Change implementation of HTML5 landmark elements to conform">
|
||||
Bug 610650
|
||||
</a>
|
||||
<a target="_blank"
|
||||
href="https://bugzilla.mozilla.org/show_bug.cgi?id=614310"
|
||||
title="Map section to pane (like role=region)">
|
||||
Mozilla Bug 614310
|
||||
</a>
|
||||
<a target="_blank"
|
||||
href="https://bugzilla.mozilla.org/show_bug.cgi?id=734982"
|
||||
title="Map ARIA role FORM">
|
||||
Bug 734982
|
||||
</a>
|
||||
<p id="display"></p>
|
||||
<div id="content" style="display: none"></div>
|
||||
<pre id="test">
|
||||
</pre>
|
||||
|
||||
<nav id="nav">a nav</nav>
|
||||
<footer id="footer">a footer</footer>
|
||||
<aside id="aside">by the way I am an aside</aside>
|
||||
<section id="section">a section</section>
|
||||
<article id="main" role="main">a main area</article>
|
||||
<article id="form" role="form">a form area</article>
|
||||
|
||||
</body>
|
||||
</html>
|
@ -47,7 +47,6 @@ include $(topsrcdir)/config/rules.mk
|
||||
|
||||
_TEST_FILES =\
|
||||
test_figure.html \
|
||||
test_landmarks.html \
|
||||
test_listbox.xul \
|
||||
test_nsApplicationAcc.html \
|
||||
test_plugin.html \
|
||||
|
@ -14,6 +14,7 @@
|
||||
src="../name.js"></script>
|
||||
|
||||
<script type="application/javascript">
|
||||
|
||||
function doTest()
|
||||
{
|
||||
// aria-label
|
||||
@ -136,6 +137,8 @@
|
||||
// acronym content.
|
||||
testName("label_with_acronym", "O A T F World Wide Web");
|
||||
|
||||
testName("testArticle", "Test article");
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// title attribute
|
||||
|
||||
@ -193,6 +196,10 @@
|
||||
testName("ph_textarea2", "a label");
|
||||
testName("ph_text3", "a label");
|
||||
|
||||
// Test equation image
|
||||
testName("img_eq", "x^2 + y^2 + z^2")
|
||||
testName("txt_eq", "x^2 + y^2 + z^2")
|
||||
|
||||
SimpleTest.finish();
|
||||
}
|
||||
|
||||
@ -204,6 +211,16 @@
|
||||
|
||||
<body>
|
||||
|
||||
<a target="_blank"
|
||||
href="https://bugzilla.mozilla.org/show_bug.cgi?id=428479"
|
||||
title="Bug 428479 - Support ARIA role=math">
|
||||
Mozilla Bug 428479
|
||||
</a><br>
|
||||
<a target="_blank"
|
||||
href="https://bugzilla.mozilla.org/show_bug.cgi?id=429666"
|
||||
title="Expose ROLE_DOCUMENT for ARIA landmarks that inherit from document">
|
||||
Mozilla Bug 429666
|
||||
</a><br>
|
||||
<a target="_blank"
|
||||
href="https://bugzilla.mozilla.org/show_bug.cgi?id=444279"
|
||||
title="mochitest for accessible name calculating">
|
||||
@ -409,6 +426,10 @@
|
||||
<abbr title="World Wide Web">WWW</abbr>
|
||||
</label>
|
||||
|
||||
<div id="testArticle" role="article" title="Test article">
|
||||
<p>This is a paragraph inside the article.</p>
|
||||
</div>
|
||||
|
||||
<!-- name from title attribute -->
|
||||
<span id="btn_title" role="group" title="title">15</span>
|
||||
|
||||
@ -493,5 +514,13 @@
|
||||
<label for="ph_text3">a label</label>
|
||||
<input id="ph_text3" placeholder="meh" />
|
||||
|
||||
<p>Image:
|
||||
<img id="img_eq" role="math" src="foo" alt="x^2 + y^2 + z^2">
|
||||
</p>
|
||||
|
||||
<p>Text:
|
||||
<span id="txt_eq" role="math" title="x^2 + y^2 + z^2">x<sup>2</sup> +
|
||||
y<sup>2</sup> + z<sup>2</sup></span>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
21
accessible/tests/mochitest/role/Makefile.in
Normal file
21
accessible/tests/mochitest/role/Makefile.in
Normal file
@ -0,0 +1,21 @@
|
||||
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
||||
# You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
DEPTH = ../../../..
|
||||
topsrcdir = @top_srcdir@
|
||||
srcdir = @srcdir@
|
||||
VPATH = @srcdir@
|
||||
relativesrcdir = accessible/role
|
||||
|
||||
include $(DEPTH)/config/autoconf.mk
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
|
||||
_TEST_FILES =\
|
||||
test_aria.html \
|
||||
test_aria.xul \
|
||||
test_general.html \
|
||||
$(NULL)
|
||||
|
||||
libs:: $(_TEST_FILES)
|
||||
$(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/a11y/$(relativesrcdir)
|
@ -1,24 +1,20 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<!--
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id=481114
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id=469688
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id=520188
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id=529289
|
||||
-->
|
||||
<head>
|
||||
<title>Test weak ARIA roles</title>
|
||||
|
||||
<link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css" />
|
||||
|
||||
<script type="application/javascript"
|
||||
src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
|
||||
|
||||
<script type="application/javascript"
|
||||
src="common.js"></script>
|
||||
src="../common.js"></script>
|
||||
<script type="application/javascript"
|
||||
src="role.js"></script>
|
||||
src="../role.js"></script>
|
||||
|
||||
<script type="application/javascript">
|
||||
|
||||
function doTest()
|
||||
{
|
||||
// Note:
|
||||
@ -26,6 +22,12 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=529289
|
||||
// role mapping. Similarly "strong foo" means there is a good foo-to-
|
||||
// platform role mapping.
|
||||
|
||||
testRole("articlemain", ROLE_DOCUMENT);
|
||||
testRole("articleform", ROLE_FORM);
|
||||
|
||||
// Test article exposed as document
|
||||
testRole("testArticle", ROLE_DOCUMENT);
|
||||
|
||||
// weak roles that are forms of "live regions"
|
||||
testRole("log_table", ROLE_TABLE);
|
||||
testRole("timer_div", ROLE_SECTION);
|
||||
@ -36,6 +38,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=529289
|
||||
// strong landmark
|
||||
testRole("application", ROLE_APPLICATION);
|
||||
testRole("form", ROLE_FORM);
|
||||
testRole("application_table", ROLE_APPLICATION);
|
||||
|
||||
// weak landmarks
|
||||
var weak_landmarks = ["banner", "complementary", "contentinfo",
|
||||
@ -84,6 +87,12 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=529289
|
||||
document.body.setAttribute("role", "application");
|
||||
testRole(testDoc, ROLE_APPLICATION);
|
||||
|
||||
// Test equation image
|
||||
testRole("img_eq", ROLE_FLAT_EQUATION);
|
||||
|
||||
// Test textual equation
|
||||
testRole("txt_eq", ROLE_FLAT_EQUATION);
|
||||
|
||||
SimpleTest.finish();
|
||||
}
|
||||
|
||||
@ -93,6 +102,8 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=529289
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=428479">Mozilla Bug 428479</a>
|
||||
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=429666">Mozilla Bug 429666</a>
|
||||
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=481114">Mozilla Bug 481114</a>
|
||||
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=469688">Mozilla Bug 469688</a>
|
||||
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=469688">Mozilla Bug 520188</a>
|
||||
@ -112,7 +123,14 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=529289
|
||||
<div id="content" style="display: none"></div>
|
||||
<pre id="test">
|
||||
</pre>
|
||||
|
||||
|
||||
<article id="articlemain" role="main">a main area</article>
|
||||
<article id="articleform" role="form">a form area</article>
|
||||
|
||||
<div id="testArticle" role="article" title="Test article">
|
||||
<p>This is a paragraph inside the article.</p>
|
||||
</div>
|
||||
|
||||
<!-- "live" roles -->
|
||||
<table role="log" id="log_table">
|
||||
<tr><td>Table based log</td></tr>
|
||||
@ -183,5 +201,14 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=529289
|
||||
<div role="listitem">B</div>
|
||||
<div role="listitem">C</div>
|
||||
</div>
|
||||
|
||||
<p>Image:
|
||||
<img id="img_eq" role="math" src="foo" alt="x^2 + y^2 + z^2">
|
||||
</p>
|
||||
|
||||
<p>Text:
|
||||
<span id="txt_eq" role="math" title="x^2 + y^2 + z^2">x<sup>2</sup> +
|
||||
y<sup>2</sup> + z<sup>2</sup></span>
|
||||
|
||||
</body>
|
||||
</html>
|
@ -10,7 +10,7 @@
|
||||
src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js" />
|
||||
|
||||
<script type="application/javascript"
|
||||
src="common.js"></script>
|
||||
src="../common.js"></script>
|
||||
|
||||
<script type="application/javascript">
|
||||
<![CDATA[
|
@ -8,16 +8,27 @@
|
||||
src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
|
||||
|
||||
<script type="application/javascript"
|
||||
src="common.js"></script>
|
||||
src="../common.js"></script>
|
||||
<script type="application/javascript"
|
||||
src="role.js"></script>
|
||||
src="../role.js"></script>
|
||||
<script type="application/javascript"
|
||||
src="../attributes.js"></script>
|
||||
|
||||
<script type="application/javascript">
|
||||
function doTests()
|
||||
{
|
||||
// Test html:form.
|
||||
// landmark tests section
|
||||
testRole("frm", ROLE_FORM);
|
||||
|
||||
// nsHyperTextAcc tests section
|
||||
// Test html:form.
|
||||
testRole("nav", ROLE_SECTION);
|
||||
testRole("header", ROLE_HEADER);
|
||||
testRole("footer", ROLE_FOOTER);
|
||||
testRole("article", ROLE_DOCUMENT);
|
||||
testRole("aside", ROLE_NOTE);
|
||||
testRole("section", ROLE_SECTION);
|
||||
|
||||
// test html:div
|
||||
testRole("sec", ROLE_SECTION);
|
||||
|
||||
@ -73,14 +84,49 @@
|
||||
title="Expose click action if mouseup and mousedown are registered">
|
||||
Mozilla Bug 423409
|
||||
</a>
|
||||
<a target="_blank"
|
||||
title="Provide mappings for html5 <nav> <header> <footer> <article>"
|
||||
href="https://bugzilla.mozilla.org/show_bug.cgi?id=593368">
|
||||
Bug 593368
|
||||
</a><br/>
|
||||
<a target="_blank"
|
||||
href="https://bugzilla.mozilla.org/show_bug.cgi?id=613502"
|
||||
title="Map <article> like we do aria role article">
|
||||
Bug 613502
|
||||
</a>
|
||||
<a target="_blank"
|
||||
href="https://bugzilla.mozilla.org/show_bug.cgi?id=610650"
|
||||
title="Change implementation of HTML5 landmark elements to conform">
|
||||
Bug 610650
|
||||
</a>
|
||||
<a target="_blank"
|
||||
href="https://bugzilla.mozilla.org/show_bug.cgi?id=614310"
|
||||
title="Map section to pane (like role=region)">
|
||||
Mozilla Bug 614310
|
||||
</a>
|
||||
<a target="_blank"
|
||||
href="https://bugzilla.mozilla.org/show_bug.cgi?id=734982"
|
||||
title="Map ARIA role FORM">
|
||||
Bug 734982
|
||||
</a>
|
||||
|
||||
<p id="display"></p>
|
||||
<div id="content" style="display: none"></div>
|
||||
<pre id="test">
|
||||
</pre>
|
||||
|
||||
<form id="frm" action="submit.php" method="post">
|
||||
<label for="data">File</label>:
|
||||
<input type="file" id="data" name="data" size="50"/>
|
||||
</form>
|
||||
|
||||
<nav id="nav">a nav</nav>
|
||||
<header id="header">a header</header>
|
||||
<footer id="footer">a footer</footer>
|
||||
<article id="article">an article</article>
|
||||
<aside id="aside">by the way I am an aside</aside>
|
||||
<section id="section">a section</section>
|
||||
|
||||
<p id="p">A paragraph for comparison.</p>
|
||||
<div id="sec">A normal div</div>
|
||||
<blockquote id="quote">A citation</blockquote>
|
@ -1,46 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<!--
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id=429666
|
||||
-->
|
||||
<head>
|
||||
<title>Expose ROLE_DOCUMENT for ARIA landmarks that inherit from document chrome tests</title>
|
||||
<link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css" />
|
||||
|
||||
<script type="application/javascript"
|
||||
src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
|
||||
|
||||
<script type="application/javascript"
|
||||
src="common.js"></script>
|
||||
<script type="application/javascript"
|
||||
src="role.js"></script>
|
||||
|
||||
<script type="application/javascript">
|
||||
function doTest()
|
||||
{
|
||||
// Test article exposed as document
|
||||
testRole("testArticle", ROLE_DOCUMENT);
|
||||
|
||||
var articleAcc = getAccessible("testArticle");
|
||||
if (articleAcc)
|
||||
is(articleAcc.name, "Test article", "Wrong name for article!");
|
||||
|
||||
SimpleTest.finish();
|
||||
}
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
addA11yLoadEvent(doTest);
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=429666">Mozilla Bug 429666</a>
|
||||
<p id="display"></p>
|
||||
<div id="content" style="display: none"></div>
|
||||
<pre id="test">
|
||||
</pre>
|
||||
<div id="testArticle" role="article" title="Test article">
|
||||
<p>This is a paragraph inside the article.</p>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
@ -1,57 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<!--
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id=428479
|
||||
-->
|
||||
<head>
|
||||
<title>ARIA role math chrome tests</title>
|
||||
<link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css" />
|
||||
|
||||
<script type="application/javascript"
|
||||
src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
|
||||
|
||||
<script type="application/javascript"
|
||||
src="common.js"></script>
|
||||
<script type="application/javascript"
|
||||
src="role.js"></script>
|
||||
|
||||
<script type="application/javascript">
|
||||
function testThis(aID)
|
||||
{
|
||||
getRole(aID, ROLE_FLAT_EQUATION);
|
||||
var eqAcc = getAccessible(aID);
|
||||
if (eqAcc)
|
||||
is(eqAcc.name, "x^2 + y^2 + z^2", "Wrong name for " + aID + "!");
|
||||
}
|
||||
|
||||
function doTest()
|
||||
{
|
||||
// Test equation image
|
||||
testThis("img_eq");
|
||||
|
||||
// Test textual equation
|
||||
testThis("txt_eq");
|
||||
|
||||
SimpleTest.finish();
|
||||
}
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
addA11yLoadEvent(doTest);
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=428479">Mozilla Bug 428479</a>
|
||||
<p id="display"></p>
|
||||
<div id="content" style="display: none"></div>
|
||||
<pre id="test">
|
||||
</pre>
|
||||
<p>Image:
|
||||
<img id="img_eq" role="math" src="foo" alt="x^2 + y^2 + z^2">
|
||||
</p>
|
||||
<p>Text:
|
||||
<span id="txt_eq" role="math" title="x^2 + y^2 + z^2">x<sup>2</sup> +
|
||||
y<sup>2</sup> + z<sup>2</sup></span>
|
||||
</p>
|
||||
</body>
|
||||
</html>
|
Loading…
x
Reference in New Issue
Block a user