Bug 1403231 - Add accessibility tests for the XUL "image" element. r=surkov
authorPaolo Amadini <paolo.mozmail@amadzone.org>
Wed, 01 Nov 2017 13:05:27 +0000
changeset 443303 469018312d09835aa48f3ba532077180e15e5191
parent 443302 fc7fdeed66bc8a7232822bef6b87f7ad0f462169
child 443304 58101c3badd54b512456a23342930c45c3127439
push id1618
push userCallek@gmail.com
push dateThu, 11 Jan 2018 17:45:48 +0000
treeherdermozilla-release@882ca853e05a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssurkov
bugs1403231
milestone58.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1403231 - Add accessibility tests for the XUL "image" element. r=surkov MozReview-Commit-ID: Zp0hoO5Rox
accessible/tests/mochitest/role/test_general.xul
accessible/tests/mochitest/tree/a11y.ini
accessible/tests/mochitest/tree/test_image.xul
--- a/accessible/tests/mochitest/role/test_general.xul
+++ b/accessible/tests/mochitest/role/test_general.xul
@@ -13,16 +13,21 @@
           src="../common.js"></script>
   <script type="application/javascript"
           src="../role.js"></script>
 
   <script type="application/javascript">
   <![CDATA[
     function doTest()
     {
+      ok(!isAccessible("image"),
+                      "image without tooltiptext shouldn't be accessible.");
+      testRole("image-tooltiptext", ROLE_GRAPHIC);
+      testRole("image-onclick", ROLE_PUSHBUTTON);
+
       ok(!isAccessible("statusbarpanel"),
                       "statusbarpanel shouldn't be accessible.");
       testRole("statusbarpanel-iconic", ROLE_PUSHBUTTON);
       testRole("statusbarpanel-iconic-text", ROLE_PUSHBUTTON);
       testRole("statusbar", ROLE_STATUSBAR);
 
       SimpleTest.finish();
     }
@@ -42,16 +47,20 @@
     </a>
   <p id="display"></p>
     <div id="content" style="display: none">
     </div>
     <pre id="test">
     </pre>
   </body>
 
+  <image id="image" src="../moz.png"/>
+  <image id="image-tooltiptext" src="../moz.png" tooltiptext="hello"/>
+  <image id="image-onclick" src="../moz.png" onclick=""/>
+
   <statusbarpanel id="statusbarpanel"></statusbarpanel>
   <statusbarpanel id="statusbarpanel-iconic" class="statusbarpanel-iconic"></statusbarpanel>
   <statusbarpanel id="statusbarpanel-iconic-text" class="statusbarpanel-iconic-text"></statusbarpanel>
   <statusbar id="statusbar"></statusbar>
 
   </hbox>
 </window>
 
--- a/accessible/tests/mochitest/tree/a11y.ini
+++ b/accessible/tests/mochitest/tree/a11y.ini
@@ -29,16 +29,17 @@ skip-if = true # Bug 561508
 [test_dockids.html]
 [test_filectrl.html]
 [test_formctrl.html]
 skip-if = buildapp == "mulet"
 [test_formctrl.xul]
 [test_gencontent.html]
 [test_groupbox.xul]
 [test_iframe.html]
+[test_image.xul]
 [test_img.html]
 [test_invalid_img.xhtml]
 [test_invalidationlist.html]
 [test_list.html]
 [test_map.html]
 [test_media.html]
 skip-if = buildapp == "mulet"
 [test_select.html]
new file mode 100644
--- /dev/null
+++ b/accessible/tests/mochitest/tree/test_image.xul
@@ -0,0 +1,59 @@
+<?xml version="1.0"?>
+<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
+<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css"
+                 type="text/css"?>
+
+<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
+        title="Accessible XUL textbox and textarea hierarchy tests">
+
+  <script type="application/javascript"
+          src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js" />
+
+  <script type="application/javascript"
+          src="../common.js" />
+  <script type="application/javascript"
+          src="../role.js" />
+  <script type="application/javascript"
+          src="../events.js" />
+
+  <script type="application/javascript">
+  <![CDATA[
+    ////////////////////////////////////////////////////////////////////////////
+    // Test
+
+    function doTest()
+    {
+      var accTree = {
+        role: ROLE_GRAPHIC,
+        children: []
+      };
+      testAccessibleTree("image", accTree);
+
+      SimpleTest.finish()
+    }
+
+    SimpleTest.waitForExplicitFinish();
+    addA11yLoadEvent(doTest);
+  ]]>
+  </script>
+
+  <hbox flex="1" style="overflow: auto;">
+    <body xmlns="http://www.w3.org/1999/xhtml">
+      <a target="_blank"
+         href="https://bugzilla.mozilla.org/show_bug.cgi?id=1403231"
+         title="Remove the image XBL binding">
+        Mozilla Bug 1403231
+      </a><br/>
+      <p id="display"></p>
+      <div id="content" style="display: none">
+      </div>
+      <pre id="test">
+      </pre>
+    </body>
+
+    <vbox flex="1">
+      <image id="image" src="../moz.png" tooltiptext="hello"/>
+    </vbox>
+  </hbox>
+
+</window>