Bug 1241634 - Reflow before clicking in mixedcontentblocker test r?kmckinley draft
authorJonathan Hao <jhao@mozilla.com>
Fri, 25 Mar 2016 16:52:49 +0800
changeset 347890 679879a11bb978ef90674e2bb17a139b10527e8d
parent 346302 bccb11375f2af838cda714d42fd8cef78f5c7bf1
child 517737 2281db27a4b866d169e1a5e0684af416d51cd915
push id14699
push userjhao@mozilla.com
push dateWed, 06 Apr 2016 04:28:03 +0000
reviewerskmckinley
bugs1241634
milestone48.0a1
Bug 1241634 - Reflow before clicking in mixedcontentblocker test r?kmckinley MozReview-Commit-ID: 5rbeuVjaw0B
dom/security/test/mixedcontentblocker/file_frameNavigation_grandchild.html
dom/security/test/mixedcontentblocker/file_frameNavigation_innermost.html
dom/security/test/mixedcontentblocker/mochitest.ini
--- a/dom/security/test/mixedcontentblocker/file_frameNavigation_grandchild.html
+++ b/dom/security/test/mixedcontentblocker/file_frameNavigation_grandchild.html
@@ -8,17 +8,17 @@ https://bugzilla.mozilla.org/show_bug.cg
   <meta charset="utf-8">
   <title>Tests for Mixed Content Frame Navigation</title>
 </head>
 <body>
 <iframe src="https://example.com/tests/dom/security/test/mixedcontentblocker/file_frameNavigation_innermost.html?insecurePage_navigate_grandchild" id="child"></iframe>
 
 <script>
   // For tests that require setTimeout, set the maximum polling time to 100 x 100ms = 10 seconds.
-  var MAX_COUNT = 100;
+  var MAX_COUNT = 50;
   var TIMEOUT_INTERVAL = 100;
   var counter = 0;
 
   var child = document.getElementById("child");
   function navigationStatus(child)
   {
     // When the page is navigating, it goes through about:blank and we will get a permission denied for loc.
     // Catch that specific exception and return
--- a/dom/security/test/mixedcontentblocker/file_frameNavigation_innermost.html
+++ b/dom/security/test/mixedcontentblocker/file_frameNavigation_innermost.html
@@ -16,17 +16,22 @@
     case "insecurePage_navigate_child_response":
       parent.parent.postMessage({"test": "insecurePage_navigate_child", "msg": "navigated to insecure iframe on insecure page"}, "http://mochi.test:8888");
       document.getElementById("content").innerHTML = "Navigated from secure to insecure frame on an insecure page";
       break;
 
     case "insecurePage_navigate_grandchild":
       document.getElementById("content").innerHTML =
         '<a href="http://example.com/tests/dom/security/test/mixedcontentblocker/file_frameNavigation_innermost.html?insecurePage_navigate_grandchild_response" id="link">Testing\<\/a>';
-      document.getElementById("link").click();
+      // If we don't reflow before clicking the link, the test will fail intermittently. The reason is still unknown. We'll track this issue in bug 1259715.
+      requestAnimationFrame(function() {
+        setTimeout(function() {
+          document.getElementById("link").click();
+        }, 0);
+      });
       break;
 
     case "insecurePage_navigate_grandchild_response":
       parent.parent.parent.postMessage({"test": "insecurePage_navigate_grandchild", "msg": "navigated to insecure grandchild iframe on insecure page"}, "http://mochi.test:8888");
       document.getElementById("content").innerHTML = "Navigated from secure to insecure grandchild frame on an insecure page";
       break;
 
     case "securePage_navigate_child":
--- a/dom/security/test/mixedcontentblocker/mochitest.ini
+++ b/dom/security/test/mixedcontentblocker/mochitest.ini
@@ -13,9 +13,9 @@ support-files =
   file_main_bug803225_websocket_wsh.py
   file_server.sjs
 
 [test_main.html]
 skip-if = buildapp == 'mulet' || buildapp == 'b2g' || toolkit == 'android' #TIMED_OUT, SSL_REQUIRED # Bug 1141029 Mulet parity with B2G Desktop for TC
 [test_bug803225.html]
 skip-if = buildapp == 'mulet' || buildapp == 'b2g' || toolkit == 'android' #TIMED_OUT, SSL_REQUIRED # Bug 1141029 Mulet parity with B2G Desktop for TC
 [test_frameNavigation.html]
-skip-if = buildapp == 'b2g' || toolkit == 'android' || (os == 'mac' || os == 'win') #TIMED_OUT, SSL_REQUIRED, OSX/Win: Bug 1241634
+skip-if = buildapp == 'b2g' || toolkit == 'android' #TIMED_OUT, SSL_REQUIRED