Backed out changeset b71c8c052463 (bug 1943846) for causing mass failures. CLOSED...
[gecko.git] / netwerk / test / unit / test_bug667087.js
blobce0f8df0774b53e80acf6ff53bce614e21226232
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("dom.security.https_first", false);
8 var expiry = (Date.now() + 1000) * 1000;
10 // Test our handling of host names with a single character consisting only
11 // of a single character
12 Services.cookies.add(
13 "a",
14 "/",
15 "foo",
16 "bar",
17 false,
18 false,
19 true,
20 expiry,
21 {},
22 Ci.nsICookie.SAMESITE_NONE,
23 Ci.nsICookie.SCHEME_HTTP
25 Assert.equal(Services.cookies.countCookiesFromHost("a"), 1);
27 CookieXPCShellUtils.createServer({ hosts: ["a"] });
28 const cookies =
29 await CookieXPCShellUtils.getCookieStringFromDocument("http://a/");
30 Assert.equal(cookies, "foo=bar");
31 Services.prefs.clearUserPref("dom.security.https_first");
32 });