Bug 1178202 - Use MozReftestInvalidate event in invalidate-1.html for landing Bug 1283302 r=mstange
authorNeerja Pancholi <npancholi@mozilla.com>
Wed, 02 Nov 2016 18:14:22 -0700
changeset 351876 0da5a6f77ffb2e1c4629cc0290b05be6bedd773e
parent 351875 069a6200844132e8e517940e45cd9528263a2e46
child 351877 65e979c6c06bcbfa32aee31ba11deb947700fb58
push id6795
push userjlund@mozilla.com
push dateMon, 23 Jan 2017 14:19:46 +0000
treeherdermozilla-esr52@76101b503191 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
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>