mirror of
https://github.com/classilla/tenfourfox.git
synced 2024-11-20 10:33:36 +00:00
18 lines
891 B
JavaScript
18 lines
891 B
JavaScript
const GOOD_COOKIE = "GoodCookie=OMNOMNOM";
|
|
|
|
function run_test() {
|
|
var ios = Cc["@mozilla.org/network/io-service;1"].getService(Ci.nsIIOService);
|
|
var cookieURI = ios.newURI("http://mozilla.org/test_cookie_blacklist.js",
|
|
null, null);
|
|
|
|
var cookieService = Cc["@mozilla.org/cookieService;1"]
|
|
.getService(Ci.nsICookieService);
|
|
cookieService.setCookieStringFromHttp(cookieURI, cookieURI, null, "BadCookie1=\x01", null, null);
|
|
cookieService.setCookieStringFromHttp(cookieURI, cookieURI, null, "BadCookie2=\v", null, null);
|
|
cookieService.setCookieStringFromHttp(cookieURI, cookieURI, null, "Bad\x07Name=illegal", null, null);
|
|
cookieService.setCookieStringFromHttp(cookieURI, cookieURI, null, GOOD_COOKIE, null, null);
|
|
|
|
var storedCookie = cookieService.getCookieString(cookieURI, null);
|
|
do_check_eq(storedCookie, GOOD_COOKIE);
|
|
}
|