Bug 1458046 - avoid remote updates when the browser is not active and fix editcontrols_update test, r=NeilDeakin
authorGijs Kruitbosch <gijskruitbosch@gmail.com>
Wed, 16 Jan 2019 16:20:43 +0000
changeset 511211 a643bdc1b7a48ab27192c0fb6b5411319c9b2eaf
parent 511210 af8ebdf790ba6b0fc721eed61c90e43bf7898e2d
child 511212 cbfa31396fa4b47a6162423664995167bab86c4d
push id10547
push userffxbld-merge
push dateMon, 21 Jan 2019 13:03:58 +0000
treeherdermozilla-beta@24ec1916bffe [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersNeilDeakin
bugs1458046
milestone66.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 1458046 - avoid remote updates when the browser is not active and fix editcontrols_update test, r=NeilDeakin Differential Revision: https://phabricator.services.mozilla.com/D16626
browser/components/customizableui/test/browser.ini
browser/components/customizableui/test/browser_editcontrols_update.js
toolkit/modules/RemoteController.js
--- a/browser/components/customizableui/test/browser.ini
+++ b/browser/components/customizableui/test/browser.ini
@@ -164,17 +164,16 @@ tags = fullscreen
 [browser_panelUINotifications_multiWindow.js]
 [browser_remove_customized_specials.js]
 [browser_switch_to_customize_mode.js]
 [browser_synced_tabs_menu.js]
 [browser_backfwd_enabled_post_customize.js]
 [browser_check_tooltips_in_navbar.js]
 [browser_editcontrols_update.js]
 subsuite = clipboard
-skip-if = (verify && !debug && os == 'mac') || (os == 'mac') # Bug 1458046
 [browser_customization_context_menus.js]
 [browser_newtab_button_customizemode.js]
 [browser_open_from_popup.js]
 [browser_PanelMultiView_focus.js]
 [browser_sidebar_toggle.js]
 skip-if = verify
 [browser_tabbar_big_widgets.js]
 [browser_remote_tabs_button.js]
--- a/browser/components/customizableui/test/browser_editcontrols_update.js
+++ b/browser/components/customizableui/test/browser_editcontrols_update.js
@@ -54,16 +54,17 @@ add_task(async function test_init() {
   // Open and close the panel first so that it is fully initialized.
   await gCUITestUtils.openMainMenu();
   await gCUITestUtils.hideMainMenu();
 });
 
 // Test updating when the panel is open with the edit-controls on the panel.
 // Updates should occur.
 add_task(async function test_panelui_opened() {
+  document.commandDispatcher.unlock();
   gURLBar.focus();
   gURLBar.value = "test";
 
   await gCUITestUtils.openMainMenu();
 
   checkState(false, "Update when edit-controls is on panel and visible");
 
   let overridePromise = expectCommandUpdate(1);
--- a/toolkit/modules/RemoteController.js
+++ b/toolkit/modules/RemoteController.js
@@ -78,11 +78,15 @@ RemoteController.prototype = {
     for (let c = 0; c < aEnabledLength; c++) {
       this._supportedCommands[aEnabledCommands[c]] = true;
     }
 
     for (let c = 0; c < aDisabledLength; c++) {
       this._supportedCommands[aDisabledCommands[c]] = false;
     }
 
+    // Don't update anything if we're not the active element
+    if (this._browser != this._browser.ownerDocument.activeElement) {
+      return;
+    }
     this._browser.ownerGlobal.updateCommands(aAction);
   },
 };