Bug 1537616 - File column shows full URL. r=Honza
authorlloan <lloanalas@outlook.com>
Thu, 04 Apr 2019 10:54:23 +0000
changeset 467966 09132ad821801ba248d199cfa3342b39b7d8c98b
parent 467965 b2f3367509f940e0c94826d23f4fb1b8664e9f77
child 467967 2c261b95d855b3f61595342fdce6cd64fd1f1cc1
push id112667
push useraiakab@mozilla.com
push dateThu, 04 Apr 2019 16:12:45 +0000
treeherdermozilla-inbound@230bb363f2f3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersHonza
bugs1537616
milestone68.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1537616 - File column shows full URL. r=Honza The File column in Network monitor regressed to show the full URL while it should just show the parts after the domain. Differential Revision: https://phabricator.services.mozilla.com/D24303
devtools/client/netmonitor/src/components/RequestListColumnFile.js
devtools/client/netmonitor/test/head.js
--- a/devtools/client/netmonitor/src/components/RequestListColumnFile.js
+++ b/devtools/client/netmonitor/src/components/RequestListColumnFile.js
@@ -31,23 +31,24 @@ class RequestListColumnFile extends Comp
     } = this.props;
 
     const originalFileURL = urlDetails.url;
     const decodedFileURL = urlDetails.unicodeUrl;
     const ORIGINAL_FILE_URL = L10N.getFormatStr("netRequest.originalFileURL.tooltip",
       originalFileURL);
     const DECODED_FILE_URL = L10N.getFormatStr("netRequest.decodedFileURL.tooltip",
       decodedFileURL);
+    const requestedFile = urlDetails.baseNameWithQuery;
     const fileToolTip = originalFileURL === decodedFileURL ?
       originalFileURL : ORIGINAL_FILE_URL + "\n\n" + DECODED_FILE_URL;
 
     return (
       dom.td({
         className: "requests-list-column requests-list-file",
         title: fileToolTip,
       },
-        originalFileURL
+        requestedFile
       )
     );
   }
 }
 
 module.exports = RequestListColumnFile;
--- a/devtools/client/netmonitor/test/head.js
+++ b/devtools/client/netmonitor/test/head.js
@@ -440,16 +440,17 @@ function verifyRequestItemTarget(documen
   // Bug 1414981 - Request URL should not show #hash
   const unicodeUrl = getUnicodeUrl(url.split("#")[0]);
   const ORIGINAL_FILE_URL = L10N.getFormatStr("netRequest.originalFileURL.tooltip",
     url);
   const DECODED_FILE_URL = L10N.getFormatStr("netRequest.decodedFileURL.tooltip",
     unicodeUrl);
   const fileToolTip = url === unicodeUrl ?
     url : ORIGINAL_FILE_URL + "\n\n" + DECODED_FILE_URL;
+  const requestedFile = requestItem.urlDetails.baseNameWithQuery;
   const host = getUnicodeHostname(getUrlHost(url));
   const scheme = getUrlScheme(url);
   const {
     remoteAddress,
     remotePort,
     totalTime,
     eventTimings = { timings: {} },
   } = requestItem;
@@ -467,23 +468,23 @@ function verifyRequestItemTarget(documen
     is(requestItem.url, url.split("#")[0], "The attached url is correct.");
   }
 
   is(target.querySelector(".requests-list-method").textContent,
     method, "The displayed method is correct.");
 
   if (fuzzyUrl) {
     ok(target.querySelector(".requests-list-file").textContent.startsWith(
-      url), "The displayed file is correct.");
+      requestedFile), "The displayed file is correct.");
     ok(target.querySelector(".requests-list-file").getAttribute("title")
                                                   .startsWith(fileToolTip),
       "The tooltip file is correct.");
   } else {
     is(target.querySelector(".requests-list-file").textContent,
-      url,
+      requestedFile,
       "The displayed file is correct.");
     is(target.querySelector(".requests-list-file").getAttribute("title"),
       fileToolTip, "The tooltip file is correct.");
   }
 
   is(target.querySelector(".requests-list-protocol").textContent,
     protocol, "The displayed protocol is correct.");