Backed out changeset cd395be35318 (bug 1341278) for eslint failures. r=backout
authorSebastian Hengst <archaeopteryx@coole-files.de>
Thu, 23 Feb 2017 21:52:33 +0100
changeset 344635 a8cbc9a260391ee317257e4dddd2d55e70dac9d5
parent 344634 212db4739778f1e58dfba06c660e7b1acd399750
child 344636 25ce82ad3b4ba1d6f8c72526f18c58b95b304bd8
push id31414
push usercbook@mozilla.com
push dateFri, 24 Feb 2017 10:47:41 +0000
treeherdermozilla-central@be661bae6cb9 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbackout
bugs1341278
milestone54.0a1
backs outcd395be353188b5e4ff953502ac7ed951a5ade29
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
Backed out changeset cd395be35318 (bug 1341278) for eslint failures. r=backout
devtools/client/netmonitor/components/toolbar.js
devtools/client/netmonitor/reducers/filters.js
devtools/client/netmonitor/reducers/index.js
devtools/client/netmonitor/reducers/requests.js
devtools/client/netmonitor/reducers/sort.js
devtools/client/netmonitor/reducers/timing-markers.js
devtools/client/netmonitor/reducers/ui.js
devtools/client/netmonitor/store.js
devtools/client/netmonitor/test/browser_net_filter-04.js
--- a/devtools/client/netmonitor/components/toolbar.js
+++ b/devtools/client/netmonitor/components/toolbar.js
@@ -51,16 +51,20 @@ const Toolbar = createClass({
     setRequestFilterText: PropTypes.func.isRequired,
     networkDetailsToggleDisabled: PropTypes.bool.isRequired,
     networkDetailsOpen: PropTypes.bool.isRequired,
     summary: PropTypes.object.isRequired,
     toggleNetworkDetails: PropTypes.func.isRequired,
     toggleRequestFilterType: PropTypes.func.isRequired,
   },
 
+  componentDidMount() {
+    Prefs.filters.forEach(this.props.toggleRequestFilterType);
+  },
+
   toggleRequestFilterType(evt) {
     if (evt.type === "keydown" && (evt.key !== "" || evt.key !== "Enter")) {
       return;
     }
     this.props.toggleRequestFilterType(evt.target.dataset.key);
   },
 
   render() {
--- a/devtools/client/netmonitor/reducers/filters.js
+++ b/devtools/client/netmonitor/reducers/filters.js
@@ -75,13 +75,9 @@ function filters(state = new Filters(), 
         toggleRequestFilterType(state.requestFilterTypes, action));
     case SET_REQUEST_FILTER_TEXT:
       return state.set("requestFilterText", action.text);
     default:
       return state;
   }
 }
 
-module.exports = {
-  FilterTypes,
-  Filters,
-  filters
-};
+module.exports = filters;
--- a/devtools/client/netmonitor/reducers/index.js
+++ b/devtools/client/netmonitor/reducers/index.js
@@ -1,23 +1,23 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
 const { combineReducers } = require("devtools/client/shared/vendor/redux");
 const batchingReducer = require("./batching");
-const { requestsReducer } = require("./requests");
-const { sortReducer } = require("./sort");
-const { filters } = require("./filters");
-const { timingMarkers } = require("./timing-markers");
-const { ui } = require("./ui");
+const requests = require("./requests");
+const sort = require("./sort");
+const filters = require("./filters");
+const timingMarkers = require("./timing-markers");
+const ui = require("./ui");
 
 module.exports = batchingReducer(
   combineReducers({
-    requests: requestsReducer,
-    sort: sortReducer,
+    requests,
+    sort,
     filters,
     timingMarkers,
     ui,
   })
 );
--- a/devtools/client/netmonitor/reducers/requests.js
+++ b/devtools/client/netmonitor/reducers/requests.js
@@ -240,12 +240,9 @@ function requestsReducer(state = new Req
       return state;
     }
 
     default:
       return state;
   }
 }
 
-module.exports = {
-  Requests,
-  requestsReducer,
-}
+module.exports = requestsReducer;
--- a/devtools/client/netmonitor/reducers/sort.js
+++ b/devtools/client/netmonitor/reducers/sort.js
@@ -25,12 +25,9 @@ function sortReducer(state = new Sort(),
         }
       });
     }
     default:
       return state;
   }
 }
 
