Closed
Bug 366712
Opened 18 years ago
Closed 17 years ago
Need way to affect the headers that mochitest's server sends for a test
Categories
(Testing :: Mochitest, defect)
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: bzbarsky, Unassigned)
References
Details
To test bug 200930, I need to be able to affect the headers the server sends (because some of the testing involves the Default-Style header)....
Comment 1•17 years ago
|
||
I just committed a fix for bug 367214, which should also fix this bug. To modify the HTTP headers/status of a file FOO, create a sibling file FOO^headers^ and set its content as follows:
- to modify the HTTP status, the first line should be of the form
"HTTP ### Description", where ### is the appropriate status (404, 500, etc.)
and where "Description" is an arbitrary descriptive value; if you don't need
to modify it, omit this line
- if you need to modify an HTTP header, just add the appropriate line for it
after the status line, if present
Some examples of how this works may be found in the directory of tests for this functionality:
http://lxr.mozilla.org/seamonkey/source/netwerk/test/httpserver/test/data/cern_meta/
This functionality is restricted only in that you can't set Server, Content-Length, or Date headers, because the server currently forces those headers to correct values for the generated response during post-processing. I anticipate this restriction going away eventually, but I don't think this will really be a problem for the immediate future. Also, for simplicity you can't set the same header twice and you can't format a header so it's multi-line, but neither of those restrict what you can do in any way whatsoever.
Please file bugs for anything you find that doesn't work.
Status: NEW → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
Reporter | ||
Comment 2•17 years ago
|
||
Do you want to toss the docs on devmo so they show up when people search?
And thanks for doing this!
Comment 3•17 years ago
|
||
Yeah, I just hadn't gotten around to it yet; I sent a post to the newsgroups as well.
http://developer.mozilla.org/en/docs/Mochitest#How_do_I_change_the_HTTP_headers_or_status_sent_with_a_file_used_in_a_Mochitest.3F
Comment 4•16 years ago
|
||
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
You need to log in
before you can comment on or make changes to this bug.
Description
•