Closed Bug 1755626 Opened 2 years ago Closed 2 years ago

Debugging server shouldn't crash if formatURLPref throws

Categories

(DevTools :: Debugger, defect)

defect

Tracking

(firefox101 fixed)

RESOLVED FIXED
101 Branch
Tracking Status
firefox101 --- fixed

People

(Reporter: u695164, Assigned: jdescottes)

References

Details

Attachments

(1 file)

In the current state mach xpcshell-test --jsdebugger connecting with a debugger from Thunderbird doesn't work.

console.error: "[ACTION FAILED] REQUEST_EXTENSIONS_FAILURE: Protocol error (noAddons): This root actor has no browser addons. from: root" ...

I think its helpful to find bugs in the tests or with the underlying implementation if we have a debugger.

We occasionally don't have some added/modified pref not-up-to-date. But the actual devtools is exactly the same as what ships in Firefox + the small additions in https://searchfox.org/comm-central/source/mail/components/devtools, (quote from mkmelin from matrix, thanks!)

If there is a solution to write a test for the function of the jsdebugger for xpcshell-tests we should do that.

The code is the same but we likely are using wrong/old parts of it. I didn't investigate what or why.

Bug 1721691 could be related. Haven't investigated it.

See Also: → 1721691

The failure here isn't due to the root actor. On the terminal there are messages such as:

 0:13.46 pid:22375 JavaScript error: resource://gre/modules/URLFormatter.jsm, line 120: TypeError: can't access property "toLowerCase", Services.appinfo.name is undefined
 0:13.46 pid:22375 console.error: "Error while calling actor 'processDescriptor's method 'getTarget'" "[JavaScript Error: \"can't access property \"toLowerCase\", Services.appinfo.name is undefined\" {file: \"resource://gre/modules/URLFormatter.jsm\" line: 120}]'[JavaScript Error: \"can't access property \"toLowerCase\", Services.appinfo.name is undefined\" {file: \"resource://gre/modules/URLFormatter.jsm\" line: 120}]' when calling method: [nsIURLFormatter::formatURLPref]"

These are echoed in the browser console of Firefox when you actually try to connect.

Adding some console traces points to the formatting of this preference from this call point.

In xpcshell-tests, we do not have the application information defined. This causes Services.appinfo.name to be undefined, and hence the call to throw.

Temporarily removing %APP% from the URL makes this work.

Firefox does not have %APP% in app.support.baseURL - this was changed in bug 650246. I'm not sure if the same would apply for Thunderbird.

:jdescottes also suggested that the server shouldn't crash if that throws - he's thinking about putting up a patch for this.

Component: Testing Infrastructure → Debugger
Product: Thunderbird → DevTools
Summary: Make XPCShell with --jsdebugger work → Debugging server shouldn't crash if formatURLPref throws

formatURLPref is throwing when trying to debug xpcshell tests for Thunderbird

Assignee: nobody → jdescottes
Status: NEW → ASSIGNED
Pushed by jdescottes@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/e603d42c1736
[devtools] Debugging server shouldn't crash if formatURLPref throws r=devtools-reviewers,nchevobbe
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: