зеркало из https://github.com/mozilla/gecko-dev.git
Bug 736882 - Request/response details should indicate whether SPDY was used. r=Honza
MozReview-Commit-ID: HjzDT76m6Ix --HG-- extra : rebase_source : a10ff2f87a2dd5fc49571d31154e5a26a26d2e2d
This commit is contained in:
Родитель
2e9549a22a
Коммит
5b0d0871ba
|
@ -9,6 +9,7 @@ const {
|
|||
DOM,
|
||||
PropTypes,
|
||||
} = require("devtools/client/shared/vendor/react");
|
||||
const { getFormattedProtocol } = require("../utils/request-utils");
|
||||
|
||||
const { div } = DOM;
|
||||
|
||||
|
@ -20,17 +21,19 @@ const RequestListColumnProtocol = createClass({
|
|||
},
|
||||
|
||||
shouldComponentUpdate(nextProps) {
|
||||
return this.props.item.httpVersion !== nextProps.item.httpVersion;
|
||||
return getFormattedProtocol(this.props.item) !==
|
||||
getFormattedProtocol(nextProps.item);
|
||||
},
|
||||
|
||||
render() {
|
||||
let { httpVersion = "" } = this.props.item;
|
||||
let protocol = getFormattedProtocol(this.props.item);
|
||||
|
||||
return (
|
||||
div({
|
||||
className: "requests-list-column requests-list-protocol",
|
||||
title: httpVersion,
|
||||
title: protocol,
|
||||
},
|
||||
httpVersion
|
||||
protocol
|
||||
)
|
||||
);
|
||||
}
|
||||
|
|
|
@ -340,6 +340,22 @@ function getResponseTime(item, firstRequestStartedMillis = 0) {
|
|||
eventTimings.timings.receive;
|
||||
}
|
||||
|
||||
/**
|
||||
* Format the protocols used by the request.
|
||||
*/
|
||||
function getFormattedProtocol(item) {
|
||||
let { httpVersion = "", responseHeaders = { headers: [] } } = item;
|
||||
let protocol = [httpVersion];
|
||||
responseHeaders.headers.some(h => {
|
||||
if (h.hasOwnProperty("name") && h.name.toLowerCase() === "x-firefox-spdy") {
|
||||
protocol.push(h.value);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
});
|
||||
return protocol.join("+");
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
getFormDataSections,
|
||||
fetchHeaders,
|
||||
|
@ -348,6 +364,7 @@ module.exports = {
|
|||
decodeUnicodeUrl,
|
||||
getAbbreviatedMimeType,
|
||||
getEndTime,
|
||||
getFormattedProtocol,
|
||||
getResponseTime,
|
||||
getStartTime,
|
||||
getUrlBaseName,
|
||||
|
|
|
@ -20,6 +20,7 @@ const {
|
|||
} = require("devtools/client/netmonitor/src/utils/format-utils");
|
||||
const {
|
||||
decodeUnicodeUrl,
|
||||
getFormattedProtocol,
|
||||
getUrlBaseName,
|
||||
getUrlHost,
|
||||
getUrlQuery,
|
||||
|
@ -386,7 +387,6 @@ function verifyRequestItemTarget(document, requestList, requestItem, method,
|
|||
let host = getUrlHost(url);
|
||||
let scheme = getUrlScheme(url);
|
||||
let {
|
||||
httpVersion = "",
|
||||
remoteAddress,
|
||||
remotePort,
|
||||
totalTime,
|
||||
|
@ -396,6 +396,7 @@ function verifyRequestItemTarget(document, requestList, requestItem, method,
|
|||
let remoteIP = remoteAddress ? `${formattedIPPort}` : "unknown";
|
||||
let duration = getFormattedTime(totalTime);
|
||||
let latency = getFormattedTime(eventTimings.timings.wait);
|
||||
let protocol = getFormattedProtocol(requestItem);
|
||||
|
||||
if (fuzzyUrl) {
|
||||
ok(requestItem.method.startsWith(method), "The attached method is correct.");
|
||||
|
@ -423,10 +424,10 @@ function verifyRequestItemTarget(document, requestList, requestItem, method,
|
|||
}
|
||||
|
||||
is(target.querySelector(".requests-list-protocol").textContent,
|
||||
httpVersion, "The displayed protocol is correct.");
|
||||
protocol, "The displayed protocol is correct.");
|
||||
|
||||
is(target.querySelector(".requests-list-protocol").getAttribute("title"),
|
||||
httpVersion, "The tooltip protocol is correct.");
|
||||
protocol, "The tooltip protocol is correct.");
|
||||
|
||||
is(target.querySelector(".requests-list-domain").textContent,
|
||||
host, "The displayed domain is correct.");
|
||||
|
|
Загрузка…
Ссылка в новой задаче