If you think a bug might affect users in the 57 release, please set the correct tracking and status flags for Release Management.

xpcshell-tests head.js should always remap resource://test to the current test dir

RESOLVED FIXED in mozilla1.9.3a2

Status

Testing
XPCShell Harness
RESOLVED FIXED
8 years ago
2 years ago

People

(Reporter: mak, Assigned: mak)

Tracking

({dev-doc-complete})

Trunk
mozilla1.9.3a2
dev-doc-complete
Points:
---
Bug Flags:
in-testsuite +

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Assignee)

Description

8 years ago
This is already done by some xpconnect test, but makes sense refactoring it into head.js to make it available to anyone. So it will be possible for example to add a module in test folder and import it.
Flags: in-testsuite?
(Assignee)

Comment 1

8 years ago
Created attachment 425202 [details] [diff] [review]
patch v1.0
Attachment #425202 - Flags: review?(ted.mielczarek)
(Assignee)

Updated

8 years ago
Blocks: 542941
(Assignee)

Updated

8 years ago
Keywords: dev-doc-needed
(Assignee)

Updated

8 years ago
No longer blocks: 542941
(Assignee)

Comment 2

8 years ago
i was thinking that maybe would be more useful having it point to the parent folder, usually tests are organized like:

test/unit
test/other
test/somethingother

maybe could be cool to put jsm files in test/ and be able to share it across all folders as resource://test/module.jsm.
And use resource://test/unit/module.jsm if it's in a subfolder.

Thoughts?
We don't really have a good story for sharing resources among test directories. I think I made do_get_file("../foo") work because there were tests using that to work around it. However, I'm pretty sure most areas in the codebase using xpcshell tests have only one test directory, so making it work as you propose might be confusing.
Comment on attachment 425202 [details] [diff] [review]
patch v1.0

Looks good. If you can figure out a better way to share this stuff between dirs that isn't confusing in the common case, I'm open to ideas.
Attachment #425202 - Flags: review?(ted.mielczarek) → review+
(Assignee)

Comment 5

8 years ago
http://hg.mozilla.org/mozilla-central/rev/dcfd776ad20f
Status: ASSIGNED → RESOLVED
Last Resolved: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla1.9.3a2
(Assignee)

Comment 6

8 years ago
added doc to https://developer.mozilla.org/en/Writing_xpcshell-based_unit_tests
Keywords: dev-doc-needed → dev-doc-complete
(Assignee)

Updated

2 years ago
Flags: in-testsuite? → in-testsuite+
You need to log in before you can comment on or make changes to this bug.