зеркало из https://github.com/mozilla/gecko-dev.git
Backed out 2 changesets (bug 1403051) for causing devtools failures on browser_parsable_css.js CLOSED TREE
Backed out changeset d93010798ea5 (bug 1403051) Backed out changeset 0c049e82eb05 (bug 1403051)
This commit is contained in:
Родитель
42b53c41d1
Коммит
b61f7995be
|
@ -311,15 +311,6 @@ netmonitor.waterfall.tooltip.wait=Wait %S ms
|
|||
# displayed in the requests waterfall for receive time (in milliseiconds).
|
||||
netmonitor.waterfall.tooltip.receive=Receive %S ms
|
||||
|
||||
# LOCALIZATION NOTE (netmonitor.timings.requestTiming): This is the title of the existing
|
||||
# section in Timings side panel. This section contains request timings.
|
||||
netmonitor.timings.requestTiming=Request Timing
|
||||
|
||||
# LOCALIZATION NOTE (netmonitor.timings.serverTiming): This is the title of a new section
|
||||
# in Timings side panel. This section contains server timings transferred from the server
|
||||
# through the "Server-Timing" header.
|
||||
netmonitor.timings.serverTiming=Server Timing
|
||||
|
||||
# LOCALIZATION NOTE (networkMenu.millisecond): This is the label displayed
|
||||
# in the network menu specifying timing interval divisions (in milliseconds).
|
||||
networkMenu.millisecond=%S ms
|
||||
|
|
|
@ -207,6 +207,7 @@
|
|||
.network-monitor .tabpanel-summary-label {
|
||||
display: inline-block;
|
||||
padding-inline-end: 3px;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.network-monitor .tabpanel-summary-value {
|
||||
|
@ -436,28 +437,6 @@
|
|||
transition: width 0.2s ease-out;
|
||||
}
|
||||
|
||||
.network-monitor .label-separator {
|
||||
margin-inline-start: 4px;
|
||||
font-weight: 600;
|
||||
margin-top: 5px;
|
||||
margin-bottom: 5px;
|
||||
color: var(--theme-comment);
|
||||
}
|
||||
|
||||
.theme-light .network-monitor .requests-list-timings-box {
|
||||
--timing-server-color1: rgba(104, 195, 179, 0.8); /* teal */
|
||||
--timing-server-color2: rgba(123, 102, 167, 0.8); /* purple */
|
||||
--timing-server-color3: rgba(233, 236, 130, 0.8); /* yellow */
|
||||
--timing-server-color-total: rgba(186, 90, 140, 0.8); /* pink */
|
||||
}
|
||||
|
||||
.theme-dark .network-monitor .requests-list-timings-box {
|
||||
--timing-server-color1: rgba(74, 228, 201, 0.8); /* teal */
|
||||
--timing-server-color2: rgba(156, 119, 233, 0.8); /* purple */
|
||||
--timing-server-color3: rgba(234, 239, 73, 0.8); /* yellow */
|
||||
--timing-server-color-total: rgba(186, 74, 133, 0.8); /* pink */
|
||||
}
|
||||
|
||||
/* Stack trace panel */
|
||||
|
||||
.network-monitor .stack-trace {
|
||||
|
|
|
@ -10,7 +10,6 @@ const dom = require("devtools/client/shared/vendor/react-dom-factories");
|
|||
const { L10N } = require("../utils/l10n");
|
||||
const { getNetMonitorTimingsURL } = require("../utils/mdn-utils");
|
||||
const { fetchNetworkUpdatePacket } = require("../utils/request-utils");
|
||||
const { getFormattedTime } = require("../utils/format-utils");
|
||||
const { TIMING_KEYS } = require("../constants");
|
||||
|
||||
// Components
|
||||
|
@ -42,58 +41,6 @@ class TimingsPanel extends Component {
|
|||
fetchNetworkUpdatePacket(connector.requestData, request, ["eventTimings"]);
|
||||
}
|
||||
|
||||
renderServerTimings() {
|
||||
const { serverTimings, totalTime } = this.props.request.eventTimings;
|
||||
|
||||
if (!serverTimings.length) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return div(
|
||||
{},
|
||||
div(
|
||||
{ className: "label-separator" },
|
||||
L10N.getStr("netmonitor.timings.serverTiming")
|
||||
),
|
||||
...serverTimings.map(({ name, duration, description }, index) => {
|
||||
const color = name === "total" ? "-total" : (index % 3) + 1;
|
||||
|
||||
return div(
|
||||
{
|
||||
key: index,
|
||||
className: "tabpanel-summary-container timings-container server",
|
||||
},
|
||||
span(
|
||||
{ className: "tabpanel-summary-label timings-label" },
|
||||
description || name
|
||||
),
|
||||
div(
|
||||
{ className: "requests-list-timings-container" },
|
||||
span({
|
||||
className: "requests-list-timings-offset",
|
||||
style: {
|
||||
width: `calc(${(totalTime - duration) /
|
||||
totalTime} * (100% - ${TIMINGS_END_PADDING})`,
|
||||
},
|
||||
}),
|
||||
span({
|
||||
className: `requests-list-timings-box`,
|
||||
style: {
|
||||
width: `calc(${duration /
|
||||
totalTime} * (100% - ${TIMINGS_END_PADDING}))`,
|
||||
backgroundColor: `var(--timing-server-color${color})`,
|
||||
},
|
||||
}),
|
||||
span(
|
||||
{ className: "requests-list-timings-total" },
|
||||
getFormattedTime(duration)
|
||||
)
|
||||
)
|
||||
);
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
render() {
|
||||
const { eventTimings, totalTime } = this.props.request;
|
||||
|
||||
|
@ -121,7 +68,7 @@ class TimingsPanel extends Component {
|
|||
{
|
||||
key: type,
|
||||
id: `timings-summary-${type}`,
|
||||
className: "tabpanel-summary-container timings-container request",
|
||||
className: "tabpanel-summary-container timings-container",
|
||||
},
|
||||
span(
|
||||
{ className: "tabpanel-summary-label timings-label" },
|
||||
|
@ -143,7 +90,7 @@ class TimingsPanel extends Component {
|
|||
}),
|
||||
span(
|
||||
{ className: "requests-list-timings-total" },
|
||||
getFormattedTime(timings[type])
|
||||
L10N.getFormatStr("networkMenu.totalMS2", timings[type])
|
||||
)
|
||||
)
|
||||
);
|
||||
|
@ -151,12 +98,7 @@ class TimingsPanel extends Component {
|
|||
|
||||
return div(
|
||||
{ className: "panel-container" },
|
||||
div(
|
||||
{ className: "label-separator" },
|
||||
L10N.getStr("netmonitor.timings.requestTiming")
|
||||
),
|
||||
timelines,
|
||||
this.renderServerTimings(),
|
||||
MDNLink({
|
||||
url: getNetMonitorTimingsURL(),
|
||||
title: L10N.getStr("netmonitor.timings.learnMore"),
|
||||
|
|
|
@ -66,7 +66,6 @@ support-files =
|
|||
sjs_slow-script-server.sjs
|
||||
sjs_sorting-test-server.sjs
|
||||
sjs_status-codes-test-server.sjs
|
||||
sjs_timings-test-server.sjs
|
||||
sjs_truncate-test-server.sjs
|
||||
test-image.png
|
||||
service-workers/status-codes.html
|
||||
|
@ -208,7 +207,6 @@ skip-if = os == 'win' # bug 1391264
|
|||
[browser_net_security-warnings.js]
|
||||
[browser_net_send-beacon.js]
|
||||
[browser_net_send-beacon-other-tab.js]
|
||||
[browser_net_server_timings.js]
|
||||
[browser_net_set-cookie-same-site.js]
|
||||
[browser_net_simple-request-data.js]
|
||||
[browser_net_simple-request-details.js]
|
||||
|
|
|
@ -1,67 +0,0 @@
|
|||
/* Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
"use strict";
|
||||
|
||||
/**
|
||||
* Tests if server side timings are displayed
|
||||
*/
|
||||
add_task(async function() {
|
||||
const { tab, monitor } = await initNetMonitor(HTTPS_CUSTOM_GET_URL);
|
||||
|
||||
const { document, store, windowRequire } = monitor.panelWin;
|
||||
const Actions = windowRequire("devtools/client/netmonitor/src/actions/index");
|
||||
store.dispatch(Actions.batchEnable(false));
|
||||
|
||||
let wait = waitForNetworkEvents(monitor, 1);
|
||||
await ContentTask.spawn(
|
||||
tab.linkedBrowser,
|
||||
SERVER_TIMINGS_TYPE_SJS,
|
||||
async function(url) {
|
||||
content.wrappedJSObject.performRequests(1, url);
|
||||
}
|
||||
);
|
||||
await wait;
|
||||
|
||||
// There must be 4 timing values (including server side timings).
|
||||
const timingsSelector = "#timings-panel .tabpanel-summary-container.server";
|
||||
wait = waitForDOMIfNeeded(document, timingsSelector, 4);
|
||||
|
||||
EventUtils.sendMouseEvent(
|
||||
{ type: "click" },
|
||||
document.querySelectorAll(".request-list-item")[0]
|
||||
);
|
||||
|
||||
store.dispatch(Actions.toggleNetworkDetails());
|
||||
|
||||
EventUtils.sendMouseEvent(
|
||||
{ type: "click" },
|
||||
document.querySelector("#timings-tab")
|
||||
);
|
||||
await wait;
|
||||
|
||||
// Check the UI contains server side timings and correct values
|
||||
const timings = document.querySelectorAll(timingsSelector, 4);
|
||||
is(
|
||||
timings[0].textContent,
|
||||
"time1123 ms",
|
||||
"The first server-timing must be correct"
|
||||
);
|
||||
is(
|
||||
timings[1].textContent,
|
||||
"time20 ms",
|
||||
"The second server-timing must be correct"
|
||||
);
|
||||
is(
|
||||
timings[2].textContent,
|
||||
"time31.66 min",
|
||||
"The third server-timing must be correct"
|
||||
);
|
||||
is(
|
||||
timings[3].textContent,
|
||||
"time41.11 s",
|
||||
"The fourth server-timing must be correct"
|
||||
);
|
||||
|
||||
await teardown(monitor);
|
||||
});
|
|
@ -82,7 +82,6 @@ const SORTING_URL = EXAMPLE_URL + "html_sorting-test-page.html";
|
|||
const FILTERING_URL = EXAMPLE_URL + "html_filter-test-page.html";
|
||||
const INFINITE_GET_URL = EXAMPLE_URL + "html_infinite-get-page.html";
|
||||
const CUSTOM_GET_URL = EXAMPLE_URL + "html_custom-get-page.html";
|
||||
const HTTPS_CUSTOM_GET_URL = HTTPS_EXAMPLE_URL + "html_custom-get-page.html";
|
||||
const SINGLE_GET_URL = EXAMPLE_URL + "html_single-get-page.html";
|
||||
const STATISTICS_URL = EXAMPLE_URL + "html_statistics-test-page.html";
|
||||
const CURL_URL = EXAMPLE_URL + "html_copy-as-curl.html";
|
||||
|
@ -100,8 +99,6 @@ const CONTENT_TYPE_SJS = EXAMPLE_URL + "sjs_content-type-test-server.sjs";
|
|||
const WS_CONTENT_TYPE_SJS = WS_HTTP_URL + "sjs_content-type-test-server.sjs";
|
||||
const HTTPS_CONTENT_TYPE_SJS =
|
||||
HTTPS_EXAMPLE_URL + "sjs_content-type-test-server.sjs";
|
||||
const SERVER_TIMINGS_TYPE_SJS =
|
||||
HTTPS_EXAMPLE_URL + "sjs_timings-test-server.sjs";
|
||||
const STATUS_CODES_SJS = EXAMPLE_URL + "sjs_status-codes-test-server.sjs";
|
||||
const SORTING_SJS = EXAMPLE_URL + "sjs_sorting-test-server.sjs";
|
||||
const HTTPS_REDIRECT_SJS = EXAMPLE_URL + "sjs_https-redirect-test-server.sjs";
|
||||
|
|
|
@ -1,37 +0,0 @@
|
|||
/* Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
var trailerServerTiming = [
|
||||
{metric:"metric3", duration:"99789.11", description:"time3"},
|
||||
{metric:"metric4", duration:"1112.13", description:"time4"}
|
||||
];
|
||||
|
||||
var responseServerTiming = [
|
||||
{metric:"metric1", duration:"123.4", description:"time1"},
|
||||
{metric:"metric2", duration:"0", description:"time2"}
|
||||
];
|
||||
|
||||
function handleRequest(request, response) {
|
||||
var body = "c\r\ndata reached\r\n3\r\nhej\r\n0\r\n";
|
||||
|
||||
response.seizePower();
|
||||
response.write("HTTP/1.1 200 OK\r\n");
|
||||
response.write("Content-Type: text/plain\r\n");
|
||||
response.write(createServerTimingHeader(responseServerTiming));
|
||||
response.write("Transfer-Encoding: chunked\r\n");
|
||||
response.write("\r\n");
|
||||
response.write(body);
|
||||
response.write(createServerTimingHeader(trailerServerTiming));
|
||||
response.write("\r\n");
|
||||
response.finish();
|
||||
}
|
||||
|
||||
function createServerTimingHeader(headerData) {
|
||||
var header = "";
|
||||
for (var i = 0; i < headerData.length; i++) {
|
||||
header += "Server-Timing: " + headerData[i].metric + ";" +
|
||||
"dur=" + headerData[i].duration + ";" +
|
||||
"desc=" + headerData[i].description + "\r\n";
|
||||
}
|
||||
return header;
|
||||
}
|
|
@ -40,7 +40,6 @@ const NetworkEventActor = protocol.ActorClassWithSpec(networkEventSpec, {
|
|||
};
|
||||
|
||||
this._timings = {};
|
||||
this._serverTimings = {};
|
||||
this._stackTrace = {};
|
||||
|
||||
this._discardRequestBody = false;
|
||||
|
@ -50,7 +49,6 @@ const NetworkEventActor = protocol.ActorClassWithSpec(networkEventSpec, {
|
|||
_request: null,
|
||||
_response: null,
|
||||
_timings: null,
|
||||
_serverTimings: null,
|
||||
|
||||
/**
|
||||
* Returns a grip for this actor for returning in a protocol message.
|
||||
|
@ -252,7 +250,6 @@ const NetworkEventActor = protocol.ActorClassWithSpec(networkEventSpec, {
|
|||
timings: this._timings,
|
||||
totalTime: this._totalTime,
|
||||
offsets: this._offsets,
|
||||
serverTimings: this._serverTimings,
|
||||
};
|
||||
},
|
||||
|
||||
|
@ -527,11 +524,8 @@ const NetworkEventActor = protocol.ActorClassWithSpec(networkEventSpec, {
|
|||
* The total time of the network event.
|
||||
* @param object timings
|
||||
* Timing details about the network event.
|
||||
* @param object offsets
|
||||
* @param object serverTimings
|
||||
* Timing details extracted from the Server-Timing header.
|
||||
*/
|
||||
addEventTimings(total, timings, offsets, serverTimings) {
|
||||
addEventTimings(total, timings, offsets) {
|
||||
// Ignore calls when this actor is already destroyed
|
||||
if (!this.actorID) {
|
||||
return;
|
||||
|
@ -541,30 +535,11 @@ const NetworkEventActor = protocol.ActorClassWithSpec(networkEventSpec, {
|
|||
this._timings = timings;
|
||||
this._offsets = offsets;
|
||||
|
||||
if (serverTimings) {
|
||||
this._serverTimings = serverTimings;
|
||||
}
|
||||
|
||||
this.emit("network-event-update:event-timings", "eventTimings", {
|
||||
totalTime: total,
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* Store server timing information. They will be merged together
|
||||
* with network event timing data when they are available and
|
||||
* notification sent to the client.
|
||||
* See `addEventTimnings`` above for more information.
|
||||
*
|
||||
* @param object serverTimings
|
||||
* Timing details extracted from the Server-Timing header.
|
||||
*/
|
||||
addSeverTimings(serverTimings) {
|
||||
if (serverTimings) {
|
||||
this._serverTimings = serverTimings;
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Prepare the headers array to be sent to the client by using the
|
||||
* LongStringActor for the header values, when needed.
|
||||
|
|
|
@ -155,9 +155,6 @@ function NetworkObserver(filters, owner) {
|
|||
this._httpFailedOpening = DevToolsUtils.makeInfallible(
|
||||
this._httpFailedOpening
|
||||
).bind(this);
|
||||
this._httpStopRequest = DevToolsUtils.makeInfallible(
|
||||
this._httpStopRequest
|
||||
).bind(this);
|
||||
this._serviceWorkerRequest = this._serviceWorkerRequest.bind(this);
|
||||
|
||||
this._throttleData = null;
|
||||
|
@ -240,7 +237,6 @@ NetworkObserver.prototype = {
|
|||
this._httpModifyExaminer,
|
||||
"http-on-modify-request"
|
||||
);
|
||||
Services.obs.addObserver(this._httpStopRequest, "http-on-stop-request");
|
||||
} else {
|
||||
Services.obs.addObserver(
|
||||
this._httpFailedOpening,
|
||||
|
@ -308,26 +304,6 @@ NetworkObserver.prototype = {
|
|||
this._httpResponseExaminer(subject, topic, blockedCode);
|
||||
},
|
||||
|
||||
_httpStopRequest: function(subject, topic) {
|
||||
if (
|
||||
!this.owner ||
|
||||
topic != "http-on-stop-request" ||
|
||||
!(subject instanceof Ci.nsIHttpChannel)
|
||||
) {
|
||||
return;
|
||||
}
|
||||
|
||||
const timedChannel = subject.QueryInterface(Ci.nsITimedChannel);
|
||||
const httpActivity = this.createOrGetActivityObject(timedChannel);
|
||||
|
||||
// Try extracting server timings. Note that they will be sent to the client
|
||||
// in the `_onTransactionClose` method together with network event timings.
|
||||
const serverTimings = this._extractServerTimings(timedChannel);
|
||||
if (httpActivity.owner) {
|
||||
httpActivity.owner.addSeverTimings(serverTimings);
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Observe notifications for the http-on-examine-response topic, coming from
|
||||
* the nsIObserverService.
|
||||
|
@ -439,13 +415,10 @@ NetworkObserver.prototype = {
|
|||
// There also is never any timing events, so we can fire this
|
||||
// event with zeroed out values.
|
||||
const timings = this._setupHarTimings(httpActivity, true);
|
||||
|
||||
const serverTimings = this._extractServerTimings(httpActivity.channel);
|
||||
httpActivity.owner.addEventTimings(
|
||||
timings.total,
|
||||
timings.timings,
|
||||
timings.offsets,
|
||||
serverTimings
|
||||
timings.offsets
|
||||
);
|
||||
} else if (topic === "http-on-failed-opening-request") {
|
||||
this._createNetworkEvent(channel, { blockedReason });
|
||||
|
@ -997,13 +970,11 @@ NetworkObserver.prototype = {
|
|||
*/
|
||||
_onTransactionClose: function(httpActivity) {
|
||||
const result = this._setupHarTimings(httpActivity);
|
||||
if (httpActivity.owner) {
|
||||
httpActivity.owner.addEventTimings(
|
||||
result.total,
|
||||
result.timings,
|
||||
result.offsets
|
||||
);
|
||||
}
|
||||
httpActivity.owner.addEventTimings(
|
||||
result.total,
|
||||
result.timings,
|
||||
result.offsets
|
||||
);
|
||||
this.openRequests.delete(httpActivity.channel);
|
||||
},
|
||||
|
||||
|
@ -1266,25 +1237,6 @@ NetworkObserver.prototype = {
|
|||
},
|
||||
/* eslint-enable complexity */
|
||||
|
||||
_extractServerTimings: function(channel) {
|
||||
if (!channel || !channel.serverTiming) {
|
||||
return null;
|
||||
}
|
||||
|
||||
const serverTimings = new Array(channel.serverTiming.length);
|
||||
|
||||
for (let i = 0; i < channel.serverTiming.length; ++i) {
|
||||
const {
|
||||
name,
|
||||
duration,
|
||||
description,
|
||||
} = channel.serverTiming.queryElementAt(i, Ci.nsIServerTiming);
|
||||
serverTimings[i] = { name, duration, description };
|
||||
}
|
||||
|
||||
return serverTimings;
|
||||
},
|
||||
|
||||
_calculateOffsetAndTotalTime: function(
|
||||
harTimings,
|
||||
secureConnectionStartTime,
|
||||
|
@ -1354,10 +1306,6 @@ NetworkObserver.prototype = {
|
|||
this._httpModifyExaminer,
|
||||
"http-on-modify-request"
|
||||
);
|
||||
Services.obs.removeObserver(
|
||||
this._httpStopRequest,
|
||||
"http-on-stop-request"
|
||||
);
|
||||
} else {
|
||||
Services.obs.removeObserver(
|
||||
this._httpFailedOpening,
|
||||
|
|
|
@ -63,13 +63,6 @@ types.addDictType("netevent.timings", {
|
|||
timings: "netevent.timings.data",
|
||||
totalTime: "number",
|
||||
offsets: "netevent.timings.data",
|
||||
serverTimings: "array:netevent.timings.serverTiming",
|
||||
});
|
||||
|
||||
types.addDictType("netevent.timings.serverTiming", {
|
||||
name: "string",
|
||||
description: "string",
|
||||
duration: "number",
|
||||
});
|
||||
|
||||
// See NetworkHelper.parseCertificateInfo for more details
|
||||
|
|
Загрузка…
Ссылка в новой задаче