Bug 786418 - browser_newtab_focus.js shouldn't fail when FKA is enabled on Mac, r=enn, a=test-only
authorAndres Hernandez <andres@appcoast.com>
Wed, 05 Sep 2012 13:43:41 -0600
changeset 106789 9cfb3a0c64d55058c1a1d60920400ae7d9752dbd
parent 106788 a95efad780a886728ffb7c2b47aacfad305eff57
child 106790 440aa0d7c3d3aee8464052149bd753d425439d7e
push id2053
push userphilringnalda@gmail.com
push dateSun, 09 Sep 2012 00:45:39 +0000
treeherdermozilla-aurora@9cfb3a0c64d5 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersenn, test-only
bugs786418
milestone17.0a2
Bug 786418 - browser_newtab_focus.js shouldn't fail when FKA is enabled on Mac, r=enn, a=test-only
browser/base/content/test/newtab/browser_newtab_focus.js
--- a/browser/base/content/test/newtab/browser_newtab_focus.js
+++ b/browser/base/content/test/newtab/browser_newtab_focus.js
@@ -1,37 +1,38 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 /*
  * These tests make sure that focusing the 'New Tage Page' works as expected.
  */
 function runTests() {
+  // Handle the OSX full keyboard access setting
+  Services.prefs.setIntPref("accessibility.tabfocus", 7);
+
   // Focus count in new tab page.
   // 28 = 9 * 3 + 1 = 9 sites and 1 toggle button, each site has a link, a pin
   // and a remove button.
-  let FOCUS_COUNT = 28; 
-  if ("nsILocalFileMac" in Ci) {
-    // 19 = Mac doesn't focus links, so 9 focus targets less than Windows/Linux.
-    FOCUS_COUNT = 19;
-  }
+  let FOCUS_COUNT = 28;
 
   // Create a new tab page.
   yield setLinks("0,1,2,3,4,5,6,7,8");
   setPinnedLinks("");
 
   yield addNewTabPageTab();
   gURLBar.focus();
 
   // Count the focus with the enabled page.
   yield countFocus(FOCUS_COUNT);
 
   // Disable page and count the focus with the disabled page.
   NewTabUtils.allPages.enabled = false;
   yield countFocus(1);
+
+  Services.prefs.clearUserPref("accessibility.tabfocus");
 }
 
 /**
  * Focus the urlbar and count how many focus stops to return again to the urlbar.
  */
 function countFocus(aExpectedCount) {
   let focusCount = 0;
   let contentDoc = getContentDocument();