Bug 1527922 - Remove DevTools button in browser_toolbarKeyNav.js to prevent branch-specific focus in toolbar r=Gijs
authorSebastian Hengst <archaeopteryx@coole-files.de>
Mon, 11 Mar 2019 13:01:06 +0000
changeset 521343 f21b07ac7fb7600419842f42992e119a57956e8d
parent 521342 016f24de0fa3b206905f1d0c5365e44d66bc2da4
child 521344 edff1f39d426d7896dd9f48b06ada1e28fe820bb
push id10866
push usernerli@mozilla.com
push dateTue, 12 Mar 2019 18:59:09 +0000
treeherdermozilla-beta@445c24a51727 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersGijs
bugs1527922
milestone67.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 1527922 - Remove DevTools button in browser_toolbarKeyNav.js to prevent branch-specific focus in toolbar r=Gijs Differential Revision: https://phabricator.services.mozilla.com/D22876
browser/base/content/test/keyboard/browser_toolbarKeyNav.js
--- a/browser/base/content/test/keyboard/browser_toolbarKeyNav.js
+++ b/browser/base/content/test/keyboard/browser_toolbarKeyNav.js
@@ -6,16 +6,20 @@
 /**
  * Test browser toolbar keyboard navigation.
  * These tests assume the default browser configuration for toolbars unless
  * otherwise specified.
  */
 
 const PERMISSIONS_PAGE = "https://example.com/browser/browser/base/content/test/permissions/permissions.html";
 
+// The DevEdition has the DevTools button in the toolbar by default. Remove it
+// to prevent branch-specific rules what button should be focused.
+CustomizableUI.removeWidgetFromArea("developer-button");
+
 async function expectFocusAfterKey(aKey, aFocus, aAncestorOk = false) {
   let res = aKey.match(/^(Shift\+)?(?:(.)|(.+))$/);
   let shift = Boolean(res[1]);
   let key;
   if (res[2]) {
     key = res[2]; // Character.
   } else {
     key = "KEY_" + res[3]; // Tab, ArrowRight, etc.
@@ -225,8 +229,12 @@ add_task(async function testArrowsOverfl
     // Make sure the button is not reachable once it is invisible again.
     await expectFocusAfterKey("ArrowRight", "PanelUI-menu-button");
     CustomizableUI.reset();
     // Flush layout so its invisibility can be detected.
     document.getElementById("nav-bar-overflow-button").clientWidth;
     await expectFocusAfterKey("ArrowLeft", "sidebar-button");
   });
 });
+
+registerCleanupFunction(async function resetToolbar() {
+  await CustomizableUI.reset();
+});