Refactor xpcshell thread client tests running against multiple servers to share a test helper

RESOLVED FIXED in Firefox 65


6 months ago
3 days ago


(Reporter: ochameau, Assigned: ochameau)


(Blocks 1 bug)

Firefox 65
Dependency tree / graph

Firefox Tracking Flags

(firefox65 fixed)


(Whiteboard: dt-fission)


(4 attachments)



6 months ago
Many xpcshell tests against the thread client are copy paste a lot of setup code.
Especially the one that require to run the tests against two server: the regular DebuggerServer and the worker one, run in a special context, where there is no chrome privileges. No access to require("chrome")/ChromeUtils/Components.*.

These are the tests using run_test_with_server function, which is copy pasted between all of them:

I'm cleaning this up to help the refactoring necessary for fission, where we will have to refactor how to instantiate a target, a thread client, ...


6 months ago
Blocks: 1508289

Comment 1

6 months ago
Without this devtools/server/tests/unit/test_breakpoint-22.js fails in protocol.js
writeError function when trying to use console object.

MozReview-Commit-ID: JFhFboHugUh

Comment 2

6 months ago
There is a lot of code being copy paste in all these tests
and as I'm most likely going to change things around them in the near future
regarding fission, it would be better if we start sharing more code.

After this there is still a couple of copy paste code (but way less!):
* breakpoints: wait a paused event and eval a custom script in a sandbox
* object grips: set the security.allow_eval_with_system_principal pref, eval stopMe and wait for paused
* stepping: use executeOnNextTickAndWaitForPause to eval a custom script and wait for pause while doing this only on next tick

There is most likely more to share, but at least this isn't framework code, but now only code specific to the debugger.

MozReview-Commit-ID: JgD389cas2j

Depends on D12309

Comment 3

6 months ago
MozReview-Commit-ID: 3a9IB4XFjff

Depends on D12310

Comment 4

6 months ago
MozReview-Commit-ID: 4qGo1ZF7ITC

Depends on D12311

Comment 5

6 months ago
Pushed by
Ensure exposing `console` to modules loaded for worker server. r=yulia
Refactor most debugger server test using run_test_with_server to share more code. r=yulia
Refactor xpcshell tests using custom principal. r=yulia
Refactor server xpcshell tests that do not pass in worker context. r=yulia
You need to log in before you can comment on or make changes to this bug.