Bug 1408636 - Ensure accessibility tests pass regardless of image caching affecting whitespace. r=yzen, a=test-only
authorAndrew Osmond <aosmond@mozilla.com>
Wed, 07 Feb 2018 07:27:28 -0500
changeset 454969 a377dbc4074c8e48c133b2c322db19ec00a71dbe
parent 454968 5c61d722e116b54a6a6e3a61ffc47839d2ef9d2e
child 454970 8306ccb1dd271181c80e9eba2129e4d563f5f204
push id1648
push usermtabara@mozilla.com
push dateThu, 01 Mar 2018 12:45:47 +0000
treeherdermozilla-release@cbb9688c2eeb [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersyzen, test-only
bugs1408636
milestone59.0
Bug 1408636 - Ensure accessibility tests pass regardless of image caching affecting whitespace. r=yzen, a=test-only
accessible/tests/mochitest/elm/test_HTMLSpec.html
accessible/tests/mochitest/name/markuprules.xml
accessible/tests/mochitest/tree/test_txtcntr.html
accessible/tests/mochitest/treeupdate/test_whitespace.html
--- a/accessible/tests/mochitest/elm/test_HTMLSpec.html
+++ b/accessible/tests/mochitest/elm/test_HTMLSpec.html
@@ -1505,20 +1505,21 @@
   <embed id="embed_plugin_windowed" type="application/x-test" wmode="window"
          width="300" height="300"></embed>
 
   <fieldset id="fieldset">
     <legend id="legend">legend</legend>
     <input />
   </fieldset>
 
-  <figure id="figure">
-    <img src="../moz.png" alt="An awesome picture">
-    <figcaption id="figcaption">Caption for the awesome picture</figcaption>
-  </figure>
+  <!-- Depending on whether or not the image is cached, layout may be able to
+       optimize away spaces between the figure, img and figcaption tags. As
+       such, we should keep everything on one line to get consistent results.
+  -->
+  <figure id="figure"><img src="../moz.png" alt="An awesome picture"><figcaption id="figcaption">Caption for the awesome picture</figcaption></figure>
 
   <footer id="footer">Some copyright info</footer>
   <article>
     <footer id="footer_in_article">Some copyright info</footer>
   </article>
   <aside>
     <footer id="footer_in_aside">Some copyright info</footer>
   </aside>
--- a/accessible/tests/mochitest/name/markuprules.xml
+++ b/accessible/tests/mochitest/name/markuprules.xml
@@ -229,31 +229,43 @@
                   aria-labelledby="l1 l2"
                   value="name from value"
                   alt="no name from alt"
                   src="no name from src"
                   data="no name from data"
                   title="no name from title"/>
     </markup>
 
+    <!--
+      Disabled due to intermittent failures (bug 1436323) which became more
+      frequent due to the landing of bug 1383682. The latter bug made loading
+      of images from cache much more consistent, which appears to have impacted
+      the timing for this test case. If the image is switched to a unique
+      image (e.g. always decoding since there is no cache), the failure rate
+      increases, presumably because the test is dependent on a specific ordering
+      of events, and implicitly assumes the image is loaded immediately.
+    -->
+
+    <!--
     <markup id="HTMLInputImageTest"
             ref="html:input" ruleset="HTMLInputImage">
       <html:span id="l1" textequiv="test2">test2</html:span>
       <html:span id="l2" textequiv="test3">test3</html:span>
       <html:label for="btn-image" textequiv="test4">test4</html:label>
       <html:input id="btn-image"
                   type="image"
                   aria-label="test1"
                   aria-labelledby="l1 l2"
                   alt="name from alt"
                   value="name from value"
                   src="../moz.png"
                   data="no name from data"
                   title="name from title"/>
     </markup>
+    -->
 
     <markup id="HTMLInputImageNoValidSrcTest"
             ref="html:input" ruleset="HTMLInputImageNoValidSrc">
       <html:span id="l1" textequiv="test2">test2</html:span>
       <html:span id="l2" textequiv="test3">test3</html:span>
       <html:label for="btn-image" textequiv="test4">test4</html:label>
       <html:input id="btn-image"
                   type="image"
--- a/accessible/tests/mochitest/tree/test_txtcntr.html
+++ b/accessible/tests/mochitest/tree/test_txtcntr.html
@@ -222,12 +222,14 @@
   </div>
   <div id="c4" contentEditable="true">
     helllo <p>blabla</p> hello
   </div>
   <div id="c5"><blockquote>Hello</blockquote></div>
   <div id="c6">This <abbr title="accessibility">a11y</abbr> test</div>
   <div id="c7">This <acronym title="personal computer">PC</acronym> is broken</div>
 
-  <!-- only whitespace between images should be exposed -->
-  <div id="c8">   <img src="../moz.png">   <img src="../moz.png">   </div>
+  <!-- Whitespace between images should be exposed. Whitespace between the
+       div and img tags will be inconsistent depending on the image cache
+       state and what optimizations layout was able to apply. -->
+  <div id="c8"><img src="../moz.png">   <img src="../moz.png"></div>
 </body>
 </html>
--- a/accessible/tests/mochitest/treeupdate/test_whitespace.html
+++ b/accessible/tests/mochitest/treeupdate/test_whitespace.html
@@ -165,14 +165,17 @@
     Mozilla Bug 625652
   </a>
 
   <p id="display"></p>
   <div id="content" style="display: none"></div>
   <pre id="test">
   </pre>
 
-  <div id="container1">  <img src="../moz.png">  <img id="img1" src="../moz.png">  <img src="../moz.png">  </div>
-  <div> <a id="container2"></a> <a><img src="../moz.png"></a> </div>
+  <!-- Whitespace between the div and img tags will be inconsistent depending
+       on the image cache state and what optimizations layout was able to
+       apply. -->
+  <div id="container1"><img src="../moz.png">  <img id="img1" src="../moz.png">  <img src="../moz.png"></div>
+  <div><a id="container2"></a> <a><img src="../moz.png"></a></div>
 
   <div id="eventdump"></div>
 </body>
 </html>