Closed Bug 544241 Opened 10 years ago Closed 10 years ago

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

Categories

(Testing :: XPCShell Harness, defect)

defect
Not set

Tracking

(Not tracked)

RESOLVED FIXED
mozilla1.9.3a2

People

(Reporter: mak, Assigned: mak)

Details

(Keywords: dev-doc-complete)

Attachments

(1 file)

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?
Attached patch patch v1.0Splinter Review
Attachment #425202 - Flags: review?(ted.mielczarek)
Blocks: 542941
Keywords: dev-doc-needed
No longer blocks: 542941
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+
http://hg.mozilla.org/mozilla-central/rev/dcfd776ad20f
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla1.9.3a2
Flags: in-testsuite? → in-testsuite+
You need to log in before you can comment on or make changes to this bug.