mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-21 01:05:45 +00:00
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:
parent
0533c377b1
commit
ee4ae8a0b1
@ -614,7 +614,7 @@
|
|||||||
hidden="true"/>
|
hidden="true"/>
|
||||||
<menuitem id="helpPolicySupport"
|
<menuitem id="helpPolicySupport"
|
||||||
hidden="true"
|
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);"/>
|
onclick="checkForMiddleClick(this, event);"/>
|
||||||
<menuseparator id="aboutSeparator"/>
|
<menuseparator id="aboutSeparator"/>
|
||||||
<menuitem id="aboutName"
|
<menuitem id="aboutName"
|
||||||
|
@ -926,7 +926,6 @@ function buildHelpMenu() {
|
|||||||
let menuitem = document.getElementById("helpPolicySupport");
|
let menuitem = document.getElementById("helpPolicySupport");
|
||||||
menuitem.hidden = false;
|
menuitem.hidden = false;
|
||||||
menuitem.setAttribute("label", supportMenu.Title);
|
menuitem.setAttribute("label", supportMenu.Title);
|
||||||
menuitem.setAttribute("href", supportMenu.URL);
|
|
||||||
if ("AccessKey" in supportMenu) {
|
if ("AccessKey" in supportMenu) {
|
||||||
menuitem.setAttribute("accesskey", supportMenu.AccessKey);
|
menuitem.setAttribute("accesskey", supportMenu.AccessKey);
|
||||||
}
|
}
|
||||||
|
@ -15,14 +15,14 @@ add_task(async function setup() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
add_task(async function test_help_menu() {
|
add_task(async function test_help_menu() {
|
||||||
|
is(Services.policies.getSupportMenu().URL.href, "https://example.com/",
|
||||||
|
"The policy should have the correct URL.");
|
||||||
buildHelpMenu();
|
buildHelpMenu();
|
||||||
let supportMenu = document.getElementById("helpPolicySupport");
|
let supportMenu = document.getElementById("helpPolicySupport");
|
||||||
is(supportMenu.hidden, false,
|
is(supportMenu.hidden, false,
|
||||||
"The policy menu should be visible.");
|
"The policy menu should be visible.");
|
||||||
is(supportMenu.getAttribute("label"), "Title",
|
is(supportMenu.getAttribute("label"), "Title",
|
||||||
"The policy menu should have the correct 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",
|
is(supportMenu.getAttribute("accesskey"), "T",
|
||||||
"The policy menu should have the correct access key.");
|
"The policy menu should have the correct access key.");
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user