diff options
Diffstat (limited to 'devtools/client/netmonitor')
44 files changed, 431 insertions, 429 deletions
diff --git a/devtools/client/netmonitor/src/actions/http-custom-request.js b/devtools/client/netmonitor/src/actions/http-custom-request.js index e045107410..7b2da3b403 100644 --- a/devtools/client/netmonitor/src/actions/http-custom-request.js +++ b/devtools/client/netmonitor/src/actions/http-custom-request.js @@ -34,7 +34,7 @@ const { * @returns {Function} */ function openHTTPCustomRequest(isOpen) { - return ({ dispatch, getState }) => { + return ({ dispatch }) => { dispatch({ type: OPEN_ACTION_BAR, open: isOpen }); dispatch({ diff --git a/devtools/client/netmonitor/src/actions/request-blocking.js b/devtools/client/netmonitor/src/actions/request-blocking.js index 502999c79f..ab2a1430a9 100644 --- a/devtools/client/netmonitor/src/actions/request-blocking.js +++ b/devtools/client/netmonitor/src/actions/request-blocking.js @@ -114,7 +114,7 @@ function closeRequestBlocking() { } function openRequestBlockingAndAddUrl(url) { - return async ({ dispatch, getState }) => { + return async ({ dispatch }) => { const showBlockingPanel = Services.prefs.getBoolPref( "devtools.netmonitor.features.requestBlocking" ); @@ -127,7 +127,7 @@ function openRequestBlockingAndAddUrl(url) { } function openRequestBlockingAndDisableUrls(url) { - return async ({ dispatch, getState }) => { + return async ({ dispatch }) => { const showBlockingPanel = Services.prefs.getBoolPref( "devtools.netmonitor.features.requestBlocking" ); diff --git a/devtools/client/netmonitor/src/actions/search.js b/devtools/client/netmonitor/src/actions/search.js index 97b123d361..647164cc11 100644 --- a/devtools/client/netmonitor/src/actions/search.js +++ b/devtools/client/netmonitor/src/actions/search.js @@ -176,7 +176,7 @@ function clearSearchResults() { * @returns {Function} */ function clearSearchResultAndCancel() { - return ({ dispatch, getState }) => { + return ({ dispatch }) => { dispatch(stopOngoingSearch()); dispatch(clearSearchResults()); }; @@ -196,7 +196,7 @@ function updateSearchStatus(status) { * Close the entire search panel. */ function closeSearch() { - return ({ dispatch, getState }) => { + return ({ dispatch }) => { dispatch(stopOngoingSearch()); dispatch({ type: OPEN_ACTION_BAR, open: false }); }; @@ -207,7 +207,7 @@ function closeSearch() { * @returns {Function} */ function openSearch() { - return ({ dispatch, getState }) => { + return ({ dispatch }) => { dispatch({ type: OPEN_ACTION_BAR, open: true }); dispatch({ @@ -222,7 +222,7 @@ function openSearch() { * @returns {Function} */ function toggleCaseSensitiveSearch() { - return ({ dispatch, getState }) => { + return ({ dispatch }) => { dispatch({ type: TOGGLE_SEARCH_CASE_SENSITIVE_SEARCH }); }; } @@ -280,7 +280,7 @@ function stopOngoingSearch() { * clicked search result. */ function navigate(searchResult) { - return ({ dispatch, getState }) => { + return ({ dispatch }) => { // Store target search result in Search reducer. It's used // for search result navigation within the side panels. dispatch(setTargetSearchResult(searchResult)); diff --git a/devtools/client/netmonitor/src/app.js b/devtools/client/netmonitor/src/app.js index d7cf642d48..a41ae2156c 100644 --- a/devtools/client/netmonitor/src/app.js +++ b/devtools/client/netmonitor/src/app.js @@ -41,7 +41,7 @@ function NetMonitorApp(api) { } NetMonitorApp.prototype = { - async bootstrap({ toolbox, document, win }) { + async bootstrap({ toolbox, document }) { // Get the root element for mounting. this.mount = document.querySelector("#mount"); diff --git a/devtools/client/netmonitor/src/assets/styles/NetworkDetailsBar.css b/devtools/client/netmonitor/src/assets/styles/NetworkDetailsBar.css index 4ab1c2f2bc..6f91a78bc7 100644 --- a/devtools/client/netmonitor/src/assets/styles/NetworkDetailsBar.css +++ b/devtools/client/netmonitor/src/assets/styles/NetworkDetailsBar.css @@ -508,7 +508,7 @@ height: 12px; vertical-align: -1px; margin-inline-start: 5px; - background-image: url(chrome://devtools/skin/images/alert-small.svg); + background-image: url(resource://devtools-shared-images/alert-small.svg); background-size: cover; -moz-context-properties: fill; fill: var(--yellow-60); diff --git a/devtools/client/netmonitor/src/components/CustomRequestPanel.js b/devtools/client/netmonitor/src/components/CustomRequestPanel.js index 66f63b7d8d..14ca7ca214 100644 --- a/devtools/client/netmonitor/src/components/CustomRequestPanel.js +++ b/devtools/client/netmonitor/src/components/CustomRequestPanel.js @@ -361,7 +361,7 @@ class CustomRequestPanel extends Component { module.exports = connect( state => ({ request: getSelectedRequest(state) }), - (dispatch, props) => ({ + dispatch => ({ removeSelectedCustomRequest: () => dispatch(Actions.removeSelectedCustomRequest()), sendCustomRequest: () => dispatch(Actions.sendCustomRequest()), diff --git a/devtools/client/netmonitor/src/components/StatisticsPanel.js b/devtools/client/netmonitor/src/components/StatisticsPanel.js index e3d6787819..d7b2fb9ddf 100644 --- a/devtools/client/netmonitor/src/components/StatisticsPanel.js +++ b/devtools/client/netmonitor/src/components/StatisticsPanel.js @@ -108,7 +108,7 @@ class StatisticsPanel extends Component { }); } - componentDidUpdate(prevProps) { + componentDidUpdate() { MediaQueryList.addListener(this.onLayoutChange); const { hasLoad, requests } = this.props; diff --git a/devtools/client/netmonitor/src/components/Toolbar.js b/devtools/client/netmonitor/src/components/Toolbar.js index 0da3d826c2..d48d96b846 100644 --- a/devtools/client/netmonitor/src/components/Toolbar.js +++ b/devtools/client/netmonitor/src/components/Toolbar.js @@ -336,7 +336,7 @@ class Toolbar extends Component { /** * Render a blocking button. */ - renderBlockingButton(toggleSearchPanel) { + renderBlockingButton() { const { networkActionBarOpen, toggleRequestBlockingPanel, diff --git a/devtools/client/netmonitor/src/components/new-request/HTTPCustomRequestPanel.js b/devtools/client/netmonitor/src/components/new-request/HTTPCustomRequestPanel.js index 826f0317ba..1894f1be04 100644 --- a/devtools/client/netmonitor/src/components/new-request/HTTPCustomRequestPanel.js +++ b/devtools/client/netmonitor/src/components/new-request/HTTPCustomRequestPanel.js @@ -476,12 +476,12 @@ class HTTPCustomRequestPanel extends Component { url: this.state.url, cause: this.props.request?.cause, urlQueryParams: this.state.urlQueryParams.map( - ({ checked, ...params }) => params + ({ ...params }) => params ), requestHeaders: { headers: this.state.headers .filter(({ checked }) => checked) - .map(({ checked, ...headersValues }) => headersValues), + .map(({ ...headersValues }) => headersValues), }, }; @@ -504,7 +504,7 @@ class HTTPCustomRequestPanel extends Component { module.exports = connect( state => ({ request: getClickedRequest(state) }), - (dispatch, props) => ({ + dispatch => ({ sendCustomRequest: request => dispatch(Actions.sendHTTPCustomRequest(request)), }) diff --git a/devtools/client/netmonitor/src/components/request-details/HeadersPanel.js b/devtools/client/netmonitor/src/components/request-details/HeadersPanel.js index 09226b72c5..5b8822d53b 100644 --- a/devtools/client/netmonitor/src/components/request-details/HeadersPanel.js +++ b/devtools/client/netmonitor/src/components/request-details/HeadersPanel.js @@ -907,7 +907,7 @@ module.exports = connect( state => ({ shouldExpandPreview: state.ui.shouldExpandHeadersUrlPreview, }), - (dispatch, props) => ({ + dispatch => ({ setHeadersUrlPreviewExpanded: expanded => dispatch(Actions.setHeadersUrlPreviewExpanded(expanded)), openRequestBlockingAndAddUrl: url => diff --git a/devtools/client/netmonitor/src/components/request-details/ResponsePanel.js b/devtools/client/netmonitor/src/components/request-details/ResponsePanel.js index ac4435ea1d..d222f7bc5e 100644 --- a/devtools/client/netmonitor/src/components/request-details/ResponsePanel.js +++ b/devtools/client/netmonitor/src/components/request-details/ResponsePanel.js @@ -228,7 +228,7 @@ class ResponsePanel extends Component { image: "", priority: PriorityLevels.PRIORITY_INFO_HIGH, type: "info", - eventCallback: e => {}, + eventCallback: () => {}, buttons: [ { mdnUrl: getCORSErrorURL(blockedReason), @@ -394,7 +394,7 @@ class ResponsePanel extends Component { image: "", priority: PriorityLevels.PRIORITY_INFO_MEDIUM, type: "info", - eventCallback: e => {}, + eventCallback: () => {}, buttons: [], }); diff --git a/devtools/client/netmonitor/src/components/request-details/TimingsPanel.js b/devtools/client/netmonitor/src/components/request-details/TimingsPanel.js index 6cba22fa71..8452e0ecb9 100644 --- a/devtools/client/netmonitor/src/components/request-details/TimingsPanel.js +++ b/devtools/client/netmonitor/src/components/request-details/TimingsPanel.js @@ -78,7 +78,7 @@ class TimingsPanel extends Component { { className: "label-separator" }, L10N.getStr("netmonitor.timings.serviceWorkerTiming") ), - Object.entries(serviceWorkerTimings).map(([key, value], index) => { + Object.entries(serviceWorkerTimings).map(([key, value]) => { if (preValue > 0) { offset += preValue / totalTime; } diff --git a/devtools/client/netmonitor/src/connector/firefox-data-provider.js b/devtools/client/netmonitor/src/connector/firefox-data-provider.js index 9cdf6fc1d7..ea3cf9cd83 100644 --- a/devtools/client/netmonitor/src/connector/firefox-data-provider.js +++ b/devtools/client/netmonitor/src/connector/firefox-data-provider.js @@ -460,7 +460,7 @@ class FirefoxDataProvider { * @param {string} protocols webSocket protocols * @param {string} extensions */ - async onWebSocketOpened(httpChannelId, effectiveURI, protocols, extensions) {} + async onWebSocketOpened() {} /** * The "webSocketClosed" message type handler. diff --git a/devtools/client/netmonitor/src/har/har-automation.js b/devtools/client/netmonitor/src/har/har-automation.js index b3c4153d1e..f798b2965f 100644 --- a/devtools/client/netmonitor/src/har/har-automation.js +++ b/devtools/client/netmonitor/src/har/har-automation.js @@ -21,7 +21,7 @@ const prefDomain = "devtools.netmonitor.har."; // Helper tracer. Should be generic sharable by other modules (bug 1171927) const trace = { - log(...args) {}, + log() {}, }; /** @@ -88,7 +88,7 @@ HarAutomation.prototype = { ); }, - pageLoadBegin(response) { + pageLoadBegin() { this.resetCollector(); }, @@ -120,7 +120,7 @@ HarAutomation.prototype = { trace.log("HarAutomation.pageLoadDone; ", response); if (this.collector) { - this.collector.waitForHarLoad().then(collector => { + this.collector.waitForHarLoad().then(() => { return this.autoExport(); }); } diff --git a/devtools/client/netmonitor/src/har/har-builder.js b/devtools/client/netmonitor/src/har/har-builder.js index 8f1a9095c7..ee281e20f6 100644 --- a/devtools/client/netmonitor/src/har/har-builder.js +++ b/devtools/client/netmonitor/src/har/har-builder.js @@ -208,7 +208,7 @@ HarBuilder.prototype = { return entry; }, - buildPageTimings(page, networkEvent) { + buildPageTimings() { // Event timing info isn't available const timings = { onContentLoad: -1, diff --git a/devtools/client/netmonitor/src/har/har-collector.js b/devtools/client/netmonitor/src/har/har-collector.js index c5a4ae959d..c02669be6e 100644 --- a/devtools/client/netmonitor/src/har/har-collector.js +++ b/devtools/client/netmonitor/src/har/har-collector.js @@ -10,7 +10,7 @@ const { // Helper tracer. Should be generic sharable by other modules (bug 1171927) const trace = { - log(...args) {}, + log() {}, }; /** diff --git a/devtools/client/netmonitor/src/har/har-exporter.js b/devtools/client/netmonitor/src/har/har-exporter.js index fb401c2737..9204e98994 100644 --- a/devtools/client/netmonitor/src/har/har-exporter.js +++ b/devtools/client/netmonitor/src/har/har-exporter.js @@ -18,7 +18,7 @@ var uid = 1; // Helper tracer. Should be generic sharable by other modules (bug 1171927) const trace = { - log(...args) {}, + log() {}, }; /** diff --git a/devtools/client/netmonitor/src/har/har-menu-utils.js b/devtools/client/netmonitor/src/har/har-menu-utils.js index 756d9d9f96..7fb9f7aee7 100644 --- a/devtools/client/netmonitor/src/har/har-menu-utils.js +++ b/devtools/client/netmonitor/src/har/har-menu-utils.js @@ -57,7 +57,7 @@ var HarMenuUtils = { openHarFile(actions, openSplitConsole) { const fp = Cc["@mozilla.org/filepicker;1"].createInstance(Ci.nsIFilePicker); fp.init( - window, + window.browsingContext, L10N.getStr("netmonitor.har.importHarDialogTitle"), Ci.nsIFilePicker.modeOpen ); diff --git a/devtools/client/netmonitor/src/har/test/browser.toml b/devtools/client/netmonitor/src/har/test/browser.toml index 7a11328f5a..6964b542dd 100644 --- a/devtools/client/netmonitor/src/har/test/browser.toml +++ b/devtools/client/netmonitor/src/har/test/browser.toml @@ -21,8 +21,9 @@ support-files = [ ["browser_net_har_copy_all_as_har.js"] skip-if = [ - "!debug && os == 'mac'", #Bug 1622925 - "!debug && os == 'linux'", #Bug 1622925 + "apple_catalina && !debug", #Bug 1622925 + "apple_silicon && !debug", #Bug 1622925 + "os == 'linux' && os_version == '18.04' && !debug", #Bug 1622925 "win11_2009", # Bug 1797751 ] diff --git a/devtools/client/netmonitor/src/har/test/browser_net_har_copy_all_as_har.js b/devtools/client/netmonitor/src/har/test/browser_net_har_copy_all_as_har.js index bcbb4bef2a..2faaf01b73 100644 --- a/devtools/client/netmonitor/src/har/test/browser_net_har_copy_all_as_har.js +++ b/devtools/client/netmonitor/src/har/test/browser_net_har_copy_all_as_har.js @@ -111,7 +111,7 @@ async function testManyReloads({ tab, monitor, toolbox }) { assertNavigationRequestEntry(entry); } -async function testClearedRequests({ tab, monitor, toolbox }) { +async function testClearedRequests({ tab, monitor }) { info("Navigate to an empty page"); const topDocumentURL = "https://example.org/document-builder.sjs?html=empty-document"; @@ -196,7 +196,6 @@ function assertNavigationRequestEntry(entry) { * Reload the page and copy all as HAR. */ async function reloadAndCopyAllAsHar({ - tab, monitor, toolbox, reloadTwice = false, diff --git a/devtools/client/netmonitor/src/har/test/html_har_post-data-test-page.html b/devtools/client/netmonitor/src/har/test/html_har_post-data-test-page.html index 5e42c6139d..9be2e3c16a 100644 --- a/devtools/client/netmonitor/src/har/test/html_har_post-data-test-page.html +++ b/devtools/client/netmonitor/src/har/test/html_har_post-data-test-page.html @@ -44,7 +44,7 @@ post(url, data); } - function executeTest3(size) { + function executeTest3() { const url = "html_har_post-data-test-page.html"; get(url); } diff --git a/devtools/client/netmonitor/src/middleware/batching.js b/devtools/client/netmonitor/src/middleware/batching.js index 9d8c57084c..c546cc2e22 100644 --- a/devtools/client/netmonitor/src/middleware/batching.js +++ b/devtools/client/netmonitor/src/middleware/batching.js @@ -20,7 +20,7 @@ const REQUESTS_REFRESH_RATE = 50; // ms * - BATCH_ENABLE can be used to enable and disable the batching. * - BATCH_RESET discards the actions that are currently in the queue. */ -function batchingMiddleware(store) { +function batchingMiddleware() { return next => { let queuedActions = []; let enabled = true; diff --git a/devtools/client/netmonitor/src/middleware/prefs.js b/devtools/client/netmonitor/src/middleware/prefs.js index 6034a95dbf..2ccbb4db3c 100644 --- a/devtools/client/netmonitor/src/middleware/prefs.js +++ b/devtools/client/netmonitor/src/middleware/prefs.js @@ -30,8 +30,8 @@ function prefsMiddleware(store) { const filters = Object.entries( store.getState().filters.requestFilterTypes ) - .filter(([type, check]) => check) - .map(([type, check]) => type); + .filter(([, check]) => check) + .map(([type]) => type); Services.prefs.setCharPref( "devtools.netmonitor.filters", JSON.stringify(filters) diff --git a/devtools/client/netmonitor/src/middleware/throttling.js b/devtools/client/netmonitor/src/middleware/throttling.js index 30f5a9b5f4..ac72b556bb 100644 --- a/devtools/client/netmonitor/src/middleware/throttling.js +++ b/devtools/client/netmonitor/src/middleware/throttling.js @@ -14,7 +14,7 @@ const { * according to user actions. */ function throttlingMiddleware(connector) { - return store => next => action => { + return () => next => action => { const res = next(action); if (action.type === CHANGE_NETWORK_THROTTLING) { connector.updateNetworkThrottling(action.enabled, action.profile); diff --git a/devtools/client/netmonitor/src/reducers/messages.js b/devtools/client/netmonitor/src/reducers/messages.js index 27d7da28c7..cb21a08b91 100644 --- a/devtools/client/netmonitor/src/reducers/messages.js +++ b/devtools/client/netmonitor/src/reducers/messages.js @@ -208,7 +208,7 @@ function toggleMessageFilterType(state, action) { /** * Toggle control frames for the WebSocket connection. */ -function toggleControlFrames(state, action) { +function toggleControlFrames(state) { return { ...state, showControlFrames: !state.showControlFrames, diff --git a/devtools/client/netmonitor/src/reducers/request-blocking.js b/devtools/client/netmonitor/src/reducers/request-blocking.js index ffd0d8c97a..18dbe574f8 100644 --- a/devtools/client/netmonitor/src/reducers/request-blocking.js +++ b/devtools/client/netmonitor/src/reducers/request-blocking.js @@ -99,14 +99,14 @@ function removeBlockedUrl(state, action) { }; } -function removeAllBlockedUrls(state, action) { +function removeAllBlockedUrls(state) { return { ...state, blockedUrls: [], }; } -function enableAllBlockedUrls(state, action) { +function enableAllBlockedUrls(state) { const blockedUrls = state.blockedUrls.map(item => ({ ...item, enabled: true, @@ -117,7 +117,7 @@ function enableAllBlockedUrls(state, action) { }; } -function disableAllBlockedUrls(state, action) { +function disableAllBlockedUrls(state) { const blockedUrls = state.blockedUrls.map(item => ({ ...item, enabled: false, diff --git a/devtools/client/netmonitor/src/reducers/timing-markers.js b/devtools/client/netmonitor/src/reducers/timing-markers.js index 4a41f9b495..1b63674833 100644 --- a/devtools/client/netmonitor/src/reducers/timing-markers.js +++ b/devtools/client/netmonitor/src/reducers/timing-markers.js @@ -51,7 +51,7 @@ function addTimingMarker(state, action) { return state; } -function clearTimingMarkers(state) { +function clearTimingMarkers() { return new TimingMarkers(); } diff --git a/devtools/client/netmonitor/src/utils/context-menu-utils.js b/devtools/client/netmonitor/src/utils/context-menu-utils.js index 3b44ff20cc..2643913d11 100644 --- a/devtools/client/netmonitor/src/utils/context-menu-utils.js +++ b/devtools/client/netmonitor/src/utils/context-menu-utils.js @@ -8,7 +8,7 @@ * The default format for the content copied to the * clipboard when the `Copy Value` option is selected. */ -function baseCopyFormatter({ name, value, object, hasChildren }) { +function baseCopyFormatter({ name, value, hasChildren }) { if (hasChildren) { return baseCopyAllFormatter({ [name]: value }); } diff --git a/devtools/client/netmonitor/src/widgets/WaterfallBackground.js b/devtools/client/netmonitor/src/widgets/WaterfallBackground.js index e2be7f5715..807b5a25b6 100644 --- a/devtools/client/netmonitor/src/widgets/WaterfallBackground.js +++ b/devtools/client/netmonitor/src/widgets/WaterfallBackground.js @@ -133,7 +133,11 @@ class WaterfallBackground { // Flush the image data and cache the waterfall background. pixelArray.set(view8bit); - this.ctx.putImageData(imageData, 0, 0); + try { + this.ctx.putImageData(imageData, 0, 0); + } catch (e) { + console.error("WaterfallBackground crash error", e); + } this.setImageElement("waterfall-background", this.canvas); } diff --git a/devtools/client/netmonitor/test/browser.toml b/devtools/client/netmonitor/test/browser.toml index 00f6ac2068..186810de06 100644 --- a/devtools/client/netmonitor/test/browser.toml +++ b/devtools/client/netmonitor/test/browser.toml @@ -124,9 +124,11 @@ fail-if = ["a11y_checks"] # Bug 1849028 clicked element may not be focusable and ["browser_net_block-pattern.js"] skip-if = [ - "os == 'linux'", - "debug && os == 'win'", # Bug 1603355 - "debug && os == 'mac'", # Bug 1603355 + "os == 'linux' && os_version == '18.04'", + "win11_2009 && debug", # Bug 1603355 + "win10_2009 && debug", # Bug 1603355 + "apple_catalina && debug", # Bug 1603355 + "apple_silicon && debug", # Bug 1603355 ] ["browser_net_block-serviceworker.js"] @@ -184,15 +186,17 @@ skip-if = [ ["browser_net_complex-params.js"] skip-if = [ - "verify && !debug && os == 'win'", "win11_2009", # Bug 1797751 ] ["browser_net_content-type.js"] -skip-if = ["!debug && os == 'mac'"] +skip-if = [ + "apple_catalina && !debug", + "apple_silicon && !debug", +] ["browser_net_cookies_sorted.js"] -skip-if = ["verify && debug && os == 'win'"] +skip-if = ["win11_2009 && debug && verify"] ["browser_net_copy_as_curl.js"] @@ -207,7 +211,8 @@ skip-if = ["verify && debug && os == 'win'"] ["browser_net_copy_params.js"] skip-if = [ "win11_2009", # Bug 1797751 - "verify && !debug && os == 'mac'", # bug 1328915, disable linux32 debug devtools for timeouts + "apple_catalina && !debug && verify", # bug 1328915 + "apple_silicon && !debug && verify", # bug 1328915 ] ["browser_net_copy_response.js"] @@ -361,7 +366,7 @@ skip-if = ["!fission"] ["browser_net_params_sorted.js"] ["browser_net_pause.js"] -skip-if = ["verify && debug && os == 'win'"] +skip-if = ["win11_2009 && debug && verify"] ["browser_net_persistent_logs.js"] skip-if = ["true"] #Bug 1661612 @@ -377,7 +382,10 @@ skip-if = ["true"] #Bug 1661612 ["browser_net_prefs-and-l10n.js"] ["browser_net_prefs-reload.js"] -skip-if = ["os == 'win'"] # bug 1391264 +skip-if = [ + "win10_2009", # bug 1391264 + "win11_2009", # bug 1391264 +] ["browser_net_raw_headers.js"] @@ -398,7 +406,7 @@ skip-if = ["os == 'win'"] # bug 1391264 ["browser_net_resend_xhr.js"] ["browser_net_response_CORS_blocked.js"] -skip-if = ["a11y_checks && os == 'linux' && !debug"] # bug 1732635 +skip-if = ["os == 'linux' && os_version == '18.04' && !debug && a11y_checks"] # bug 1732635 ["browser_net_response_node-expanded.js"] fail-if = ["a11y_checks"] # Bug 1849028 clicked element may not be focusable and/or labeled @@ -406,7 +414,7 @@ fail-if = ["a11y_checks"] # Bug 1849028 clicked element may not be focusable and ["browser_net_save_response_as.js"] ["browser_net_search-results.js"] -skip-if = ["os == 'linux' && a11y_checks"] # Bug 1721160 +skip-if = ["os == 'linux' && os_version == '18.04' && a11y_checks"] # Bug 1721160 ["browser_net_security-details.js"] @@ -433,7 +441,7 @@ fail-if = ["a11y_checks"] # Bug 1849028 clicked element may not be focusable and fail-if = ["a11y_checks"] # Bug 1849028 clicked element may not be focusable and/or labeled ["browser_net_service-worker-status.js"] -skip-if = ["verify && !debug && os == 'linux'"] +skip-if = ["os == 'linux' && os_version == '18.04' && !debug && verify"] ["browser_net_service-worker-timings.js"] fail-if = ["a11y_checks"] # Bug 1849028 clicked element may not be focusable and/or labeled diff --git a/devtools/client/netmonitor/test/browser_net_cached-status.js b/devtools/client/netmonitor/test/browser_net_cached-status.js index 77346e6842..b41362b398 100644 --- a/devtools/client/netmonitor/test/browser_net_cached-status.js +++ b/devtools/client/netmonitor/test/browser_net_cached-status.js @@ -94,7 +94,7 @@ add_task(async function () { // that the NS_BINDING_ABORTED status is never displayed for cached requests. const observer = { QueryInterface: ChromeUtils.generateQI(["nsIObserver"]), - observe(subject, topic, data) { + observe(subject) { subject = subject.QueryInterface(Ci.nsIHttpChannel); if (subject.URI.spec == STATUS_CODES_SJS + "?sts=ok&cached") { subject.cancel(Cr.NS_BINDING_ABORTED); diff --git a/devtools/client/netmonitor/test/browser_net_curl-utils.js b/devtools/client/netmonitor/test/browser_net_curl-utils.js index 32b7aca316..cdf64ad5f9 100644 --- a/devtools/client/netmonitor/test/browser_net_curl-utils.js +++ b/devtools/client/netmonitor/test/browser_net_curl-utils.js @@ -139,7 +139,7 @@ function testWritePostDataTextParams(data) { ); } -function testWriteEmptyPostDataTextParams(data) { +function testWriteEmptyPostDataTextParams() { const params = CurlUtils.writePostDataTextParams(null); is(params, "", "Should return a empty string when no parameters provided"); } diff --git a/devtools/client/netmonitor/test/browser_net_header-docs.js b/devtools/client/netmonitor/test/browser_net_header-docs.js index 91d2794d5f..e4cdcb5c61 100644 --- a/devtools/client/netmonitor/test/browser_net_header-docs.js +++ b/devtools/client/netmonitor/test/browser_net_header-docs.js @@ -48,9 +48,9 @@ add_task(async function () { * Tests that a "Learn More" button is only shown if * and only if a header is documented in MDN. */ - function testShowLearnMore(data) { + function testShowLearnMore() { const selector = ".properties-view .treeRow.stringRow"; - document.querySelectorAll(selector).forEach((rowEl, index) => { + document.querySelectorAll(selector).forEach(rowEl => { const headerName = rowEl.querySelectorAll(".treeLabelCell .treeLabel")[0] .textContent; const headerDocURL = getHeadersURL(headerName); diff --git a/devtools/client/netmonitor/test/browser_net_prefs-reload.js b/devtools/client/netmonitor/test/browser_net_prefs-reload.js index 523c4dc805..42c90a2f25 100644 --- a/devtools/client/netmonitor/test/browser_net_prefs-reload.js +++ b/devtools/client/netmonitor/test/browser_net_prefs-reload.js @@ -36,8 +36,8 @@ add_task(async function () { // to verify that the pref was applied properly. validateValue: () => Object.entries(getState().filters.requestFilterTypes) - .filter(([type, check]) => check) - .map(([type, check]) => type), + .filter(([, check]) => check) + .map(([type]) => type), // Predicate used to modify the frontend when setting the new pref value, // before trying to validate the changes. modifyFrontend: value => diff --git a/devtools/client/netmonitor/test/browser_net_save_response_as.js b/devtools/client/netmonitor/test/browser_net_save_response_as.js index e8e3918ecb..638fb50794 100644 --- a/devtools/client/netmonitor/test/browser_net_save_response_as.js +++ b/devtools/client/netmonitor/test/browser_net_save_response_as.js @@ -4,7 +4,7 @@ "use strict"; var MockFilePicker = SpecialPowers.MockFilePicker; -MockFilePicker.init(window); +MockFilePicker.init(window.browsingContext); /** * Tests if saving a response to a file works.. diff --git a/devtools/client/netmonitor/test/browser_net_simple-request-data.js b/devtools/client/netmonitor/test/browser_net_simple-request-data.js index 7b112ef7d8..450313a4c9 100644 --- a/devtools/client/netmonitor/test/browser_net_simple-request-data.js +++ b/devtools/client/netmonitor/test/browser_net_simple-request-data.js @@ -17,72 +17,67 @@ function test() { L10N, } = require("resource://devtools/client/netmonitor/src/utils/l10n.js"); - initNetMonitor(SIMPLE_SJS, { requestCount: 1 }).then( - async ({ tab, monitor }) => { - info("Starting test... "); - - const { document, store, windowRequire, connector } = monitor.panelWin; - const { EVENTS, TEST_EVENTS } = windowRequire( - "devtools/client/netmonitor/src/constants" - ); - const { getDisplayedRequests, getSelectedRequest, getSortedRequests } = - windowRequire("devtools/client/netmonitor/src/selectors/index"); - - const promiseList = []; - promiseList.push(waitForNetworkEvents(monitor, 1)); - - function expectEvent(evt, cb) { - promiseList.push( - new Promise((resolve, reject) => { - monitor.panelWin.api.once(evt, _ => { - cb().then(resolve, reject); - }); - }) - ); - } + initNetMonitor(SIMPLE_SJS, { requestCount: 1 }).then(async ({ monitor }) => { + info("Starting test... "); + + const { document, store, windowRequire, connector } = monitor.panelWin; + const { EVENTS, TEST_EVENTS } = windowRequire( + "devtools/client/netmonitor/src/constants" + ); + const { getDisplayedRequests, getSelectedRequest, getSortedRequests } = + windowRequire("devtools/client/netmonitor/src/selectors/index"); + + const promiseList = []; + promiseList.push(waitForNetworkEvents(monitor, 1)); + + function expectEvent(evt, cb) { + promiseList.push( + new Promise((resolve, reject) => { + monitor.panelWin.api.once(evt, _ => { + cb().then(resolve, reject); + }); + }) + ); + } - expectEvent(TEST_EVENTS.NETWORK_EVENT, async () => { - is( - getSelectedRequest(store.getState()), - undefined, - "There shouldn't be any selected item in the requests menu." - ); - is( - store.getState().requests.requests.length, - 1, - "The requests menu should not be empty after the first request." - ); - is( - !!document.querySelector(".network-details-bar"), - false, - "The network details panel should still be hidden after first request." - ); + expectEvent(TEST_EVENTS.NETWORK_EVENT, async () => { + is( + getSelectedRequest(store.getState()), + undefined, + "There shouldn't be any selected item in the requests menu." + ); + is( + store.getState().requests.requests.length, + 1, + "The requests menu should not be empty after the first request." + ); + is( + !!document.querySelector(".network-details-bar"), + false, + "The network details panel should still be hidden after first request." + ); - const requestItem = getSortedRequests(store.getState())[0]; + const requestItem = getSortedRequests(store.getState())[0]; - is( - typeof requestItem.id, - "string", - "The attached request id is incorrect." - ); - isnot( - requestItem.id, - "", - "The attached request id should not be empty." - ); + is( + typeof requestItem.id, + "string", + "The attached request id is incorrect." + ); + isnot(requestItem.id, "", "The attached request id should not be empty."); - is( - typeof requestItem.startedMs, - "number", - "The attached startedMs is incorrect." - ); - isnot( - requestItem.startedMs, - 0, - "The attached startedMs should not be zero." - ); + is( + typeof requestItem.startedMs, + "number", + "The attached startedMs is incorrect." + ); + isnot( + requestItem.startedMs, + 0, + "The attached startedMs should not be zero." + ); - /* + /* * Bug 1666495: this is not possible to assert not yet set attributes * because of throttling, which only updates the frontend after a few attributes * are already retrieved via onResourceUpdates events. @@ -162,328 +157,319 @@ function test() { ); */ - verifyRequestItemTarget( - document, - getDisplayedRequests(store.getState()), - requestItem, - "GET", - SIMPLE_SJS - ); - }); - - expectEvent(TEST_EVENTS.RECEIVED_REQUEST_HEADERS, async () => { - await waitForRequestData(store, ["requestHeaders"]); - - const requestItem = getSortedRequests(store.getState())[0]; + verifyRequestItemTarget( + document, + getDisplayedRequests(store.getState()), + requestItem, + "GET", + SIMPLE_SJS + ); + }); - ok( - requestItem.requestHeaders, - "There should be a requestHeaders data available." - ); - is( - requestItem.requestHeaders.headers.length, - 10, - "The requestHeaders data has an incorrect |headers| property." - ); - isnot( - requestItem.requestHeaders.headersSize, - 0, - "The requestHeaders data has an incorrect |headersSize| property." - ); - // Can't test for the exact request headers size because the value may - // vary across platforms ("User-Agent" header differs). - - verifyRequestItemTarget( - document, - getDisplayedRequests(store.getState()), - requestItem, - "GET", - SIMPLE_SJS - ); - }); + expectEvent(TEST_EVENTS.RECEIVED_REQUEST_HEADERS, async () => { + await waitForRequestData(store, ["requestHeaders"]); - expectEvent(TEST_EVENTS.RECEIVED_REQUEST_COOKIES, async () => { - await waitForRequestData(store, ["requestCookies"]); + const requestItem = getSortedRequests(store.getState())[0]; - const requestItem = getSortedRequests(store.getState())[0]; + ok( + requestItem.requestHeaders, + "There should be a requestHeaders data available." + ); + is( + requestItem.requestHeaders.headers.length, + 10, + "The requestHeaders data has an incorrect |headers| property." + ); + isnot( + requestItem.requestHeaders.headersSize, + 0, + "The requestHeaders data has an incorrect |headersSize| property." + ); + // Can't test for the exact request headers size because the value may + // vary across platforms ("User-Agent" header differs). + + verifyRequestItemTarget( + document, + getDisplayedRequests(store.getState()), + requestItem, + "GET", + SIMPLE_SJS + ); + }); - ok( - requestItem.requestCookies, - "There should be a requestCookies data available." - ); - is( - requestItem.requestCookies.length, - 2, - "The requestCookies data has an incorrect |cookies| property." - ); + expectEvent(TEST_EVENTS.RECEIVED_REQUEST_COOKIES, async () => { + await waitForRequestData(store, ["requestCookies"]); - verifyRequestItemTarget( - document, - getDisplayedRequests(store.getState()), - requestItem, - "GET", - SIMPLE_SJS - ); - }); + const requestItem = getSortedRequests(store.getState())[0]; - monitor.panelWin.api.once(TEST_EVENTS.RECEIVED_REQUEST_POST_DATA, () => { - ok(false, "Trap listener: this request doesn't have any post data."); - }); + ok( + requestItem.requestCookies, + "There should be a requestCookies data available." + ); + is( + requestItem.requestCookies.length, + 2, + "The requestCookies data has an incorrect |cookies| property." + ); - expectEvent(TEST_EVENTS.RECEIVED_RESPONSE_HEADERS, async () => { - await waitForRequestData(store, ["responseHeaders"]); + verifyRequestItemTarget( + document, + getDisplayedRequests(store.getState()), + requestItem, + "GET", + SIMPLE_SJS + ); + }); - const requestItem = getSortedRequests(store.getState())[0]; + monitor.panelWin.api.once(TEST_EVENTS.RECEIVED_REQUEST_POST_DATA, () => { + ok(false, "Trap listener: this request doesn't have any post data."); + }); - ok( - requestItem.responseHeaders, - "There should be a responseHeaders data available." - ); - is( - requestItem.responseHeaders.headers.length, - 13, - "The responseHeaders data has an incorrect |headers| property." - ); - is( - requestItem.responseHeaders.headersSize, - 335, - "The responseHeaders data has an incorrect |headersSize| property." - ); + expectEvent(TEST_EVENTS.RECEIVED_RESPONSE_HEADERS, async () => { + await waitForRequestData(store, ["responseHeaders"]); - verifyRequestItemTarget( - document, - getDisplayedRequests(store.getState()), - requestItem, - "GET", - SIMPLE_SJS - ); - }); + const requestItem = getSortedRequests(store.getState())[0]; - expectEvent(TEST_EVENTS.RECEIVED_RESPONSE_COOKIES, async () => { - await waitForRequestData(store, ["responseCookies"]); + ok( + requestItem.responseHeaders, + "There should be a responseHeaders data available." + ); + is( + requestItem.responseHeaders.headers.length, + 13, + "The responseHeaders data has an incorrect |headers| property." + ); + is( + requestItem.responseHeaders.headersSize, + 335, + "The responseHeaders data has an incorrect |headersSize| property." + ); - const requestItem = getSortedRequests(store.getState())[0]; + verifyRequestItemTarget( + document, + getDisplayedRequests(store.getState()), + requestItem, + "GET", + SIMPLE_SJS + ); + }); - ok( - requestItem.responseCookies, - "There should be a responseCookies data available." - ); - is( - requestItem.responseCookies.length, - 2, - "The responseCookies data has an incorrect |cookies| property." - ); + expectEvent(TEST_EVENTS.RECEIVED_RESPONSE_COOKIES, async () => { + await waitForRequestData(store, ["responseCookies"]); - verifyRequestItemTarget( - document, - getDisplayedRequests(store.getState()), - requestItem, - "GET", - SIMPLE_SJS - ); - }); + const requestItem = getSortedRequests(store.getState())[0]; - expectEvent(TEST_EVENTS.STARTED_RECEIVING_RESPONSE, async () => { - await waitForRequestData(store, [ - "httpVersion", - "status", - "statusText", - "headersSize", - ]); + ok( + requestItem.responseCookies, + "There should be a responseCookies data available." + ); + is( + requestItem.responseCookies.length, + 2, + "The responseCookies data has an incorrect |cookies| property." + ); - const requestItem = getSortedRequests(store.getState())[0]; + verifyRequestItemTarget( + document, + getDisplayedRequests(store.getState()), + requestItem, + "GET", + SIMPLE_SJS + ); + }); - is( - requestItem.httpVersion, - "HTTP/1.1", - "The httpVersion data has an incorrect value." - ); - is( - requestItem.status, - "200", - "The status data has an incorrect value." - ); - is( - requestItem.statusText, - "Och Aye", - "The statusText data has an incorrect value." - ); - is( - requestItem.headersSize, - 335, - "The headersSize data has an incorrect value." - ); + expectEvent(TEST_EVENTS.STARTED_RECEIVING_RESPONSE, async () => { + await waitForRequestData(store, [ + "httpVersion", + "status", + "statusText", + "headersSize", + ]); - const requestListItem = document.querySelector(".request-list-item"); - requestListItem.scrollIntoView(); - const requestsListStatus = - requestListItem.querySelector(".status-code"); - EventUtils.sendMouseEvent({ type: "mouseover" }, requestsListStatus); - await waitUntil(() => requestsListStatus.title); - await waitForDOMIfNeeded( - requestListItem, - ".requests-list-timings-total" - ); + const requestItem = getSortedRequests(store.getState())[0]; - verifyRequestItemTarget( - document, - getDisplayedRequests(store.getState()), - requestItem, - "GET", - SIMPLE_SJS, - { - status: "200", - statusText: "Och Aye", - } - ); - }); + is( + requestItem.httpVersion, + "HTTP/1.1", + "The httpVersion data has an incorrect value." + ); + is(requestItem.status, "200", "The status data has an incorrect value."); + is( + requestItem.statusText, + "Och Aye", + "The statusText data has an incorrect value." + ); + is( + requestItem.headersSize, + 335, + "The headersSize data has an incorrect value." + ); - expectEvent(EVENTS.PAYLOAD_READY, async () => { - await waitForRequestData(store, [ - "transferredSize", - "contentSize", - "mimeType", - ]); + const requestListItem = document.querySelector(".request-list-item"); + requestListItem.scrollIntoView(); + const requestsListStatus = requestListItem.querySelector(".status-code"); + EventUtils.sendMouseEvent({ type: "mouseover" }, requestsListStatus); + await waitUntil(() => requestsListStatus.title); + await waitForDOMIfNeeded(requestListItem, ".requests-list-timings-total"); + + verifyRequestItemTarget( + document, + getDisplayedRequests(store.getState()), + requestItem, + "GET", + SIMPLE_SJS, + { + status: "200", + statusText: "Och Aye", + } + ); + }); - const requestItem = getSortedRequests(store.getState())[0]; + expectEvent(EVENTS.PAYLOAD_READY, async () => { + await waitForRequestData(store, [ + "transferredSize", + "contentSize", + "mimeType", + ]); - is( - requestItem.transferredSize, - 347, - "The transferredSize data has an incorrect value." - ); - is( - requestItem.contentSize, - 12, - "The contentSize data has an incorrect value." - ); - is( - requestItem.mimeType, - "text/plain; charset=utf-8", - "The mimeType data has an incorrect value." - ); + const requestItem = getSortedRequests(store.getState())[0]; - verifyRequestItemTarget( - document, - getDisplayedRequests(store.getState()), - requestItem, - "GET", - SIMPLE_SJS, - { - type: "plain", - fullMimeType: "text/plain; charset=utf-8", - transferred: L10N.getFormatStrWithNumbers("networkMenu.sizeB", 347), - size: L10N.getFormatStrWithNumbers("networkMenu.sizeB", 12), - } - ); - }); + is( + requestItem.transferredSize, + 347, + "The transferredSize data has an incorrect value." + ); + is( + requestItem.contentSize, + 12, + "The contentSize data has an incorrect value." + ); + is( + requestItem.mimeType, + "text/plain; charset=utf-8", + "The mimeType data has an incorrect value." + ); - expectEvent(EVENTS.UPDATING_EVENT_TIMINGS, async () => { - await waitForRequestData(store, ["eventTimings"]); + verifyRequestItemTarget( + document, + getDisplayedRequests(store.getState()), + requestItem, + "GET", + SIMPLE_SJS, + { + type: "plain", + fullMimeType: "text/plain; charset=utf-8", + transferred: L10N.getFormatStrWithNumbers("networkMenu.sizeB", 347), + size: L10N.getFormatStrWithNumbers("networkMenu.sizeB", 12), + } + ); + }); - const requestItem = getSortedRequests(store.getState())[0]; + expectEvent(EVENTS.UPDATING_EVENT_TIMINGS, async () => { + await waitForRequestData(store, ["eventTimings"]); - is( - typeof requestItem.totalTime, - "number", - "The attached totalTime is incorrect." - ); - Assert.greaterOrEqual( - requestItem.totalTime, - 0, - "The attached totalTime should be positive." - ); + const requestItem = getSortedRequests(store.getState())[0]; - verifyRequestItemTarget( - document, - getDisplayedRequests(store.getState()), - requestItem, - "GET", - SIMPLE_SJS, - { - time: true, - } - ); - }); + is( + typeof requestItem.totalTime, + "number", + "The attached totalTime is incorrect." + ); + Assert.greaterOrEqual( + requestItem.totalTime, + 0, + "The attached totalTime should be positive." + ); - expectEvent(EVENTS.RECEIVED_EVENT_TIMINGS, async () => { - await waitForRequestData(store, ["eventTimings"]); + verifyRequestItemTarget( + document, + getDisplayedRequests(store.getState()), + requestItem, + "GET", + SIMPLE_SJS, + { + time: true, + } + ); + }); - const requestItem = getSortedRequests(store.getState())[0]; + expectEvent(EVENTS.RECEIVED_EVENT_TIMINGS, async () => { + await waitForRequestData(store, ["eventTimings"]); - ok( - requestItem.eventTimings, - "There should be a eventTimings data available." - ); - is( - typeof requestItem.eventTimings.timings.blocked, - "number", - "The eventTimings data has an incorrect |timings.blocked| property." - ); - is( - typeof requestItem.eventTimings.timings.dns, - "number", - "The eventTimings data has an incorrect |timings.dns| property." - ); - is( - typeof requestItem.eventTimings.timings.ssl, - "number", - "The eventTimings data has an incorrect |timings.ssl| property." - ); - is( - typeof requestItem.eventTimings.timings.connect, - "number", - "The eventTimings data has an incorrect |timings.connect| property." - ); - is( - typeof requestItem.eventTimings.timings.send, - "number", - "The eventTimings data has an incorrect |timings.send| property." - ); - is( - typeof requestItem.eventTimings.timings.wait, - "number", - "The eventTimings data has an incorrect |timings.wait| property." - ); - is( - typeof requestItem.eventTimings.timings.receive, - "number", - "The eventTimings data has an incorrect |timings.receive| property." - ); - is( - typeof requestItem.eventTimings.totalTime, - "number", - "The eventTimings data has an incorrect |totalTime| property." - ); + const requestItem = getSortedRequests(store.getState())[0]; - verifyRequestItemTarget( - document, - getDisplayedRequests(store.getState()), - requestItem, - "GET", - SIMPLE_SJS, - { - time: true, - } - ); - }); + ok( + requestItem.eventTimings, + "There should be a eventTimings data available." + ); + is( + typeof requestItem.eventTimings.timings.blocked, + "number", + "The eventTimings data has an incorrect |timings.blocked| property." + ); + is( + typeof requestItem.eventTimings.timings.dns, + "number", + "The eventTimings data has an incorrect |timings.dns| property." + ); + is( + typeof requestItem.eventTimings.timings.ssl, + "number", + "The eventTimings data has an incorrect |timings.ssl| property." + ); + is( + typeof requestItem.eventTimings.timings.connect, + "number", + "The eventTimings data has an incorrect |timings.connect| property." + ); + is( + typeof requestItem.eventTimings.timings.send, + "number", + "The eventTimings data has an incorrect |timings.send| property." + ); + is( + typeof requestItem.eventTimings.timings.wait, + "number", + "The eventTimings data has an incorrect |timings.wait| property." + ); + is( + typeof requestItem.eventTimings.timings.receive, + "number", + "The eventTimings data has an incorrect |timings.receive| property." + ); + is( + typeof requestItem.eventTimings.totalTime, + "number", + "The eventTimings data has an incorrect |totalTime| property." + ); - const wait = waitForNetworkEvents(monitor, 1); - await reloadBrowser(); - await wait; + verifyRequestItemTarget( + document, + getDisplayedRequests(store.getState()), + requestItem, + "GET", + SIMPLE_SJS, + { + time: true, + } + ); + }); - const requestItem = getSortedRequests(store.getState())[0]; + const wait = waitForNetworkEvents(monitor, 1); + await reloadBrowser(); + await wait; - if (!requestItem.requestHeaders) { - connector.requestData(requestItem.id, "requestHeaders"); - } - if (!requestItem.responseHeaders) { - connector.requestData(requestItem.id, "responseHeaders"); - } + const requestItem = getSortedRequests(store.getState())[0]; - await Promise.all(promiseList); - await teardown(monitor); - finish(); + if (!requestItem.requestHeaders) { + connector.requestData(requestItem.id, "requestHeaders"); } - ); + if (!requestItem.responseHeaders) { + connector.requestData(requestItem.id, "responseHeaders"); + } + + await Promise.all(promiseList); + await teardown(monitor); + finish(); + }); } diff --git a/devtools/client/netmonitor/test/head.js b/devtools/client/netmonitor/test/head.js index 5ca3466964..b171b51715 100644 --- a/devtools/client/netmonitor/test/head.js +++ b/devtools/client/netmonitor/test/head.js @@ -878,7 +878,7 @@ function testFilterButtonsCustom(monitor, isChecked) { * */ function promiseXHR(data) { - return new Promise((resolve, reject) => { + return new Promise(resolve => { const xhr = new content.XMLHttpRequest(); const method = data.method || "GET"; @@ -891,7 +891,7 @@ function promiseXHR(data) { xhr.addEventListener( "loadend", - function (event) { + function () { resolve({ status: xhr.status, response: xhr.response }); }, { once: true } @@ -925,7 +925,7 @@ function promiseXHR(data) { * */ function promiseWS(data) { - return new Promise((resolve, reject) => { + return new Promise(resolve => { let url = data.url; if (data.nocache) { @@ -936,7 +936,7 @@ function promiseWS(data) { const socket = new content.WebSocket(url); /* Since we only use HTTP server to mock websocket, so just ignore the error */ - socket.onclose = e => { + socket.onclose = () => { socket.close(); resolve({ status: 101, @@ -944,7 +944,7 @@ function promiseWS(data) { }); }; - socket.onerror = e => { + socket.onerror = () => { socket.close(); resolve({ status: 101, @@ -1156,7 +1156,11 @@ function checkTelemetryEvent(expectedEvent, query) { is(events.length, 1, "There was only 1 event logged"); const [event] = events; - ok(event.session_id > 0, "There is a valid session_id in the logged event"); + Assert.greater( + Number(event.session_id), + 0, + "There is a valid session_id in the logged event" + ); const f = e => JSON.stringify(e, null, 2); is( @@ -1391,7 +1395,7 @@ function clickElement(element, monitor) { * Target browser to observe the favicon load. */ function registerFaviconNotifier(browser) { - const listener = async (name, data) => { + const listener = async name => { if (name == "SetIcon" || name == "SetFailedIcon") { await SpecialPowers.spawn(browser, [], async () => { content.document diff --git a/devtools/client/netmonitor/test/html_custom-get-page.html b/devtools/client/netmonitor/test/html_custom-get-page.html index b44bf754a4..db4e45e81c 100644 --- a/devtools/client/netmonitor/test/html_custom-get-page.html +++ b/devtools/client/netmonitor/test/html_custom-get-page.html @@ -45,7 +45,7 @@ // For testing the offline mode in the netmonitor let isOfflineEventFired = false; - window.addEventListener("offline", (event) => { + window.addEventListener("offline", () => { isOfflineEventFired = true }, { once: true }); diff --git a/devtools/client/netmonitor/test/html_pause-test-page.html b/devtools/client/netmonitor/test/html_pause-test-page.html index a4ed668ce8..a093ae9c06 100644 --- a/devtools/client/netmonitor/test/html_pause-test-page.html +++ b/devtools/client/netmonitor/test/html_pause-test-page.html @@ -19,7 +19,7 @@ "use strict"; function performRequests(url) { - return new Promise((resolve, reject) => { + return new Promise((resolve) => { const xhr = new XMLHttpRequest(); xhr.open("GET", url, true); xhr.onreadystatechange = function() { diff --git a/devtools/client/netmonitor/test/html_post-json-test-page.html b/devtools/client/netmonitor/test/html_post-json-test-page.html index 8c18e91dbb..b6c734c192 100644 --- a/devtools/client/netmonitor/test/html_post-json-test-page.html +++ b/devtools/client/netmonitor/test/html_post-json-test-page.html @@ -18,7 +18,7 @@ /* exported performRequests performLargePostDataRequest */ "use strict"; - function post(address, message, callback) { + function post(address, message) { return new Promise(resolve => { const xhr = new XMLHttpRequest(); xhr.open("POST", address, true); diff --git a/devtools/client/netmonitor/test/html_sse-test-page.html b/devtools/client/netmonitor/test/html_sse-test-page.html index bb726d4c1f..7f3fd33bfb 100644 --- a/devtools/client/netmonitor/test/html_sse-test-page.html +++ b/devtools/client/netmonitor/test/html_sse-test-page.html @@ -20,7 +20,7 @@ function openConnection() { return new Promise(resolve => { es = new EventSource("sjs_sse-test-server.sjs"); - es.onmessage = function (e) { + es.onmessage = function () { es.close(); resolve(); }; diff --git a/devtools/client/netmonitor/test/html_ws-sse-test-page.html b/devtools/client/netmonitor/test/html_ws-sse-test-page.html index 8936efa81e..637848eea3 100644 --- a/devtools/client/netmonitor/test/html_ws-sse-test-page.html +++ b/devtools/client/netmonitor/test/html_ws-sse-test-page.html @@ -22,7 +22,7 @@ "ws://mochi.test:8888/browser/devtools/client/netmonitor/test/file_ws_backend" ); - ws.onopen = e => { + ws.onopen = () => { for (let i = 0; i < numFramesToSend; i++) { ws.send("Payload " + i); } @@ -33,7 +33,7 @@ function closeWsConnection() { return new Promise(resolve => { - ws.onclose = e => { + ws.onclose = () => { resolve(); }; ws.close(); @@ -48,7 +48,7 @@ function openSseConnection() { return new Promise(resolve => { es = new EventSource("sjs_sse-test-server.sjs"); - es.onmessage = function(e) { + es.onmessage = function() { es.close(); resolve(); }; diff --git a/devtools/client/netmonitor/test/html_ws-test-page.html b/devtools/client/netmonitor/test/html_ws-test-page.html index de32b2a18a..7abcd033ed 100644 --- a/devtools/client/netmonitor/test/html_ws-test-page.html +++ b/devtools/client/netmonitor/test/html_ws-test-page.html @@ -21,7 +21,7 @@ ws = new WebSocket( "ws://mochi.test:8888/browser/devtools/client/netmonitor/test/file_ws_backend"); - ws.onopen = e => { + ws.onopen = () => { for (let i = 0; i < numFramesToSend; i++) { ws.send("Payload " + i); } @@ -41,7 +41,7 @@ function closeConnection() { return new Promise(resolve => { - ws.onclose = e => { + ws.onclose = () => { resolve(); } ws.close(); diff --git a/devtools/client/netmonitor/test/service-workers/status-codes.html b/devtools/client/netmonitor/test/service-workers/status-codes.html index 05664d13a7..cb6f8fc535 100644 --- a/devtools/client/netmonitor/test/service-workers/status-codes.html +++ b/devtools/client/netmonitor/test/service-workers/status-codes.html @@ -39,7 +39,7 @@ }, {once: true}); } }); - }).catch(err => { + }).catch(() => { console.error("Registration failed"); }); } |