Bug 930374 part.4 Fix new orange of test_bug448987.html on Mac since it doesn't set tab navigation setting r=smaug
authorMasayuki Nakano <masayuki@d-toybox.com>
Mon, 09 Dec 2013 00:51:17 +0900
changeset 159396 2aaff66026baa23aed88b43b3f4593a7cc63dbe0
parent 159395 97bf81b22f1f9006195d08ef9ae930231cd6154f
child 159397 b453362886a9542188cfc986af40444d00303a3d
push id37292
push usermasayuki@d-toybox.com
push dateSun, 08 Dec 2013 15:51:23 +0000
treeherdermozilla-inbound@2aaff66026ba [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug
bugs930374, 448987
milestone28.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 930374 part.4 Fix new orange of test_bug448987.html on Mac since it doesn't set tab navigation setting r=smaug
layout/generic/test/file_bug448987.html
layout/generic/test/file_bug448987_ref.html
layout/generic/test/test_bug448987.html
--- a/layout/generic/test/file_bug448987.html
+++ b/layout/generic/test/file_bug448987.html
@@ -27,18 +27,19 @@ function focus_area() {
       clearInterval(timer);
       parent.SimpleTest.executeSoon(parent.firstIframeLoaded, 0);
     }
 
     //XXX This code tries to shift focus to the image map for some reason. This is not 
     // working directly after page load, hence it is retried 10 times, see bug bug 922524
     timer = setInterval(function() {
       if (counter > 10) {
+        clearInterval(timer);
         parent.ok(false, "Too often tried to focus image map, giving up");
-        parent.Simpletest.finish();
+        parent.finish();
         return;
       }
       synthesizeKey("VK_TAB", { shiftKey: shiftKeyOn }, window); 
       shiftKeyOn = !shiftKeyOn;
       counter++;
     }, 100);
   };
   document.getElementById("pre").focus();
--- a/layout/generic/test/file_bug448987_ref.html
+++ b/layout/generic/test/file_bug448987_ref.html
@@ -27,18 +27,19 @@ function focus_area() {
       clearInterval(timer);
       parent.SimpleTest.executeSoon(parent.secondIframeLoaded, 0);
     }
 
     //XXX This code tries to shift focus to the image map for some reason. This is not 
     // working directly after page load, hence it is retried 10 times, see bug bug 922524
     timer = setInterval(function() {
       if (counter > 10) {
+        clearInterval(timer);
         parent.ok(false, "Too often tried to focus image map, giving up");
-        parent.Simpletest.finish();
+        parent.finish();
         return;
       }
       synthesizeKey("VK_TAB", { shiftKey: shiftKeyOn }, window); 
       shiftKeyOn = !shiftKeyOn;
       counter++;
     }, 100);
   };
   document.getElementById("pre").focus();
--- a/layout/generic/test/test_bug448987.html
+++ b/layout/generic/test/test_bug448987.html
@@ -25,16 +25,18 @@ https://bugzilla.mozilla.org/show_bug.cg
 <iframe id="f3"></iframe>
 </div>
 <pre id="test">
 <script type="application/javascript">
 
 /** Test for Bug 448987 **/
 SimpleTest.waitForExplicitFinish();
 
+SpecialPowers.setIntPref("accessibility.tabfocus", 7);
+
 var f1 = document.getElementById("f1");
 var f2 = document.getElementById("f2");
 var f3 = document.getElementById("f3");
 
 var snapshotf1;
 
 SimpleTest.waitForFocus(function() {
   f1.src = "file_bug448987.html";
@@ -51,14 +53,20 @@ function secondIframeLoaded() {
      "<area shape=default> should render focus outline");
   f3.src="file_bug448987_notref.html";
 }
 
 function thirdIframeLoaded() {
   ok(compareSnapshots(snapshotf1,
                       snapshotWindow(f3.contentWindow), false)[0],
      "file_bug448987.html should render focus outline, file_bug448987_notref.html should not");
+  finish();
+}
+
+function finish()
+{
+  SpecialPowers.clearUserPref("accessibility.tabfocus");
   SimpleTest.finish();
 }
 </script>
 </pre>
 </body>
 </html>