Backed out changeset cd395be35318 (bug 1341278) for eslint failures. r=backout

This commit is contained in:
Sebastian Hengst 2017-02-23 21:52:33 +01:00
Родитель 7168dc8ef5
Коммит 6decedd6a9
9 изменённых файлов: 24 добавлений и 66 удалений

Просмотреть файл

@ -56,6 +56,10 @@ const Toolbar = createClass({
toggleRequestFilterType: PropTypes.func.isRequired,
},
componentDidMount() {
Prefs.filters.forEach(this.props.toggleRequestFilterType);
},
toggleRequestFilterType(evt) {
if (evt.type === "keydown" && (evt.key !== "" || evt.key !== "Enter")) {
return;

Просмотреть файл

@ -80,8 +80,4 @@ function filters(state = new Filters(), action) {
}
}
module.exports = {
FilterTypes,
Filters,
filters
};
module.exports = filters;

Просмотреть файл

@ -6,16 +6,16 @@
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,

Просмотреть файл

@ -245,7 +245,4 @@ function requestsReducer(state = new Requests(), action) {
}
}
module.exports = {
Requests,
requestsReducer,
}
module.exports = requestsReducer;

Просмотреть файл

@ -30,7 +30,4 @@ function sortReducer(state = new Sort(), action) {
}
}
module.exports = {
Sort,
sortReducer
}
module.exports = sortReducer;

Просмотреть файл

@ -51,7 +51,4 @@ function timingMarkers(state = new TimingMarkers(), action) {
}
}
module.exports = {
TimingMarkers,
timingMarkers
}
module.exports = timingMarkers;

Просмотреть файл

@ -64,7 +64,4 @@ function ui(state = new UI(), action) {
}
}
module.exports = {
UI,
ui
}
module.exports = ui;

Просмотреть файл

@ -9,31 +9,10 @@ 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,

Просмотреть файл

@ -35,16 +35,16 @@ add_task(function* () {
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();
@ -54,18 +54,9 @@ add_task(function* () {
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.");
});