| 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 var test = function() | 6 var test = function() |
| 7 { | 7 { |
| 8 var logView = WebInspector.inspectorView.panel("network")._networkLogView; | 8 var logView = WebInspector.inspectorView.panel("network")._networkLogView; |
| 9 | 9 |
| 10 function newRequest(headers, data, opt_url) | 10 function newRequest(headers, data, opt_url) |
| 11 { | 11 { |
| 12 var request = new WebInspector.NetworkRequest(WebInspector.targetManager
.activeTarget(), 0, opt_url || 'http://example.org/path', 0, 0, 0); | 12 var request = new WebInspector.NetworkRequest(WebInspector.targetManager
.mainTarget(), 0, opt_url || 'http://example.org/path', 0, 0, 0); |
| 13 request.requestMethod = data ? "POST" : "GET"; | 13 request.requestMethod = data ? "POST" : "GET"; |
| 14 var headerList = []; | 14 var headerList = []; |
| 15 if (headers) { | 15 if (headers) { |
| 16 for (var i in headers) | 16 for (var i in headers) |
| 17 headerList.push({name: i, value: headers[i]}); | 17 headerList.push({name: i, value: headers[i]}); |
| 18 } | 18 } |
| 19 if (data) { | 19 if (data) { |
| 20 headerList.push({name: "Content-Length", value: data.length}); | 20 headerList.push({name: "Content-Length", value: data.length}); |
| 21 request.requestFormData = data; | 21 request.requestFormData = data; |
| 22 } | 22 } |
| (...skipping 19 matching lines...) Expand all Loading... |
| 42 | 42 |
| 43 InspectorTest.completeTest(); | 43 InspectorTest.completeTest(); |
| 44 } | 44 } |
| 45 | 45 |
| 46 </script> | 46 </script> |
| 47 </head> | 47 </head> |
| 48 <body onload="runTest()"> | 48 <body onload="runTest()"> |
| 49 <p>Tests curl command generation</p> | 49 <p>Tests curl command generation</p> |
| 50 </body> | 50 </body> |
| 51 </html> | 51 </html> |
| OLD | NEW |