-module.exports = {
-  Sort,
-  sortReducer
-}
+module.exports = sortReducer;
--- a/devtools/client/netmonitor/reducers/timing-markers.js
+++ b/devtools/client/netmonitor/reducers/timing-markers.js
@@ -46,12 +46,9 @@ function timingMarkers(state = new Timin
     case CLEAR_TIMING_MARKERS:
       return clearTimingMarkers(state);
 
     default:
       return state;
   }
 }
 
-module.exports = {
-  TimingMarkers,
-  timingMarkers
-}
+module.exports = timingMarkers;
--- a/devtools/client/netmonitor/reducers/ui.js
+++ b/devtools/client/netmonitor/reducers/ui.js
@@ -59,12 +59,9 @@ function ui(state = new UI(), action) {
       return openNetworkDetails(state, { open: true });
     case WATERFALL_RESIZE:
       return resizeWaterfall(state, action);
     default:
       return state;
   }
 }
 
-module.exports = {
-  UI,
-  ui
-}
+module.exports = ui;
--- a/devtools/client/netmonitor/store.js
+++ b/devtools/client/netmonitor/store.js
@@ -4,41 +4,20 @@
 
 "use strict";
 
 const { createStore, applyMiddleware } = require("devtools/client/shared/vendor/redux");
 const { thunk } = require("devtools/client/shared/redux/middleware/thunk");
 const batching = require("./middleware/batching");
 const prefs = require("./middleware/prefs");
 const rootReducer = require("./reducers/index");
-const { Prefs } = require("./utils/prefs");
-const { FilterTypes, Filters } = require("./reducers/filters");
-const { Requests } = require("./reducers/requests");
-const { Sort } = require("./reducers/sort");
-const { TimingMarkers } = require("./reducers/timing-markers");
-const { UI } = require("./reducers/ui");
 
 function configureStore() {
-  let activeFilters = {};
-  Prefs.filters.forEach((filter) => {
-    activeFilters[filter] = true;
-  });
-  const initialState = {
-    filters: new Filters({
-      requestFilterTypes: new FilterTypes(activeFilters)
-    }),
-    requests: new Requests(),
-    sort: new Sort(),
-    timingMarkers: new TimingMarkers(),
-    ui: new UI()
-  }
-
   return createStore(
     rootReducer,
-    initialState,
     applyMiddleware(
       thunk,
       prefs,
       batching
     )
   );
 }
 
--- a/devtools/client/netmonitor/test/browser_net_filter-04.js
+++ b/devtools/client/netmonitor/test/browser_net_filter-04.js
@@ -30,42 +30,33 @@ const REQUESTS_WITH_MEDIA_AND_FLASH_AND_
 ]);
 
 add_task(function* () {
   Services.prefs.setCharPref("devtools.netmonitor.filters", '["bogus", "js", "alsobogus"]');
 
   let { monitor } = yield initNetMonitor(FILTERING_URL);
   info("Starting test... ");
 
-  let { document, gStore, windowRequire } = monitor.panelWin;
+  let { gStore, windowRequire } = monitor.panelWin;
   let Actions = windowRequire("devtools/client/netmonitor/actions/index");
   let { Prefs } = windowRequire("devtools/client/netmonitor/utils/prefs");
 
   gStore.dispatch(Actions.batchEnable(false));
 
-  is(Prefs.filters.length, 3,
-    "All the filter types should be loaded.");
-  is(Prefs.filters[0], "bogus",
-    "The first filter type is invalid, but loaded anyway.");
+  is(Prefs.filters.length, 1,
+    "Only the valid filter types should be loaded, the others should be ignored");
+  is(Prefs.filters[0], "js",
+    "The only filter type is correct.");
 
   let wait = waitForNetworkEvents(monitor, 9);
   loadCommonFrameScript();
   yield performRequestsInContent(REQUESTS_WITH_MEDIA_AND_FLASH_AND_WS);
   yield wait;
 
   testFilterButtons(monitor, "js");
   ok(true, "Only the correct filter type was taken into consideration.");
 
-  EventUtils.sendMouseEvent({ type: "click" },
-    document.querySelector(".requests-list-filter-html-button"));
+  yield teardown(monitor);
 
   let filters = Services.prefs.getCharPref("devtools.netmonitor.filters");
-  is(filters, '["html","js"]',
-    "The filters preferences were saved directly after the click and only with the valid.");
-
-  EventUtils.sendMouseEvent({ type: "click" },
-    document.querySelector(".requests-list-network-summary-button"));
-  yield wait;
-
-  
-
-  yield teardown(monitor);
+  is(filters, '["js"]',
+    "The bogus filter type was ignored and removed from the preferences.");
 });