Bug 1553290 - Get support menu href direct from policy. r=jaws

Differential Revision: https://phabricator.services.mozilla.com/D32367

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Michael Kaply 2019-06-03 21:30:57 +00:00
parent 0533c377b1
commit ee4ae8a0b1
3 changed files with 3 additions and 4 deletions

View File

@ -614,7 +614,7 @@
hidden="true"/>
<menuitem id="helpPolicySupport"
hidden="true"
oncommand="openUILink(this.getAttribute('href'), event, {triggeringPrincipal: Services.scriptSecurityManager.createNullPrincipal({})});"
oncommand="openUILinkIn(Services.policies.getSupportMenu().URL.href, 'tab', {triggeringPrincipal: Services.scriptSecurityManager.createNullPrincipal({})});"
onclick="checkForMiddleClick(this, event);"/>
<menuseparator id="aboutSeparator"/>
<menuitem id="aboutName"

View File

@ -926,7 +926,6 @@ function buildHelpMenu() {
let menuitem = document.getElementById("helpPolicySupport");
menuitem.hidden = false;
menuitem.setAttribute("label", supportMenu.Title);
menuitem.setAttribute("href", supportMenu.URL);
if ("AccessKey" in supportMenu) {
menuitem.setAttribute("accesskey", supportMenu.AccessKey);
}

View File

@ -15,14 +15,14 @@ add_task(async function setup() {
});
add_task(async function test_help_menu() {
is(Services.policies.getSupportMenu().URL.href, "https://example.com/",
"The policy should have the correct URL.");
buildHelpMenu();
let supportMenu = document.getElementById("helpPolicySupport");
is(supportMenu.hidden, false,
"The policy menu should be visible.");
is(supportMenu.getAttribute("label"), "Title",
"The policy menu should have the correct title.");
is(supportMenu.getAttribute("href"), "https://example.com/",
"The policy menu should have the correct URL.");
is(supportMenu.getAttribute("accesskey"), "T",
"The policy menu should have the correct access key.");
});