| OLD | NEW |
| 1 <html> | 1 <html> |
| 2 <head> | 2 <head> |
| 3 <script src="resource-test2.js"></script> | 3 <script src="resource-test2.js"></script> |
| 4 <script src="inspector-test2.js"></script> | 4 <script src="inspector-test2.js"></script> |
| 5 | 5 |
| 6 <script> | 6 <script> |
| 7 | 7 |
| 8 var test = function() | 8 var test = function() |
| 9 { | 9 { |
| 10 function addCookieHeadersToResource(resource) | 10 function addCookieHeadersToResource(resource) |
| 11 { | 11 { |
| 12 resource.requestHeaders = { | 12 resource.requestHeaders = { |
| 13 "Cookie": "a=b; $Path=/path; $Domain=example.com; a1=b1\nc1=d1" | 13 "Cookie": "a=b; $Path=/path; $Domain=example.com; a1=b1\nc1=d1" |
| 14 }; | 14 }; |
| 15 resource.responseHeaders = { | 15 resource.responseHeaders = { |
| 16 "Set-Cookie": "x=y; Path=/path; Domain=example.com; Discard; httpOnl
y; Secure; Version=1\nx1=y1\nz2=y2" | 16 "Set-Cookie": "x=y; Path=/path; Domain=example.com; Discard; httpOnl
y; Secure; Version=1\nx1=y1\nz2=y2" |
| 17 }; | 17 }; |
| 18 } | 18 } |
| 19 | 19 |
| 20 function findResourceByURL(url) | 20 function findResourceByURL(url) |
| 21 { | 21 { |
| 22 for (var id in WebInspector.networkResources) { | 22 for (var id in WebInspector.networkResources) { |
| 23 if (url.test(WebInspector.networkResources[id].url)) | 23 if (url.test(WebInspector.networkResources[id].url)) |
| 24 return WebInspector.networkResources[id]; | 24 return WebInspector.networkResources[id]; |
| 25 } | 25 } |
| 26 } | 26 } |
| 27 | 27 |
| 28 InspectorTest.reloadPageIfNeeded(function() { | 28 InspectorTest.reloadPageIfNeeded(function() { |
| 29 InspectorBackend.evaluate("doXHR()", "console", function() { | 29 InspectorBackend.evaluate("doXHR()", "console", false, function() { |
| 30 addCookieHeadersToResource(findResourceByURL(/inspector-test2\.js$/)
); | 30 addCookieHeadersToResource(findResourceByURL(/inspector-test2\.js$/)
); |
| 31 var entries = (new WebInspector.HARLog()).build().entries; | 31 var entries = (new WebInspector.HARLog()).build().entries; |
| 32 entries.sort(InspectorTest.resourceURLComparer); | 32 entries.sort(InspectorTest.resourceURLComparer); |
| 33 InspectorTest.addObject(entries, InspectorTest.HARNondeterministicPr
opertiesWithSize); | 33 InspectorTest.addObject(entries, InspectorTest.HARNondeterministicPr
opertiesWithSize); |
| 34 InspectorTest.completeTest(); | 34 InspectorTest.completeTest(); |
| 35 }); | 35 }); |
| 36 }); | 36 }); |
| 37 } | 37 } |
| 38 | 38 |
| 39 // Make a POST requests to see we handle non-post form data well. | 39 // Make a POST requests to see we handle non-post form data well. |
| (...skipping 11 matching lines...) Expand all Loading... |
| 51 | 51 |
| 52 </head> | 52 </head> |
| 53 | 53 |
| 54 <body onload="runTest()"> | 54 <body onload="runTest()"> |
| 55 <p> | 55 <p> |
| 56 Tests conversion of Inspector's resource representation into HAR format. | 56 Tests conversion of Inspector's resource representation into HAR format. |
| 57 </p> | 57 </p> |
| 58 | 58 |
| 59 </body> | 59 </body> |
| 60 </html> | 60 </html> |
| OLD | NEW |