Bug 1256190 - Tweak tests to fix intermittent orange. r=me
authorMats Palmgren <mats@mozilla.com>
Mon, 14 Mar 2016 06:56:00 -0400
changeset 288585 d3e7438627082b292825c29152df8c5dcc70fd29
parent 288584 77d65c5c24227ef7524552b8559f289b19fdca65
child 288586 ca9afdab1431702ab0b80e5dd3310aaa85deeba3
push id18174
push usercbook@mozilla.com
push dateTue, 15 Mar 2016 09:44:58 +0000
treeherderfx-team@dd0baa33759d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersme
bugs1256190
milestone48.0a1
Bug 1256190 - Tweak tests to fix intermittent orange. r=me
layout/reftests/forms/select/focusring-2.html
layout/reftests/forms/select/focusring-3.html
--- a/layout/reftests/forms/select/focusring-2.html
+++ b/layout/reftests/forms/select/focusring-2.html
@@ -11,27 +11,36 @@
 :-moz-focusring {
   outline: 2px dashed black;
 }
 
     </style>
 </head>
 <body>
 
-<select><option>1<option>2</select>
+<select onfocus="continueTest1()" onblur="continueTest2()"><option>1<option>2</select>
 
 <script>
 
+function continueTest2(){
+  var s = document.querySelector("select");
+  setTimeout(function(){ s.style.display = 'inline'; document.body.offsetHeight; }, 4);
+  setTimeout(function(){ document.body.offsetHeight; document.documentElement.removeAttribute("class"); }, 100);
+}
+
+function continueTest1(){
+  var s = document.querySelector("select");
+  setTimeout(function(){ s.style.display = 'none';   }, 2);
+  setTimeout(function(){ s.blur();  document.body.offsetHeight; }, 3);
+}
+
 function runTests(){
   var s = document.querySelector("select");
-  setTimeout(function(){ s.focus();                  }, 1);
-  setTimeout(function(){ s.style.display = 'none';   }, 2);
-  setTimeout(function(){ s.blur();                   }, 3);
-  setTimeout(function(){ s.style.display = 'inline'; }, 4);
-  setTimeout(function(){ document.body.offsetHeight; document.documentElement.removeAttribute("class"); }, 0);
+  s.focus();
 }
 
+window.focus();
 window.addEventListener("MozReftestInvalidate", runTests, false);
 
 </script>
 
 </body>
 </html>
--- a/layout/reftests/forms/select/focusring-3.html
+++ b/layout/reftests/forms/select/focusring-3.html
@@ -24,19 +24,16 @@ function continueTest1(){
   var s = document.querySelector("select");
   setTimeout(function(){ s.style.display = 'none';   }, 2);
   setTimeout(function(){ s.style.display = 'inline'; document.body.offsetHeight; }, 4);
   setTimeout(function(){ document.documentElement.removeAttribute("class"); }, 100);
 }
 function runTests(){
   var s = document.querySelector("select");
   s.focus();
-  setTimeout(function(){ s.style.display = 'none';   }, 2);
-  setTimeout(function(){ s.style.display = 'inline'; }, 4);
-  setTimeout(function(){ document.body.offsetHeight; document.documentElement.removeAttribute("class"); }, 0);
 }
 
 window.focus();
 window.addEventListener("MozReftestInvalidate", runTests, false);
 
 </script>
 
 </body>