test_document_cookie.html (604B)
1 <!DOCTYPE HTML> 2 <html> 3 <head> 4 <title>Test for document.cookie when the policy changes</title> 5 <script src="/tests/SimpleTest/SimpleTest.js"></script> 6 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/> 7 <script type="application/javascript" src="cookiesHelper.js"></script> 8 </head> 9 <body> 10 <script type="application/javascript"> 11 12 runTests(async (w, state) => { 13 is(w.document.cookie.length, 0, "No cookie to start!"); 14 w.document.cookie = "name=value"; 15 is(w.document.cookie.includes("name=value"), state == ALLOWED, "Some cookies for me"); 16 }); 17 18 </script> 19 </body> 20 </html>