ExtensionProcessCrashObserver should use integer (number) instead of string type for childID
Categories
(WebExtensions :: General, task, P3)
Tracking
(Not tracked)
People
(Reporter: robwu, Unassigned, Mentored)
References
Details
(Keywords: good-first-bug, Whiteboard: [addons-jira])
The childID
parameter in ExtensionProcessCrashObserver
is currently a string, but the more common convention is for the value to be a number.
We should use parseInt(data, 10)
instead of just data
at: https://searchfox.org/mozilla-central/rev/b6b8ff043e944a5e32ea63208d3ba7cb6b16191d/toolkit/components/extensions/Extension.sys.mjs#697
and for test coverage, add Assert.ok(Number.isInteger(currentProcessChildID), "correct type");
after https://searchfox.org/mozilla-central/rev/b6b8ff043e944a5e32ea63208d3ba7cb6b16191d/toolkit/components/extensions/test/browser/browser_ext_process_crash_handling.js#107
Updated•10 months ago
|
Reporter | ||
Comment 1•10 months ago
|
||
This is a good first bug for people who want to familiarize themselves with setting up a development environment and submitting a patch. To get started, see https://wiki.mozilla.org/WebExtensions/Contribution_Onramp
Since this bug is essentially two lines of change, I recommend the following steps once you have set up the development environment:
- Run the test first to verify that it passes as expected:
./mach test toolkit/components/extensions/test/browser/browser_ext_process_crash_handling.js
- Add the test as explained in the first comment.
- Run the test again to verify that it not fails.
- Fix the bug as suggested in the first comment.
- Run the test again to verify that the test now passes again.
- Submit the patch for review.
Description
•