NimbusTestUtils._testSuite retains test scope through shutdown, causing window leaks
Categories
(Firefox :: Nimbus Desktop Client, defect)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox150 | --- | fixed |
People
(Reporter: florian, Assigned: florian)
References
(Blocks 1 open bug)
Details
Attachments
(1 file)
|
Bug 2019592 - Fix shutdown leak in NimbusTestUtils by not retaining test scope, r=#nimbus-reviewers.
48 bytes,
text/x-phabricator-request
|
Details | Review |
NimbusTestUtils.init(this) stores a reference to the test's global scope in a module-level _testSuite variable. Since var declarations in browser chrome tests become properties of the global object, any window references stored in vars are kept alive through shutdown via the chain: ModuleLoaderBase → NimbusTestUtils.sys.mjs → _testSuite → (test global) → window.
This causes shutdown leaks for any test that both uses NimbusTestUtils (via head.js) and stores window references in global vars. For example, browser_site_login_exceptions_policy.js leaks its subdialog windows this way.
The fix is to have NimbusTestUtils.init() register a cleanup function on the test scope that nulls out _testSuite when the test finishes.
| Assignee | ||
Updated•5 months ago
|
| Assignee | ||
Comment 1•5 months ago
•
|
||
The reference paths are visible when hovering the "FAIL" markers in this profile produced with the patches from bug 2019756.
| Assignee | ||
Comment 2•5 months ago
|
||
NimbusTestUtils.init() stored the entire test global scope in _testSuite,
which retained all var declarations (including window references) through
shutdown. Instead, capture only the Assert instance directly.
Comment 4•5 months ago
|
||
| bugherder | ||
Description
•