Closed Bug 1765370 Opened 2 years ago Closed 2 years ago

valid-typeof failure in inspected-window-command.js

Categories

(DevTools :: General, defect)

defect

Tracking

(firefox101 fixed)

RESOLVED FIXED
101 Branch
Tracking Status
firefox101 --- fixed

People

(Reporter: standard8, Assigned: nchevobbe)

Details

Attachments

(1 file)

In bug 1725952 I am looking at upgrading ESLint. The new versions have picked up this code as being wrong, this:

if (typeof options.userAgent !== undefined) {

should be:

if (typeof options.userAgent !== "undefined") {

When fixing this, we get the failures:

devtools/shared/commands/inspected-window/tests/browser_webextension_inspected_window.js
  FAIL Got the expected result with reload without a customized userAgent - Got "Customized User Agent", expected "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:101.0) Gecko/20100101 Firefox/101.0"
Stack trace:
chrome://mochitests/content/browser/devtools/shared/commands/inspected-window/tests/browser_webextension_inspected_window.js:test_exception_inspectedWindowReload_customUserAgent:403
  FAIL Got the expected result with reload without a customized userAgent - Got "Customized User Agent 1", expected "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:101.0) Gecko/20100101 Firefox/101.0"
Stack trace:
chrome://mochitests/content/browser/devtools/shared/commands/inspected-window/tests/browser_webextension_inspected_window.js:test_exception_inspectedWindowReload_multiple_calls:498

This was already happening due to an erroneous typeof check.
Luckikly this is actually what we want (and what Chrome is doing FWIW).

Assignee: nobody → nchevobbe
Status: NEW → ASSIGNED
Pushed by nchevobbe@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/aa9d3a72da53
[devtools] Always update configuration in InspectedWindowCommand.reload. r=jdescottes.
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 101 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: