Bug 1700106 - [devtools] Remove the balanced-observers eslint disabling from DevTools mochitests. r=jdescottes

Differential Revision: https://phabricator.services.mozilla.com/D109476
This commit is contained in:
Alexandre Poirot 2021-03-23 15:51:17 +00:00
Родитель ddbcbd77a1
Коммит d43cb93f72
3 изменённых файлов: 7 добавлений и 3 удалений

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

@ -11,8 +11,6 @@ module.exports = {
rules: {
// Allow non-camelcase so that run_test doesn't produce a warning.
camelcase: "off",
// Tests don't have to cleanup observers
"mozilla/balanced-observers": 0,
// Tests can always import anything.
"mozilla/reject-some-requires": 0,
},

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

@ -112,6 +112,9 @@ var httpObserver = function(subject, topic, state) {
}
};
Services.obs.addObserver(httpObserver, "http-on-modify-request");
registerCleanupFunction(() => {
Services.obs.removeObserver(httpObserver, "http-on-modify-request");
});
function onMessage({ data }) {
assertEvent(data.event, data.data);

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

@ -113,7 +113,10 @@ function waitForDelayedStartupFinished(win) {
return new Promise(resolve => {
Services.obs.addObserver(function observer(subject, topic) {
if (win == subject) {
Services.obs.removeObserver(observer, topic);
Services.obs.removeObserver(
observer,
"browser-delayed-startup-finished"
);
resolve();
}
}, "browser-delayed-startup-finished");