diff options
Diffstat (limited to 'LayoutTests/http/tests/cookies/script-tests/simple-cookies-expired.js')
-rw-r--r-- | LayoutTests/http/tests/cookies/script-tests/simple-cookies-expired.js | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/LayoutTests/http/tests/cookies/script-tests/simple-cookies-expired.js b/LayoutTests/http/tests/cookies/script-tests/simple-cookies-expired.js new file mode 100644 index 0000000..61b70fb --- /dev/null +++ b/LayoutTests/http/tests/cookies/script-tests/simple-cookies-expired.js @@ -0,0 +1,18 @@ +description( +"This test checks that cookies are correctly set using Expires." +); + +clearAllCookies(); + +debug("Check that setting a simple cookie works."); +var date = new Date(); +date.setTime(date.getTime() + 60 * 1000); +cookiesShouldBe("test=foobar; Expires=" + date.toGMTString(), "test=foobar"); +clearCookies(); + +debug("Check setting a cookie that timed out."); +date.setTime(date.getTime() - 2 * 60 * 1000); +cookiesShouldBe("test2=foobar; Expires=" + date.toGMTString(), ""); +clearCookies(); + +successfullyParsed = true; |