Bug 1413540 - Merge 'flash' filter into 'Others'. r=Honza
authorabhinav <abhinav.koppula@gmail.com>
Sun, 05 Nov 2017 12:26:36 +0530
changeset 443804 1dfd52f8297352aac98ca530edb8d7931ea2ee4c
parent 443803 34b559b82c0354ba6bbe32c932994db991cb38c3
child 443805 294c88b3bd2cdb6592b1decc03c54f3931474447
push id1618
push userCallek@gmail.com
push dateThu, 11 Jan 2018 17:45:48 +0000
treeherdermozilla-release@882ca853e05a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersHonza
bugs1413540
milestone58.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 1413540 - Merge 'flash' filter into 'Others'. r=Honza MozReview-Commit-ID: CjxepUwYHr0
devtools/client/netmonitor/src/components/StatisticsPanel.js
devtools/client/netmonitor/src/constants.js
devtools/client/netmonitor/src/utils/filter-predicates.js
devtools/client/netmonitor/test/browser_net_filter-01.js
devtools/client/netmonitor/test/browser_net_footer-summary.js
devtools/client/netmonitor/test/browser_net_statistics-02.js
--- a/devtools/client/netmonitor/src/components/StatisticsPanel.js
+++ b/devtools/client/netmonitor/src/components/StatisticsPanel.js
@@ -203,29 +203,26 @@ class StatisticsPanel extends Component 
         // "fonts"
         type = 4;
       } else if (Filters.images(request)) {
         // "images"
         type = 5;
       } else if (Filters.media(request)) {
         // "media"
         type = 6;
-      } else if (Filters.flash(request)) {
-        // "flash"
-        type = 7;
       } else if (Filters.ws(request)) {
         // "ws"
-        type = 8;
+        type = 7;
       } else if (Filters.xhr(request)) {
         // Verify XHR last, to categorize other mime types in their own blobs.
         // "xhr"
         type = 3;
       } else {
         // "other"
-        type = 9;
+        type = 8;
       }
 
       if (emptyCache || !this.responseIsFresh(request)) {
         data[type].time += request.totalTime || 0;
         data[type].size += request.contentSize || 0;
         data[type].transferredSize += request.transferredSize || 0;
       } else {
         data[type].cached++;
--- a/devtools/client/netmonitor/src/constants.js
+++ b/devtools/client/netmonitor/src/constants.js
@@ -270,17 +270,16 @@ const FILTER_FLAGS = [
 const FILTER_TAGS = [
   "html",
   "css",
   "js",
   "xhr",
   "fonts",
   "images",
   "media",
-  "flash",
   "ws",
   "other",
 ];
 
 const REQUESTS_WATERFALL = {
   BACKGROUND_TICKS_MULTIPLE: 5, // ms
   BACKGROUND_TICKS_SCALES: 3,
   BACKGROUND_TICKS_SPACING_MIN: 10, // px
--- a/devtools/client/netmonitor/src/utils/filter-predicates.js
+++ b/devtools/client/netmonitor/src/utils/filter-predicates.js
@@ -56,25 +56,16 @@ function isImage({ mimeType }) {
 function isMedia({ mimeType }) {
   // Not including images.
   return mimeType && (
     mimeType.includes("audio/") ||
     mimeType.includes("video/") ||
     mimeType.includes("model/"));
 }
 
-function isFlash({ url, mimeType }) {
-  // Flash is a mess.
-  return (mimeType && (
-      mimeType.includes("/x-flv") ||
-      mimeType.includes("/x-shockwave-flash"))) ||
-    url.includes(".swf") ||
-    url.includes(".flv");
-}
-
 function isWS({ requestHeaders, responseHeaders }) {
   // Detect a websocket upgrade if request has an Upgrade header with value 'websocket'
   if (!requestHeaders || !Array.isArray(requestHeaders.headers)) {
     return false;
   }
 
   // Find the 'upgrade' header.
   let upgradeHeader = requestHeaders.headers.find(header => {
@@ -95,28 +86,27 @@ function isWS({ requestHeaders, response
   if (!upgradeHeader || upgradeHeader.value != "websocket") {
     return false;
   }
 
   return true;
 }
 
 function isOther(item) {
-  let tests = [isHtml, isCss, isJs, isXHR, isFont, isImage, isMedia, isFlash, isWS];
+  let tests = [isHtml, isCss, isJs, isXHR, isFont, isImage, isMedia, isWS];
   return tests.every(is => !is(item));
 }
 
 module.exports = {
   Filters: {
     all: all,
     html: isHtml,
     css: isCss,
     js: isJs,
     xhr: isXHR,
     fonts: isFont,
     images: isImage,
     media: isMedia,
-    flash: isFlash,
     ws: isWS,
     other: isOther,
   },
   isFreetextMatch,
 };
--- a/devtools/client/netmonitor/test/browser_net_filter-01.js
+++ b/devtools/client/netmonitor/test/browser_net_filter-01.js
@@ -211,23 +211,16 @@ add_task(function* () {
   EventUtils.sendMouseEvent({ type: "click" },
     document.querySelector(".requests-list-filter-media-button"));
   testFilterButtons(monitor, "media");
   yield testContents([0, 0, 0, 0, 0, 1, 1, 0, 0]);
 
   EventUtils.sendMouseEvent({ type: "click" },
     document.querySelector(".requests-list-filter-all-button"));
   EventUtils.sendMouseEvent({ type: "click" },
-    document.querySelector(".requests-list-filter-flash-button"));
-  testFilterButtons(monitor, "flash");
-  yield testContents([0, 0, 0, 0, 0, 0, 0, 1, 0]);
-
-  EventUtils.sendMouseEvent({ type: "click" },
-    document.querySelector(".requests-list-filter-all-button"));
-  EventUtils.sendMouseEvent({ type: "click" },
     document.querySelector(".requests-list-filter-ws-button"));
   testFilterButtons(monitor, "ws");
   yield testContents([0, 0, 0, 0, 0, 0, 0, 0, 1]);
 
   EventUtils.sendMouseEvent({ type: "click" },
     document.querySelector(".requests-list-filter-all-button"));
 
   testFilterButtons(monitor, "all");
@@ -260,52 +253,47 @@ add_task(function* () {
   // ...then combine multiple filters together.
 
   // Enable filtering for html and css; should show request of both type.
   setFreetextFilter("");
   EventUtils.sendMouseEvent({ type: "click" },
     document.querySelector(".requests-list-filter-html-button"));
   EventUtils.sendMouseEvent({ type: "click" },
     document.querySelector(".requests-list-filter-css-button"));
-  testFilterButtonsCustom(monitor, [0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0]);
+  testFilterButtonsCustom(monitor, [0, 1, 1, 0, 0, 0, 0, 0, 0, 0]);
   yield testContents([1, 1, 0, 0, 0, 0, 0, 0, 0]);
 
   // Html and css filter enabled and text filter should show just the html and css match.
   // Should not show both the items matching the button plus the items matching the text.
   setFreetextFilter("sample");
   yield testContents([1, 1, 0, 0, 0, 0, 0, 0, 0]);
-
-  EventUtils.sendMouseEvent({ type: "click" },
-    document.querySelector(".requests-list-filter-flash-button"));
   setFreetextFilter("");
-  testFilterButtonsCustom(monitor, [0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0]);
-  yield testContents([1, 1, 0, 0, 0, 0, 0, 1, 0]);
+  testFilterButtonsCustom(monitor, [0, 1, 1, 0, 0, 0, 0, 0, 0, 0]);
+  yield testContents([1, 1, 0, 0, 0, 0, 0, 0, 0]);
 
   // Disable some filters. Only one left active.
   EventUtils.sendMouseEvent({ type: "click" },
     document.querySelector(".requests-list-filter-css-button"));
-  EventUtils.sendMouseEvent({ type: "click" },
-    document.querySelector(".requests-list-filter-flash-button"));
   testFilterButtons(monitor, "html");
   yield testContents([1, 0, 0, 0, 0, 0, 0, 0, 0]);
 
   // Disable last active filter. Should toggle to all.
   EventUtils.sendMouseEvent({ type: "click" },
     document.querySelector(".requests-list-filter-html-button"));
   testFilterButtons(monitor, "all");
   yield testContents([1, 1, 1, 1, 1, 1, 1, 1, 1]);
 
   // Enable few filters and click on all. Only "all" should be checked.
   EventUtils.sendMouseEvent({ type: "click" },
     document.querySelector(".requests-list-filter-html-button"));
   EventUtils.sendMouseEvent({ type: "click" },
     document.querySelector(".requests-list-filter-css-button"));
   EventUtils.sendMouseEvent({ type: "click" },
     document.querySelector(".requests-list-filter-ws-button"));
-  testFilterButtonsCustom(monitor, [0, 1, 1, 0, 0, 0, 0, 0, 0, 1]);
+  testFilterButtonsCustom(monitor, [0, 1, 1, 0, 0, 0, 0, 0, 1, 0]);
   EventUtils.sendMouseEvent({ type: "click" },
     document.querySelector(".requests-list-filter-all-button"));
   testFilterButtons(monitor, "all");
   yield testContents([1, 1, 1, 1, 1, 1, 1, 1, 1]);
 
   yield teardown(monitor);
 
   function getSelectedIndex(state) {
--- a/devtools/client/netmonitor/test/browser_net_footer-summary.js
+++ b/devtools/client/netmonitor/test/browser_net_footer-summary.js
@@ -33,17 +33,17 @@ add_task(function* () {
     let wait = waitForNetworkEvents(monitor, 8);
     yield ContentTask.spawn(tab.linkedBrowser, {}, function* () {
       content.wrappedJSObject.performRequests('{ "getMedia": true, "getFlash": true }');
     });
     yield wait;
 
     testStatus();
 
-    let buttons = ["html", "css", "js", "xhr", "fonts", "images", "media", "flash"];
+    let buttons = ["html", "css", "js", "xhr", "fonts", "images", "media"];
     for (let button of buttons) {
       let buttonEl = document.querySelector(`.requests-list-filter-${button}-button`);
       EventUtils.sendMouseEvent({ type: "click" }, buttonEl);
       testStatus();
     }
   }
 
   yield teardown(monitor);
--- a/devtools/client/netmonitor/test/browser_net_statistics-02.js
+++ b/devtools/client/netmonitor/test/browser_net_statistics-02.js
@@ -21,17 +21,17 @@ add_task(function* () {
   EventUtils.sendMouseEvent({ type: "click" },
     document.querySelector(".requests-list-filter-css-button"));
   EventUtils.sendMouseEvent({ type: "click" },
     document.querySelector(".requests-list-filter-js-button"));
   EventUtils.sendMouseEvent({ type: "click" },
     document.querySelector(".requests-list-filter-ws-button"));
   EventUtils.sendMouseEvent({ type: "click" },
     document.querySelector(".requests-list-filter-other-button"));
-  testFilterButtonsCustom(monitor, [0, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1]);
+  testFilterButtonsCustom(monitor, [0, 1, 1, 1, 0, 0, 0, 0, 1, 1]);
   info("The correct filtering predicates are used before entering perf. analysis mode.");
 
   store.dispatch(Actions.openStatistics(connector, true));
 
   ok(document.querySelector(".statistics-panel"),
     "The main panel is switched to the statistics panel.");
 
   yield waitUntil(