41 const BASE =
"http://localhost:4444";
43 var
sjs = do_get_file(
"data/sjs/cgi.sjs");
55 return bytes.map(
function(v) {
return String.fromCharCode(v); }).join(
"");
60 ch.loadFlags |=
Ci.nsIRequest.LOAD_BYPASS_CACHE;
75 const TEST_URL =
BASE +
"/cgi.sjs" + (throwing ?
"?throw" :
"");
79 function setupFile(ch)
81 srv.registerFile(
"/cgi.sjs",
sjs);
85 function verifyRawText(channel, cx, status, bytes)
87 dumpn(channel.originalURI.spec);
97 function addTypeMapping(ch)
99 srv.registerContentType(
"sjs",
"sjs");
103 function checkType(ch, cx)
107 do_check_false(ch.requestSucceeded);
116 function checkContents(ch, cx, status,
data)
128 function setupDirectoryAndRemoveType(ch)
130 dumpn(
"removing type mapping");
131 srv.registerContentType(
"sjs",
null);
132 srv.registerFile(
"/cgi.sjs",
null);
133 srv.registerDirectory(
"/",
sjs.parent);
143 function contentAndCleanup(ch, cx, status,
data)
145 checkContents(ch, cx, status,
data);
148 srv.registerDirectory(
"/",
null);
149 srv.registerContentType(
"sjs",
null);
175 srv.registerDirectory(
"/",
sjs.parent);
176 srv.registerContentType(
"sjs",
"sjs");
193 return function setupRangeRequest(ch)
195 ch.setRequestHeader(
"Range", expectedRangeHeader,
false);
203 var
val = ch.getResponseHeader(
"Content-Range");
206 if (
val !== undefined)
208 do_throw(
"should not have gotten a Content-Range header, but got one " +
209 "with this value: " +
val);
216 rangeInit(
"not-a-bytes-equals-specifier"),
242 srv.registerFile(
"/script.html",
sjs);
270 srv.registerContentType(
"foo",
"bar\nbaz");
271 throw "this server throws on content-types which aren't field-values";
do_check_eq(typeof PlacesUtils,"object")
function runHttpTests(testArray, done)
function setupTests(throwing)
function bytesToString(bytes)
function checkRangeResult(ch, cx)
this _dialogInput val(dateText)
function fileContents(file)
function setupFileMapping(ch)
function testComplete(srv)
function Test(path, initChannel, onStartRequest, onStopRequest)
function checkNotSJS(ch, cx, status, data)
function rangeInit(expectedRangeHeader)
function onStop(ch, cx, status, data)
function isException(e, code)