зеркало из https://github.com/mozilla/gecko-dev.git
Backout 83038b3ca98d (Bug 792503) due to orange on osx
This commit is contained in:
Родитель
5faa7c6726
Коммит
da8797210d
|
@ -482,9 +482,7 @@
|
|||
accesskey="&toolsMenu.accesskey;">
|
||||
<menupopup id="menu_ToolsPopup"
|
||||
#ifdef MOZ_SERVICES_SYNC
|
||||
onpopupshowing="gSyncUI.updateUI(); SocialMenu.populate();"
|
||||
#else
|
||||
onpopupshowing="SocialMenu.populate();"
|
||||
onpopupshowing="gSyncUI.updateUI();"
|
||||
#endif
|
||||
>
|
||||
<menuitem id="menu_search"
|
||||
|
@ -509,11 +507,6 @@
|
|||
type="checkbox"
|
||||
autocheck="false"
|
||||
command="Social:Toggle"/>
|
||||
<menu id="menu_socialAmbientMenu"
|
||||
class="show-only-for-keyboard"
|
||||
command="Social:Toggle">
|
||||
<menupopup id="menu_socialAmbientMenuPopup"/>
|
||||
</menu>
|
||||
#ifdef MOZ_SERVICES_SYNC
|
||||
<!-- only one of sync-setup or sync-menu will be showing at once -->
|
||||
<menuitem id="sync-setup"
|
||||
|
|
|
@ -62,7 +62,6 @@ let SocialUI = {
|
|||
break;
|
||||
case "social:ambient-notification-changed":
|
||||
SocialToolbar.updateButton();
|
||||
SocialMenu.updateMenu();
|
||||
break;
|
||||
case "social:profile-changed":
|
||||
SocialToolbar.updateProfile();
|
||||
|
@ -108,7 +107,7 @@ let SocialUI = {
|
|||
// FIXME: bug 772808: menu items don't inherit the "hidden" state properly,
|
||||
// need to update them manually.
|
||||
// This should just be: toggleCommand.hidden = !Social.active;
|
||||
for (let id of ["appmenu_socialToggle", "menu_socialToggle", "menu_socialAmbientMenu"]) {
|
||||
for (let id of ["appmenu_socialToggle", "menu_socialToggle"]) {
|
||||
let el = document.getElementById(id);
|
||||
if (!el)
|
||||
continue;
|
||||
|
@ -585,31 +584,6 @@ let SocialShareButton = {
|
|||
}
|
||||
};
|
||||
|
||||
var SocialMenu = {
|
||||
populate: function SocialMenu_populate() {
|
||||
// This menu is only accessible through keyboard navigation.
|
||||
let submenu = document.getElementById("menu_socialAmbientMenuPopup");
|
||||
while(submenu.hasChildNodes())
|
||||
submenu.removeChild(submenu.firstChild);
|
||||
let provider = Social.provider;
|
||||
if (Social.active && provider) {
|
||||
let iconNames = Object.keys(provider.ambientNotificationIcons);
|
||||
for each(let name in iconNames) {
|
||||
let icon = provider.ambientNotificationIcons[name];
|
||||
if (!icon.label || !icon.menuURL)
|
||||
continue;
|
||||
let menuitem = document.createElement("menuitem");
|
||||
menuitem.setAttribute("label", icon.label);
|
||||
menuitem.addEventListener("command", function() {
|
||||
openUILinkIn(icon.menuURL, "tab");
|
||||
}, false);
|
||||
submenu.appendChild(menuitem);
|
||||
}
|
||||
}
|
||||
document.getElementById("menu_socialAmbientMenu").hidden = !submenu.querySelector("menuitem");
|
||||
}
|
||||
};
|
||||
|
||||
var SocialToolbar = {
|
||||
// Called once, after window load, when the Social.provider object is initialized
|
||||
init: function SocialToolbar_init() {
|
||||
|
@ -743,9 +717,6 @@ var SocialToolbar = {
|
|||
let box = document.createElement("box");
|
||||
box.classList.add("toolbarbutton-1");
|
||||
box.setAttribute("id", iconId);
|
||||
// Use the accessibility menuitem label as tooltiptext.
|
||||
if (icon.label)
|
||||
box.setAttribute("tooltiptext", icon.label);
|
||||
box.addEventListener("mousedown", function (e) {
|
||||
if (e.button == 0)
|
||||
SocialToolbar.showAmbientPopup(box);
|
||||
|
|
|
@ -33,27 +33,12 @@ var tests = {
|
|||
is(userButton.value, profile.userName, "username is set");
|
||||
next();
|
||||
},
|
||||
testNoAmbientNotificationsIsNoKeyboardMenu: function(next) {
|
||||
// Test that keyboard accessible menuitem doesn't exist when no ambient icons specified.
|
||||
let toolsPopup = document.getElementById("menu_ToolsPopup");
|
||||
toolsPopup.addEventListener("popupshown", function ontoolspopupshownNoAmbient() {
|
||||
toolsPopup.removeEventListener("popupshown", ontoolspopupshownNoAmbient);
|
||||
let socialToggleMore = document.getElementById("menu_socialAmbientMenu");
|
||||
ok(socialToggleMore, "Keyboard accessible social menu should exist");
|
||||
is(socialToggleMore.hidden, true, "Menu should be hidden when no ambient notifications.");
|
||||
toolsPopup.hidePopup();
|
||||
next();
|
||||
}, false);
|
||||
document.getElementById("menu_ToolsPopup").openPopup();
|
||||
},
|
||||
testAmbientNotifications: function(next) {
|
||||
let ambience = {
|
||||
name: "testIcon",
|
||||
iconURL: "https://example.com/browser/browser/base/content/test/moz.png",
|
||||
contentPanel: "about:blank",
|
||||
counter: 42,
|
||||
label: "Test Ambient 1",
|
||||
menuURL: "https://example.com/testAmbient1"
|
||||
counter: 42
|
||||
};
|
||||
Social.provider.setAmbientNotification(ambience);
|
||||
|
||||
|
@ -68,20 +53,7 @@ var tests = {
|
|||
ambience.counter = 0;
|
||||
Social.provider.setAmbientNotification(ambience);
|
||||
is(statusIconLabel.value, "", "status value is correct");
|
||||
|
||||
// Test that keyboard accessible menuitem was added.
|
||||
let toolsPopup = document.getElementById("menu_ToolsPopup");
|
||||
toolsPopup.addEventListener("popupshown", function ontoolspopupshownAmbient() {
|
||||
toolsPopup.removeEventListener("popupshown", ontoolspopupshownAmbient);
|
||||
let socialToggleMore = document.getElementById("menu_socialAmbientMenu");
|
||||
ok(socialToggleMore, "Keyboard accessible social menu should exist");
|
||||
is(socialToggleMore.hidden, false, "Menu is visible when ambient notifications have label & menuURL");
|
||||
let menuitem = socialToggleMore.querySelector("menuitem");
|
||||
is(menuitem.getAttribute("label"), "Test Ambient 1", "Keyboard accessible ambient menuitem should have specified label");
|
||||
toolsPopup.hidePopup();
|
||||
next();
|
||||
}, false);
|
||||
document.getElementById("menu_ToolsPopup").openPopup();
|
||||
next();
|
||||
}, "statusIcon was never found");
|
||||
},
|
||||
testProfileUnset: function(next) {
|
||||
|
|
|
@ -132,7 +132,6 @@ function runSocialTestWithProvider(manifest, callback) {
|
|||
|
||||
// Now that we've set the UI's provider, enable the social functionality
|
||||
Services.prefs.setBoolPref("social.enabled", true);
|
||||
Services.prefs.setBoolPref("social.active", true);
|
||||
|
||||
// Need to re-call providerReady since it is actually called before the test
|
||||
// framework is loaded and the provider state won't be set in the browser yet.
|
||||
|
@ -150,7 +149,6 @@ function runSocialTestWithProvider(manifest, callback) {
|
|||
}
|
||||
Social.provider = oldProvider;
|
||||
Services.prefs.clearUserPref("social.enabled");
|
||||
Services.prefs.clearUserPref("social.active");
|
||||
});
|
||||
|
||||
function finishSocialTest() {
|
||||
|
|
Загрузка…
Ссылка в новой задаче