Backed out changeset b71c8c052463 (bug 1943846) for causing mass failures. CLOSED...
[gecko.git] / netwerk / test / unit / test_bug650522.js
blob44576ecfa16394acc4a580da51359f702257a616
1 /* Any copyright is dedicated to the Public Domain.
2 http://creativecommons.org/publicdomain/zero/1.0/ */
4 "use strict";
6 add_task(async () => {
7 Services.prefs.setBoolPref("network.cookie.sameSite.schemeful", false);
8 Services.prefs.setBoolPref("dom.security.https_first", false);
10 var expiry = (Date.now() + 1000) * 1000;
12 // Test our handling of host names with a single character at the beginning
13 // followed by a dot.
14 Services.cookies.add(
15 "e.com",
16 "/",
17 "foo",
18 "bar",
19 false,
20 false,
21 true,
22 expiry,
23 {},
24 Ci.nsICookie.SAMESITE_NONE,
25 Ci.nsICookie.SCHEME_HTTP
27 Assert.equal(Services.cookies.countCookiesFromHost("e.com"), 1);
29 CookieXPCShellUtils.createServer({ hosts: ["e.com"] });
30 const cookies =
31 await CookieXPCShellUtils.getCookieStringFromDocument("http://e.com/");
32 Assert.equal(cookies, "foo=bar");
33 Services.prefs.clearUserPref("dom.security.https_first");
34 });