Bug 1150697 - Add IP address to the Network Monitor domain tooltip. r=bgrins

This commit is contained in:
Jan Keromnes 2015-04-20 11:10:05 -07:00
parent 13ab5ef6a7
commit d76f51c873
2 changed files with 10 additions and 1 deletions

View File

@ -1230,6 +1230,7 @@ RequestsMenuView.prototype = Heritage.extend(WidgetMethods, {
break;
case "remoteAddress":
requestItem.attachment.remoteAddress = value;
this.updateMenuView(requestItem, key, value);
break;
case "remotePort":
requestItem.attachment.remotePort = value;
@ -1382,6 +1383,11 @@ RequestsMenuView.prototype = Heritage.extend(WidgetMethods, {
domain.setAttribute("tooltiptext", hostPort);
break;
}
case "remoteAddress":
let domain = $(".requests-menu-domain", target);
let tooltip = domain.getAttribute("value") + " (" + aValue + ")";
domain.setAttribute("tooltiptext", tooltip);
break;
case "securityState": {
let tooltip = L10N.getStr("netmonitor.security.state." + aValue);
let icon = $(".requests-security-state-icon", target);

View File

@ -275,6 +275,7 @@ function verifyRequestItemTarget(aRequestItem, aMethod, aUrl, aData = {}) {
let name = uri.fileName || "/";
let query = uri.query;
let hostPort = uri.hostPort;
let remoteAddress = attachment.remoteAddress;
if (fuzzyUrl) {
ok(attachment.method.startsWith(aMethod), "The attached method is incorrect.");
@ -301,8 +302,10 @@ function verifyRequestItemTarget(aRequestItem, aMethod, aUrl, aData = {}) {
is(target.querySelector(".requests-menu-domain").getAttribute("value"),
hostPort, "The displayed domain is incorrect.");
let domainTooltip = hostPort + (remoteAddress ? " (" + remoteAddress + ")" : "");
is(target.querySelector(".requests-menu-domain").getAttribute("tooltiptext"),
hostPort, "The tooltip domain is incorrect.");
domainTooltip, "The tooltip domain is incorrect.");
if (status !== undefined) {
let value = target.querySelector(".requests-menu-status").getAttribute("code");