Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(511)

Side by Side Diff: third_party/WebKit/LayoutTests/http/tests/security/cookies/resources/set-a-cookie.php

Issue 2623423002: Add console warning and tests for strict secure cookies.
Patch Set: Update comment Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 <?php 1 <?php
2 setcookie("test_cookie", "1", 0, "/"); 2 $secure = false;
3 if ($_GET["secure"]) {
4 $secure = true;
5 }
6 setcookie("test_cookie", "1", 0, "/", "", $secure);
7
8 $resetcookie = "true";
9 if ($_GET["resetcookie"] == "false")
10 $resetcookie = "false";
11
12 $notifydone = "true";
13 if ($_GET["notifydone"] == "false")
14 $notifydone = "false";
3 ?> 15 ?>
4 <!DOCTYPE html> 16 <!DOCTYPE html>
5 <html> 17 <html>
6 <script> 18 <script>
7 function checkCookie() 19 function checkCookie()
8 { 20 {
9 if (document.cookie.indexOf("test_cookie=1") < 0) 21 if (document.cookie.indexOf("test_cookie=1") < 0)
10 document.getElementById("log").innerHTML += "Cookie is NOT set"; 22 document.getElementById("log").innerHTML += "Cookie is NOT set";
11 else 23 else
12 document.getElementById("log").innerHTML += "Cookie is set"; 24 document.getElementById("log").innerHTML += "Cookie is set";
13 document.cookie = "test_cookie=0; path=/; expires=Thu, 01-Jan-1970 00:00:01 GMT";
14 25
15 if (window.testRunner) 26 var reset_cookie = <?php echo($resetcookie); ?>;
27 if (reset_cookie)
28 document.cookie = "test_cookie=0; path=/; expires=Thu, 01-Jan-1970 00:00:0 1 GMT";
29
30 var notify_done = <?php echo $notifydone ?>;
31 if (notify_done && window.testRunner)
16 testRunner.notifyDone(); 32 testRunner.notifyDone();
17 } 33 }
18 </script> 34 </script>
19 <body onload="checkCookie()"> 35 <body onload="checkCookie()">
20 <div id="log"></div> 36 <div id="log"></div>
21 </body> 37 </body>
22 </html> 38 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698