content/html/content/test/test_bug643051.html
author Jonathan Kew <jfkthame@gmail.com>
Fri, 08 Apr 2011 20:27:04 -0700
changeset 67732 865870bbe148350378c25b23244138a802387417
parent 67729 bf3bdd1d967164e068aed53d2ef9135df8d9980b
child 67733 a998aa8043f1294bf7db0964d730f75885669ef7
permissions -rw-r--r--
Backed out changeset bf3bdd1d9671 for failing to fix the test failure

<!DOCTYPE HTML>
<html>
<!--
https://bugzilla.mozilla.org/show_bug.cgi?id=643051
-->
<head>
  <title>Test for Bug 643051</title>
  <script type="application/javascript" src="/MochiKit/packed.js"></script>
  <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
</head>
<body>
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=643051">Mozilla Bug 643051</a>
<p id="display"></p>
<div id="content" style="display: none">
  
</div>
<pre id="test">
<script type="application/javascript">

/** Test for Bug 643051 **/
document.cookie = "foo=; expires=Thu, 01-Jan-1970 00:00:01 GMT";  // clear cookie
document.cookie = "foo2=; expires=Thu, 01-Jan-1970 00:00:01 GMT";  // clear cookie
document.cookie = "foo3=; expires=Thu, 01-Jan-1970 00:00:01 GMT";  // clear cookie

// single cookie, should work
document.cookie = "foo=bar";
is(document.cookie, "foo=bar", "Can't read stored cookie!");

document.cookie = "foo2=bar\nfoo3=bar";
is(document.cookie, "foo=bar; foo2=bar", "Wrong cookie value");

document.cookie = "foo2=baz; foo3=bar";
is(document.cookie, "foo=bar; foo2=baz", "Wrong cookie value");

</script>
</pre>
</body>
</html>