mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
4bd2d83991
--HG-- extra : rebase_source : f486f39feac1fb743edc920618bec29884d515f1
24 lines
1005 B
JavaScript
24 lines
1005 B
JavaScript
const Cu = Components.utils;
|
|
|
|
Cu.import("resource://gre/modules/Services.jsm");
|
|
|
|
function makeURI(str) {
|
|
return Components.classes["@mozilla.org/network/io-service;1"]
|
|
.getService(Components.interfaces.nsIIOService)
|
|
.newURI(str, null, null);
|
|
}
|
|
|
|
function run_test() {
|
|
// Allow all cookies.
|
|
Services.prefs.setIntPref("network.cookie.cookieBehavior", 0);
|
|
var serv = Components.classes["@mozilla.org/cookieService;1"]
|
|
.getService(Components.interfaces.nsICookieService);
|
|
var uri = makeURI("http://example.com/");
|
|
// Try an expiration time before the epoch
|
|
serv.setCookieString(uri, null, "test=test; path=/; domain=example.com; expires=Sun, 31-Dec-1899 16:00:00 GMT;", null);
|
|
do_check_eq(serv.getCookieString(uri, null), null);
|
|
// Now sanity check
|
|
serv.setCookieString(uri, null, "test2=test2; path=/; domain=example.com;", null);
|
|
do_check_eq(serv.getCookieString(uri, null), "test2=test2");
|
|
}
|