OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html> | 2 <html> |
3 <title>Checks that a user generated POST request does not circumvent third-party
cookie rules</title> | 3 <title>Checks that a user generated POST request does not circumvent third-party
cookie rules</title> |
4 <script> | 4 <script> |
5 if (window.testRunner) { | 5 if (window.testRunner) { |
6 testRunner.waitUntilDone(); | 6 testRunner.waitUntilDone(); |
7 testRunner.dumpAsText(); | 7 testRunner.dumpAsText(); |
8 testRunner.dumpChildFramesAsText(); | 8 testRunner.dumpChildFramesAsText(); |
9 | 9 |
10 // Start with a clean state, as otherwise an expired cookie for this domain
could affect behavior with CFNetwork. | 10 // Start with a clean state, as otherwise an expired cookie for this domain
could affect behavior with CFNetwork. |
11 // Can be removed once <rdar://problem/10080130> is fixed. | 11 // Can be removed once <rdar://problem/10080130> is fixed. |
12 if (testRunner.setPrivateBrowsingEnabled) | 12 if (testRunner.setPrivateBrowsingEnabled) |
13 testRunner.setPrivateBrowsingEnabled(true); | 13 testRunner.setPrivateBrowsingEnabled(true); |
14 | 14 |
15 testRunner.setAlwaysAcceptCookies(false); | 15 testRunner.setBlockThirdPartyCookies(true); |
16 } | 16 } |
17 | 17 |
18 function runTest() | 18 function runTest() |
19 { | 19 { |
20 if (window.eventSender) { | 20 if (window.eventSender) { |
21 // Click somewhere on the button! | 21 // Click somewhere on the button! |
22 var form = document.getElementById("form"); | 22 var form = document.getElementById("form"); |
23 eventSender.mouseMoveTo(form.offsetLeft + 5, form.offsetTop + 5); | 23 eventSender.mouseMoveTo(form.offsetLeft + 5, form.offsetTop + 5); |
24 eventSender.mouseDown(); | 24 eventSender.mouseDown(); |
25 eventSender.mouseUp(); | 25 eventSender.mouseUp(); |
26 } | 26 } |
27 } | 27 } |
28 </script> | 28 </script> |
29 <body onload="runTest()"> | 29 <body onload="runTest()"> |
30 <div> | 30 <div> |
31 <form id="form" action="http://localhost:8000/security/cookies/resources
/set-a-cookie.php" method="POST" target="iframe"> | 31 <form id="form" action="http://localhost:8000/security/cookies/resources
/set-a-cookie.php" method="POST" target="iframe"> |
32 <input type="submit" /> | 32 <input type="submit" /> |
33 </form> | 33 </form> |
34 <iframe src="javascript:false" name="iframe"></iframe> | 34 <iframe src="javascript:false" name="iframe"></iframe> |
35 </div> | 35 </div> |
36 </body> | 36 </body> |
37 </html> | 37 </html> |
OLD | NEW |