Closed
Bug 1319995
Opened 8 years ago
Closed 8 years ago
Set the substituting handler of the resources of "formautofill" in xpcshell tests
Categories
(Toolkit :: Form Manager, enhancement, P3)
Toolkit
Form Manager
Tracking
()
RESOLVED
FIXED
mozilla53
Tracking | Status | |
---|---|---|
firefox53 | --- | fixed |
People
(Reporter: lchang, Assigned: lchang)
References
Details
(Whiteboard: [form autofill:M1])
Attachments
(1 file)
I just learnt that it might be a proper way to load addon resources in xpcshell tests.
Comment hidden (mozreview-request) |
Assignee | ||
Comment 2•8 years ago
|
||
Hi Matt,
By changing to this we don't need to mock "defineLazyModuleGetter" (and even "Cu.import") in "head.js" anymore. I think it would be more intuitive and helpful for further tests' implementation. Could you take a look? Thanks.
Comment 3•8 years ago
|
||
mozreview-review |
Comment on attachment 8813957 [details]
Bug 1319995 - Set the substituting handler of the resources of "formautofill" in xpcshell tests;
https://reviewboard.mozilla.org/r/95262/#review95572
r=me with the cleanup.
::: browser/extensions/formautofill/test/unit/head.js:21
(Diff revision 1)
> +// Register the resource path of formautofill
> +let resHandler = Services.io.getProtocolHandler("resource")
> + .QueryInterface(Ci.nsISubstitutingProtocolHandler);
> +let dataURI = NetUtil.newURI(do_get_file(".", true));
> +resHandler.setSubstitution("formautofill", dataURI);
Cool. It seems like we should also have a registerCleanup… in head.js to revert this at the end of each test so it doesn't leak into non-autofill tests.
"A null baseURI removes the specified substitution."
Attachment #8813957 -
Flags: review?(MattN+bmo) → review+
Comment hidden (mozreview-request) |
Assignee | ||
Comment 5•8 years ago
|
||
mozreview-review-reply |
Comment on attachment 8813957 [details]
Bug 1319995 - Set the substituting handler of the resources of "formautofill" in xpcshell tests;
https://reviewboard.mozilla.org/r/95262/#review95572
> Cool. It seems like we should also have a registerCleanup… in head.js to revert this at the end of each test so it doesn't leak into non-autofill tests.
> "A null baseURI removes the specified substitution."
Thanks for pointing it out. I end up added the clean-up code in tail.js so we can avoid forgetting to do that in each test.
Pushed by ihsiao@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/82018512953d
Set the substituting handler of the resources of "formautofill" in xpcshell tests; r=MattN
Keywords: checkin-needed
Comment 8•8 years ago
|
||
bugherder |
Status: NEW → RESOLVED
Closed: 8 years ago
status-firefox53:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla53
Updated•8 years ago
|
Flags: qe-verify-
You need to log in
before you can comment on or make changes to this bug.
Description
•