Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / http / tests / cookies / js-get-and-set-http-only-cookie.html
blobb3ca014ba133fea4a129e95a09d612d851922494
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <link rel="stylesheet" href="resources/cookies-test-style.css">
5 <script src="resources/cookies-test-pre.js"></script>
6 </head>
7 <body>
8 <p id="description"></p>
9 <div id="console"></div>
10 <script>
11 description(
12 'Test for &lt;<a href="https://bugs.webkit.org/show_bug.cgi?id=86067">https://bugs.webkit.org/show_bug.cgi?id=86067</a>&gt; [BlackBerry] Possible to clobber httpOnly cookie.'
15 clearAllCookies();
17 debug("Check that we can't get or set httpOnly Cookies by JavaScript.");
18 setCookies("httpOnlyCookie=value; Max-Age=900000000; path=/; httpOnly");
20 if (document.cookie == "httpOnlyCookie=value")
21 testFailed("We shouldn't get httpOnly cookies by JavaScript.");
22 else
23 testPassed("We can't get httpOnly cookies by JavaScript.");
25 document.cookie = "httpOnlyCookie=changedValue; path=/";
26 if (document.cookie == "httpOnlyCookie=changedValue")
27 testFailed("We shouldn't set httpOnly cookies by JavaScript.");
28 else
29 testPassed("We can't set httpOnly cookies by JavaScript.");
31 clearCookies();
33 successfullyParsed = true;
34 </script>
35 <script src="resources/cookies-test-post.js"></script>
36 </body>
37 </html>