Skip to content

Commit 345ffee

Browse files
authored
Report nsIRequest::status (nsresult) in the marker (#5375)
Follow-up of [Bug 1936578](https://bugzilla.mozilla.org/show_bug.cgi?id=1936576) on Bugzilla
1 parent 81df99f commit 345ffee

File tree

3 files changed

+32
-0
lines changed

3 files changed

+32
-0
lines changed

src/components/tooltip/NetworkMarker.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -464,6 +464,14 @@ export function getNetworkMarkerDetails(
464464
);
465465
}
466466

467+
if (payload.requestStatus) {
468+
details.push(
469+
<TooltipDetail label="Request Status" key="Network-Request Status">
470+
{payload.requestStatus}
471+
</TooltipDetail>
472+
);
473+
}
474+
467475
if (payload.responseStatus) {
468476
details.push(
469477
<TooltipDetail label="Response Status Code" key="Network-Response Status">

src/test/components/TooltipMarker.test.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -848,6 +848,27 @@ describe('TooltipMarker', function () {
848848
);
849849
});
850850

851+
it('renders page information for pages with request status', () => {
852+
setupWithPayload(
853+
getNetworkMarkers({
854+
id: 1235,
855+
startTime: 19000,
856+
fetchStart: 19200.2,
857+
endTime: 20433.8,
858+
uri: 'https://example.org/index.html',
859+
payload: {
860+
cache: 'Hit',
861+
pri: 8,
862+
count: 47027,
863+
contentType: 'text/html',
864+
requestStatus: 'NS_OK',
865+
},
866+
})
867+
);
868+
869+
expect(getValueForProperty('Request Status')).toBe('NS_OK');
870+
});
871+
851872
it('renders page information for pages with response status code', () => {
852873
setupWithPayload(
853874
getNetworkMarkers({

src/types/markers.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -539,6 +539,9 @@ export type NetworkPayload = {|
539539
// or we use 'Unset' if no flag is set.
540540
classOfService?: string,
541541

542+
// Used to show the request status (nsresult nsIRequest::status)
543+
requestStatus?: string,
544+
542545
// Used to show the HTTP response status code
543546
responseStatus?: number,
544547

0 commit comments

Comments
 (0)