Bug 1178202 - Use MozReftestInvalidate event in invalidate-1.html for landing Bug 1283302 r?mstange draft
authorNeerja Pancholi <npancholi@mozilla.com>
Wed, 02 Nov 2016 18:14:22 -0700
changeset 434079 f0704f0222ac4fa6558408df23cf05f765250d5c
parent 432738 3bfde35a0d18a643485ffd5073f3bc6a79e0ae48
child 536014 f410157e503fef71bfa16fe674f2b3c1ed81a80f
push id34713
push userbmo:npancholi@mozilla.com
push dateFri, 04 Nov 2016 19:56:42 +0000
reviewersmstange
bugs1178202, 1283302
milestone52.0a1
Bug 1178202 - Use MozReftestInvalidate event in invalidate-1.html for landing Bug 1283302 r?mstange MozReview-Commit-ID: G4Towoy0XpF
layout/reftests/image-element/invalidate-1.html
--- a/layout/reftests/image-element/invalidate-1.html
+++ b/layout/reftests/image-element/invalidate-1.html
@@ -1,7 +1,18 @@
 <!DOCTYPE HTML>
-<html>
+<html class="reftest-wait">
+<script>
+  /* this test shouldn't need reftest-wait, but if the reftest snapshot is triggered before we've painted,
+   * then we might not get a chance to invalidate the -moz-element div in time
+   * See Bug 1283302
+   */
+  window.addEventListener("MozReftestInvalidate", endTest);
+
+  function endTest() {
+    document.documentElement.removeAttribute("class");
+  }
+</script>
 <body>
 <div id="A" style="background:url(repeatable-diagonal-gradient.png?1234); width:100px; height:100px"></div>
 <div style="background:-moz-element(#A); width:100px; height:100px;"></div>
 </body>
 </html>