Open
Bug 1425832
Opened 8 years ago
Updated 2 years ago
Using Services.prompt from pippki.js breaks browser_loadPKCS11Module_ui - should use PromptTestUtils
Categories
(Core :: Security: PSM, defect, P3)
Core
Security: PSM
Tracking
()
NEW
People
(Reporter: standard8, Unassigned)
References
Details
I've just been trying to enable mozilla/use-services for some files in security.
I was trying to replace this:
https://searchfox.org/mozilla-central/rev/b1e0ae2573e88391a7ed92407568be77994c9317/security/manager/pki/resources/content/pippki.js#67-69
with
```
Services.prompt.alert(window, title, message);
```
Although the tests work, it was reporting leaks:
TEST-UNEXPECTED-FAIL | security/manager/ssl/tests/mochitest/browser/browser_loadPKCS11Module_ui.js | leaked 1 window(s) until shutdown [url = chrome://pippki/content/load_device.xul]
TEST-UNEXPECTED-FAIL | security/manager/ssl/tests/mochitest/browser/browser_loadPKCS11Module_ui.js | leaked 1 window(s) until shutdown [url = about:blank]
I can't quite work out why this would be. My only thought is that using Services.jsm is causing some initialisation to be tagged with the window (load_device.xul), and therefore it thinks not all of the window items get freed.
Bug 1418959 is another similar bug, but with Services.strings.
Not sure where to file this, so put it in general for now.
Updated•7 years ago
|
Priority: -- → P3
Updated•3 years ago
|
Severity: normal → S3
Comment 1•3 years ago
|
||
I'm here because of bug 1808115. Would be useful to re-test this just to find out if the changes to how Services.jsm works have "fixed" this particular leak.
Flags: needinfo?(standard8)
| Reporter | ||
Comment 2•3 years ago
|
||
(In reply to :Gijs (he/him) from comment #1)
I'm here because of bug 1808115. Would be useful to re-test this just to find out if the changes to how Services.jsm works have "fixed" this particular leak.
It appears it no longer leaks, but running it now causes this failure:
FAIL alert() should have been called once - 0 == 1 - JS frame :: chrome://mochitests/content/browser/security/manager/ssl/tests/mochitest/browser/browser_loadPKCS11Module_ui.js :: testAddModuleFailure :: line 252
I think the test probably needs rewriting using PromptTestUtils, as Services.prompt is likely caching the prompt service and causing the mock to not be applied properly.
Flags: needinfo?(standard8)
Updated•2 years ago
|
Component: General → Security: PSM
Product: Toolkit → Core
Summary: Using Services.jsm sometimes causes memory leaks in tests. → Using Services.prompt from pippki.js breaks browser_loadPKCS11Module_ui - should use PromptTestUtils
You need to log in
before you can comment on or make changes to this bug.
Description
•