Bug 1340441: Try to make crashtest 1338772-1.html more reliable. (no review, test-only)
authorDaniel Holbert <dholbert@cs.stanford.edu>
Wed, 22 Feb 2017 15:09:57 -0800
changeset 373452 ce729354cba0048085a9851ac14feaf7439bb238
parent 373451 1c364b17c93ffb5745d283596bdc788bc028f675
child 373453 651dbded7f74434f9c2811779b316f6d2ee4d48a
push id10863
push userjlorenzo@mozilla.com
push dateMon, 06 Mar 2017 23:02:23 +0000
treeherdermozilla-aurora@0931190cd725 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1340441, 1338772
milestone54.0a1
Bug 1340441: Try to make crashtest 1338772-1.html more reliable. (no review, test-only) This crashtest removes "reftest-wait" in a resize handler. Right now, that resize handler isn't always being reliably triggered on TreeHerder. I suspect this is because we handle the resize before we've ever done layout on the thing being resized (the contentWindow inside of "inner"). So this patch establishes an explicit size & explicitly triggers a reflow (via "offsetTop") on inner.contentWindow, before we perform the resize tweak. This should make the resize handler be triggered more reliably (100% reliably, I expect). MozReview-Commit-ID: LX0SR8H6jW3
layout/base/crashtests/1338772-1.html
--- a/layout/base/crashtests/1338772-1.html
+++ b/layout/base/crashtests/1338772-1.html
@@ -1,24 +1,29 @@
 <!DOCTYPE html>
 <html class="reftest-wait">
 <script>
 function loadHandler() {
   var outer = document.getElementById("outer");
-  var inner = document.createElement('iframe');
+  var inner = document.createElement("iframe");
+  inner.height = "1px";
   outer.contentDocument.body.appendChild(inner);
 
+  // Flush reflow inside our inner iframe. This ensures that our inner.height
+  // tweak further down will actually invoke the resize handler.
+  inner.contentWindow.offsetTop;
+
   // Set up resize handler (which ends the test, one way or another)
   inner.contentWindow.onresize = () => {
     outer.remove();
     document.documentElement.removeAttribute("class");
   };
 
   // Trigger the resize handler:
-  inner.height = '0px';
+  inner.height = "5px";
   inner.offsetTop;
 }
 </script>
 <body>
   <iframe id="outer"
           src="data:text/html,<html><body>"
           onload="loadHandler()">
   </iframe>