Open Bug 424484 Opened 13 years ago Updated 3 years ago

Need way to run mochitests from file://


(Testing :: Mochitest, defect)

Not set


(Not tracked)



(Reporter: bzbarsky, Unassigned)


(Blocks 1 open bug)



(1 file)

Need this to test bug 418356 and bug 402983.  This can be gotten around by using UniversalXPConnect to create/remove the files (in /tmp, say) as part of an http:// test, but that makes the test a lot more confusing.  Ideally we would just have a directory tree running as file:// somewhere and we could point to a particular file in the tree as the testcase.  It's important that it be possible to have the "main" testcase _not_ be at the top of the tree, so we can test accessing ancestors.
Blocks: 418391
Also needed for bug 425201.
Blocks: 402983, 418356, 425201
Duplicate of this bug: 372307
Blocks: 424875
Blocks: 435362
Blocks: 440595
Blocks: 429657
Blocks: 252961
Blocks: 269125
Blocks: 445725
Moving a bunch of Core :: Testing bugs to Testing :: Mochitest to clear out the former, which is obsolete now that we have more specialized categories for such bugs; filter on the string "MochitestMmMm" to delete all these notifications.
Component: Testing → Mochitest
Product: Core → Testing
QA Contact: testing → mochitest
Version: Trunk → unspecified
Blocks: 467008
Blocks: 469122
Here's a proposal that would just add file:// tests into the current test runner. Of course, it doesn't work, because http:// content can't link to file:// content, so you get "Error: uncaught exception: [Exception... "Access to restricted URI denied"  code: "1012" nsresult: "0x805303f4 (NS_ERROR_DOM_BAD_URI)"  location: "http://localhost:8888/tests/SimpleTest/TestRunner.js Line: 92"]"

The patch works by just requiring the file tests to be named "test_file_...".

I'm going to file a Caps bug blocking this one to see if we can make that work. If not, the alternative would be to add a whole new method to, like --file, which would load the whole harness from a file:// URL.
Depends on: 470016
Blocks: 507361
Mass closing mochitest bugs that haven't had activity in the past 5 years. Please re-open or file a new bug with modern context if this is still relevant.
Closed: 3 years ago
Resolution: --- → WONTFIX
This is still relevant.  We need it to be able to write tests for critical security code.  The fact that we haven't bothered to fix the harness to make this possible doesn't mean it doesn't actually need to happen...
Resolution: WONTFIX → ---
You need to log in before you can comment on or make changes to this bug.