3 function makeURI(str) {
4 return Services.io.newURI(str);
9 Services.prefs.setIntPref("network.cookie.cookieBehavior", 0);
10 Services.prefs.setBoolPref(
11 "network.cookieJarSettings.unblocked_for_testing",
14 Services.prefs.setBoolPref("dom.security.https_first", false);
16 var uri = makeURI("http://example.com/");
17 var channel = NetUtil.newChannel({
19 loadUsingSystemPrincipal: true,
20 contentPolicyType: Ci.nsIContentPolicy.TYPE_DOCUMENT,
22 Services.scriptSecurityManager.createContentPrincipal(uri, {});
24 CookieXPCShellUtils.createServer({ hosts: ["example.com"] });
26 // Try an expiration time before the epoch
28 await CookieXPCShellUtils.setCookieToDocument(
30 "test=test; path=/; domain=example.com; expires=Sun, 31-Dec-1899 16:00:00 GMT;"
33 await CookieXPCShellUtils.getCookieStringFromDocument(uri.spec),
38 Services.cookies.setCookieStringFromHttp(
40 "test2=test2; path=/; domain=example.com;",
45 await CookieXPCShellUtils.getCookieStringFromDocument(uri.spec),
48 Services.prefs.clearUserPref("dom.security.https_first");