Bug 1472875 - HTTP response text missing in devtools/network/headers panel r=Honza a=pascalc
authorLucas Luna Souza <lucas.lunasouza@mail.utoronto.ca>
Sun, 15 Jul 2018 04:59:30 -0400
changeset 490085 7b90b8e04295
parent 490084 79125b42f1be
child 490086 fb0e9934b6ce
push id9901
push userebalazs@mozilla.com
push dateThu, 27 Sep 2018 11:50:27 +0000
treeherdermozilla-beta@b404112c2f6c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersHonza, pascalc
bugs1472875
milestone63.0
Bug 1472875 - HTTP response text missing in devtools/network/headers panel r=Honza a=pascalc
devtools/client/netmonitor/src/assets/styles/NetworkDetailsPanel.css
devtools/client/netmonitor/src/components/HeadersPanel.js
devtools/client/netmonitor/test/browser_net_status-codes.js
--- a/devtools/client/netmonitor/src/assets/styles/NetworkDetailsPanel.css
+++ b/devtools/client/netmonitor/src/assets/styles/NetworkDetailsPanel.css
@@ -232,16 +232,17 @@
 }
 
 .headers-summary .textbox-input {
   margin-inline-end: 2px;
 }
 
 .network-monitor .headers-summary .status-text {
     width: auto!important;
+    margin-left: 4px;
 }
 
 /* Response tabpanel */
 
 .network-monitor .response-error-header {
   margin: 0;
   padding: 3px 8px;
   background-color: var(--theme-highlight-red);
--- a/devtools/client/netmonitor/src/components/HeadersPanel.js
+++ b/devtools/client/netmonitor/src/components/HeadersPanel.js
@@ -207,26 +207,34 @@ class HeadersPanel extends Component {
     const summaryAddress = remoteAddress ?
       this.renderSummary(SUMMARY_ADDRESS,
         getFormattedIPAndPort(remoteAddress, remotePort)) : null;
 
     let summaryStatus;
 
     if (status) {
       const statusCodeDocURL = getHTTPStatusCodeURL(status.toString());
+      const inputWidth = statusText.length + 1;
       const toggleRawHeadersClassList = ["devtools-button", "raw-headers-button"];
       if (this.state.rawHeadersOpened) {
         toggleRawHeadersClassList.push("checked");
       }
       summaryStatus = (
         div({ className: "tabpanel-summary-container headers-summary" },
           div({
             className: "tabpanel-summary-label headers-summary-label",
           }, SUMMARY_STATUS),
           StatusCode({ item }),
+          input({
+            className: "tabpanel-summary-value textbox-input devtools-monospace"
+              + " status-text",
+            readOnly: true,
+            value: `${statusText}`,
+            size: `${inputWidth}`,
+          }),
           statusCodeDocURL ? MDNLink({
             url: statusCodeDocURL,
           }) : span({
             className: "headers-summary learn-more-link",
           }),
           button({
             className: "devtools-button edit-and-resend-button",
             onClick: cloneSelectedRequest,
--- a/devtools/client/netmonitor/test/browser_net_status-codes.js
+++ b/devtools/client/netmonitor/test/browser_net_status-codes.js
@@ -171,26 +171,28 @@ add_task(async function() {
 
     await waitUntil(() => document.querySelector(
       "#headers-panel .tabpanel-summary-value.textbox-input"));
 
     const panel = document.querySelector("#headers-panel");
     const summaryValues = panel.querySelectorAll(".tabpanel-summary-value.textbox-input");
     const { method, correctUri, details: { status, statusText } } = data;
     const statusCode = panel.querySelector(".status-code");
+    const statusTextInput = panel.querySelector(".status-text");
     EventUtils.sendMouseEvent({ type: "mouseover" }, statusCode);
     await waitUntil(() => statusCode.title);
 
     is(summaryValues[0].value, correctUri,
       "The url summary value is incorrect.");
     is(summaryValues[1].value, method, "The method summary value is incorrect.");
     is(statusCode.dataset.code, status,
       "The status summary code is incorrect.");
     is(statusCode.getAttribute("title"), status + " " + statusText,
       "The status summary value is incorrect.");
+    is(statusTextInput.value, statusText, "The status text value is incorrect.");
   }
 
   /**
    * A function that tests "Params" panel contains correct information.
    */
   function testParams(data, index) {
     EventUtils.sendMouseEvent({ type: "mousedown" },
       document.querySelectorAll(".request-list-item")[index]);