| OLD | NEW |
| 1 <html> | 1 <html> |
| 2 <head> | 2 <head> |
| 3 <script src="../../http/tests/inspector/inspector-test.js"></script> | 3 <script src="../../http/tests/inspector/inspector-test.js"></script> |
| 4 <script type="text/javascript"> | 4 <script type="text/javascript"> |
| 5 | 5 |
| 6 function initialize_CookieTests() | 6 function initialize_CookieTests() |
| 7 { | 7 { |
| 8 | 8 |
| 9 InspectorTest.dumpCookie = function(cookie) | 9 InspectorTest.dumpCookie = function(cookie) |
| 10 { | 10 { |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 { | 39 { |
| 40 var parser = new SDK.CookieParser(); | 40 var parser = new SDK.CookieParser(); |
| 41 InspectorTest.addResult("source: " + header); | 41 InspectorTest.addResult("source: " + header); |
| 42 InspectorTest.dumpCookies(parser.parseSetCookie(header)); | 42 InspectorTest.dumpCookies(parser.parseSetCookie(header)); |
| 43 } | 43 } |
| 44 | 44 |
| 45 } | 45 } |
| 46 | 46 |
| 47 var test = function() | 47 var test = function() |
| 48 { | 48 { |
| 49 InspectorTest.addResult("Make sure we always add 1 byte for the trailing \\n
of the cookie (ie: 4 bytes)."); |
| 50 InspectorTest.addResult("Should be 4: " + (new SDK.CookieParser()).parseSetC
ookie("a=b")[0].size()); |
| 51 InspectorTest.addResult(""); |
| 52 |
| 49 InspectorTest.parseAndDumpCookie("cookie=value"); | 53 InspectorTest.parseAndDumpCookie("cookie=value"); |
| 50 InspectorTest.parseAndDumpCookie("$version=1; a=b,c = d, e=f"); | 54 InspectorTest.parseAndDumpCookie("$version=1; a=b,c = d, e=f"); |
| 51 InspectorTest.parseAndDumpCookie("$version=1; a=b;c = d; e =f"); | 55 InspectorTest.parseAndDumpCookie("$version=1; a=b;c = d; e =f"); |
| 52 InspectorTest.parseAndDumpCookie("cooke1 = value1; another cookie = another
value"); | 56 InspectorTest.parseAndDumpCookie("cooke1 = value1; another cookie = another
value"); |
| 53 InspectorTest.parseAndDumpCookie("cooke1 = value; $Path=/; $Domain=.example.
com;"); | 57 InspectorTest.parseAndDumpCookie("cooke1 = value; $Path=/; $Domain=.example.
com;"); |
| 54 InspectorTest.parseAndDumpCookie("cooke1 = value; $Path=/; $Domain=.example.
com ; Cookie2 = value2; $Path = /foo; $DOMAIN = foo.example.com;"); | 58 InspectorTest.parseAndDumpCookie("cooke1 = value; $Path=/; $Domain=.example.
com ; Cookie2 = value2; $Path = /foo; $DOMAIN = foo.example.com;"); |
| 55 InspectorTest.parseAndDumpCookie("cooke1 = value; $Path=/; $Domain=.example.
com\nCookie2 = value2; $Path = /foo; $DOMAIN = foo.example.com; "); | 59 InspectorTest.parseAndDumpCookie("cooke1 = value; $Path=/; $Domain=.example.
com\nCookie2 = value2; $Path = /foo; $DOMAIN = foo.example.com; "); |
| 56 InspectorTest.parseAndDumpCookie("$version =1; cooke1 = value; $Path=/; $Dom
ain =.example.com; \n Cookie2 = value2; $Path = /foo; $DOMAIN = foo.example.c
om;"); | 60 InspectorTest.parseAndDumpCookie("$version =1; cooke1 = value; $Path=/; $Dom
ain =.example.com; \n Cookie2 = value2; $Path = /foo; $DOMAIN = foo.example.c
om;"); |
| 57 | 61 |
| 58 InspectorTest.parseAndDumpSetCookie("cookie=value"); | 62 InspectorTest.parseAndDumpSetCookie("cookie=value"); |
| 59 InspectorTest.parseAndDumpSetCookie("a=b\n c=d\n f"); | 63 InspectorTest.parseAndDumpSetCookie("a=b\n c=d\n f"); |
| 60 InspectorTest.parseAndDumpSetCookie("cooke1 = value; Path=/; Domain=.example
.com;"); | 64 InspectorTest.parseAndDumpSetCookie("cooke1 = value; Path=/; Domain=.example
.com;"); |
| 61 InspectorTest.parseAndDumpSetCookie("cooke1 = value; Path=/; Domain= .examp
le.com \nCookie2 = value2; Path = /foo; Domain = foo.example.com"); | 65 InspectorTest.parseAndDumpSetCookie("cooke1 = value; Path=/; Domain= .examp
le.com \nCookie2 = value2; Path = /foo; Domain = foo.example.com"); |
| 62 InspectorTest.parseAndDumpSetCookie("cooke1 = value; expires = Mon, Oct 18 2
010 17:00 GMT+0000; Domain =.example.com\nCookie2 = value2; Path = /foo; DOMAI
N = foo.example.com; HttpOnly; Secure; Discard;"); | 66 InspectorTest.parseAndDumpSetCookie("cooke1 = value; expires = Mon, Oct 18 2
010 17:00 GMT+0000; Domain =.example.com\nCookie2 = value2; Path = /foo; DOMAI
N = foo.example.com; HttpOnly; Secure; Discard;"); |
| 63 InspectorTest.parseAndDumpSetCookie("cooke1 = value; max-age= 1440; Domain
=.example.com\n Cookie2 = value2; Path = /foo; DOMAIN = foo.example.com; HttpOn
ly; Secure; Discard;"); | 67 InspectorTest.parseAndDumpSetCookie("cooke1 = value; max-age= 1440; Domain
=.example.com\n Cookie2 = value2; Path = /foo; DOMAIN = foo.example.com; HttpOn
ly; Secure; Discard;"); |
| 64 InspectorTest.parseAndDumpSetCookie("cooke1 = value; HttpOnly; Secure; SameS
ite=Lax;"); | 68 InspectorTest.parseAndDumpSetCookie("cooke1 = value; HttpOnly; Secure; SameS
ite=Lax;"); |
| 65 InspectorTest.parseAndDumpSetCookie("cooke1 = value; HttpOnly; Secure; SameS
ite=Secure;"); | 69 InspectorTest.parseAndDumpSetCookie("cooke1 = value; HttpOnly; Secure; SameS
ite=Secure;"); |
| 66 InspectorTest.parseAndDumpSetCookie("cooke1; Path=/; Domain=.example.com;"); | 70 InspectorTest.parseAndDumpSetCookie("cooke1; Path=/; Domain=.example.com;"); |
| 67 InspectorTest.parseAndDumpSetCookie("cooke1=; Path=/; Domain=.example.com;")
; | 71 InspectorTest.parseAndDumpSetCookie("cooke1=; Path=/; Domain=.example.com;")
; |
| 68 InspectorTest.completeTest(); | 72 InspectorTest.completeTest(); |
| 69 } | 73 } |
| 70 | 74 |
| 71 </script> | 75 </script> |
| 72 </head> | 76 </head> |
| 73 <body onload="runTest()"> | 77 <body onload="runTest()"> |
| 74 <p>Tests inspector cookie parser</p> | 78 <p>Tests inspector cookie parser</p> |
| 75 </body> | 79 </body> |
| 76 </html> | 80 </html> |
| OLD | NEW |