58 headers.setHeader(fieldName, fieldValue,
false);
62 do_throw(
"Unexpected exception thrown: " + e);
80 headers.setHeader(fieldName, fieldValue,
false);
81 throw "Setting (" + fieldName +
", " +
82 fieldValue +
") as header succeeded!";
86 if (e !==
Cr.NS_ERROR_INVALID_ARG)
87 do_throw(
"Unexpected exception thrown: " + e);
141 headers.setHeader(
"Content-Type",
"text/html",
false);
142 var c = headers.getHeader(
"content-type");
145 headers.setHeader(
"test",
"FOO",
false);
146 var c = headers.getHeader(
"test");
151 headers.getHeader(
":");
152 throw "Failed to throw for invalid header";
156 if (e !==
Cr.NS_ERROR_INVALID_ARG)
157 do_throw(
"headers.getHeader(':') must throw invalid arg");
162 headers.getHeader(
"valid");
163 throw 'header doesn\'t exist';
167 if (e !==
Cr.NS_ERROR_NOT_AVAILABLE)
168 do_throw(
"shouldn't be a header named 'valid' in headers!");
179 "baz":
"two six niner",
180 "decaf":
"class Program { int .7; int main(){ .7 = 5; return 7 - .7; } }"
184 headers.setHeader(
i, heads[
i],
false);
186 var en = headers.enumerator;
187 while (en.hasMoreElements())
189 var it = en.getNext().QueryInterface(
Ci.nsISupportsString).data;
190 do_check_true(it.toLowerCase() in heads);
191 delete heads[it.toLowerCase()];
195 do_throw(
"still have properties in heads!?!?");
203 headers.setHeader(
"foo",
"bar",
false);
204 do_check_true(headers.hasHeader(
"foo"));
205 do_check_true(headers.hasHeader(
"fOo"));
206 do_check_false(headers.hasHeader(
"not-there"));
208 headers.setHeader(
"f`'~",
"bar",
false);
209 do_check_true(headers.hasHeader(
"F`'~"));
213 headers.hasHeader(
":");
214 throw "failed to throw";
218 if (e !==
Cr.NS_ERROR_INVALID_ARG)
219 do_throw(
".hasHeader for an invalid name should throw");
do_check_eq(typeof PlacesUtils,"object")
_getSelectedPageStyle s i