| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <html> | 2 <html> |
| 3 <title>Checks that a script generated POST request does not circumvent third-par
ty cookie rules</title> | 3 <title>Checks that a script generated POST request does not circumvent third-par
ty 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 document.getElementById('form').submit(); | 20 document.getElementById('form').submit(); |
| 21 } | 21 } |
| 22 </script> | 22 </script> |
| 23 <body onload="runTest()"> | 23 <body onload="runTest()"> |
| 24 <div> | 24 <div> |
| 25 <form id="form" action="http://localhost:8000/security/cookies/resources
/set-a-cookie.php" method="POST" target="iframe"> | 25 <form id="form" action="http://localhost:8000/security/cookies/resources
/set-a-cookie.php" method="POST" target="iframe"> |
| 26 <input type="submit" /> | 26 <input type="submit" /> |
| 27 </form> | 27 </form> |
| 28 <iframe src="javascript:false" name="iframe"></iframe> | 28 <iframe src="javascript:false" name="iframe"></iframe> |
| 29 </div> | 29 </div> |
| 30 </body> | 30 </body> |
| 31 </html> | 31 </html> |
| OLD | NEW |