Bug 506850 - mochitest-chrome: test_action_keys_respect_focus.xul and test_clear_button_disabled.xul (intermittently) report "Test timed out"; (Dv1) Backout patch Bv1 setOrRestoreTabFocus() which did not help; (r=neil)
authorSerge Gautherie <sgautherie.bz@free.fr>
Fri, 14 Aug 2009 12:31:45 +0200
changeset 3305 96b75d300c0194faae72cb80813b6618be67fca6
parent 3304 a1a91c08211133147553090ba95db3b9e914e3a4
child 3306 ccf2369fb4c76bb982701770ff1d0bb21905c2a4
push idunknown
push userunknown
push dateunknown
reviewersneil
bugs506850
Bug 506850 - mochitest-chrome: test_action_keys_respect_focus.xul and test_clear_button_disabled.xul (intermittently) report "Test timed out"; (Dv1) Backout patch Bv1 setOrRestoreTabFocus() which did not help; (r=neil)
suite/common/downloads/tests/chrome/test_action_keys_respect_focus.xul
--- a/suite/common/downloads/tests/chrome/test_action_keys_respect_focus.xul
+++ b/suite/common/downloads/tests/chrome/test_action_keys_respect_focus.xul
@@ -53,33 +53,16 @@
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"/>
 
   <script type="application/javascript">
   <![CDATA[
 
-// accessibility.tabfocus must be set to value 7 before running test also
-// on a mac.
-function setOrRestoreTabFocus(newValue) {
-  const prefSvcContractID = "@mozilla.org/preferences-service;1";
-  const prefSvcIID = Components.interfaces.nsIPrefService;
-  var prefs = Components.classes[prefSvcContractID].getService(prefSvcIID)
-                                                   .getBranch("accessibility.");
-  if (!newValue) {
-    try {
-      prefs.clearUserPref("tabfocus");
-    } catch(ex) {}
-  } else {
-    prefs.setIntPref("tabfocus", newValue);
-  }
-}
-
-
 var openInvokeCount = 0;
 var removeInvokeCount = 0;
 var resumeInvokeCount = 0;
 var testedFunctions = {
   openDownload : null,
   removeDownload : null,
   resumeDownload : null
 };
@@ -182,18 +165,16 @@ dlObs.prototype = {
   },
   onStateChange: function(a, b, c, d, e) { },
   onProgressChange: function(a, b, c, d, e, f, g) { },
   onSecurityChange: function(a, b, c, d) { }
 };
 
 function test()
 {
-  setOrRestoreTabFocus(7);
-
   var dm = Components.classes["@mozilla.org/download-manager;1"]
                      .getService(Components.interfaces.nsIDownloadManager);
 
   function addDownload()
   {
     function createURI(aObj)
     {
       var ios = Components.classes["@mozilla.org/network/io-service;1"]
@@ -371,17 +352,16 @@ function test()
             is(openInvokeCount, 1, "Clear List: doCommand() didn't open download (MacOSX)");
           else
             is(openInvokeCount, 1, "Clear List: Enter didn't open download (Linux, Windows)");
           restoreTestedFunction("openDownload", win);
 
           // We're done here
           obs.removeObserver(testObs, DLMGR_UI_DONE);
           win.close();
-          setOrRestoreTabFocus(0);
           SimpleTest.finish();
 
           break;
       }
     }
   };
   obs.addObserver(testObs, DLMGR_UI_DONE, false);