Closed
Bug 1508287
Opened 6 years ago
Closed 6 years ago
Refactor xpcshell thread client tests running against multiple servers to share a test helper
Categories
(DevTools :: Debugger, enhancement, P2)
DevTools
Debugger
Tracking
(firefox65 fixed)
RESOLVED
FIXED
Firefox 65
Tracking | Status | |
---|---|---|
firefox65 | --- | fixed |
People
(Reporter: ochameau, Assigned: ochameau)
References
(Blocks 1 open bug)
Details
(Whiteboard: dt-fission)
Attachments
(4 files)
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:
https://searchfox.org/mozilla-central/search?q=run_test_with_server&case=false®exp=false&path=
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, ...
Assignee | ||
Comment 1•6 years 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
Assignee | ||
Comment 2•6 years 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
Assignee | ||
Comment 3•6 years ago
|
||
MozReview-Commit-ID: 3a9IB4XFjff
Depends on D12310
Assignee | ||
Comment 4•6 years ago
|
||
MozReview-Commit-ID: 4qGo1ZF7ITC
Depends on D12311
Pushed by apoirot@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/fc10fcd15066
Ensure exposing `console` to modules loaded for worker server. r=yulia
https://hg.mozilla.org/integration/autoland/rev/c56b523e11e6
Refactor most debugger server test using run_test_with_server to share more code. r=yulia
https://hg.mozilla.org/integration/autoland/rev/fc126a74993d
Refactor xpcshell tests using custom principal. r=yulia
https://hg.mozilla.org/integration/autoland/rev/14c07af09b66
Refactor server xpcshell tests that do not pass in worker context. r=yulia
Comment 6•6 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/fc10fcd15066
https://hg.mozilla.org/mozilla-central/rev/c56b523e11e6
https://hg.mozilla.org/mozilla-central/rev/fc126a74993d
https://hg.mozilla.org/mozilla-central/rev/14c07af09b66
Status: NEW → RESOLVED
Closed: 6 years ago
status-firefox65:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → Firefox 65
You need to log in
before you can comment on or make changes to this bug.
Description
•