| OLD | NEW |
| 1 <!doctype html> | 1 <!doctype html> |
| 2 <html> | 2 <html> |
| 3 <head> | 3 <head> |
| 4 <script src="../inspector-test.js"></script> | 4 <script src="../inspector-test.js"></script> |
| 5 <script src="../network-test.js"></script> | 5 <script src="../network-test.js"></script> |
| 6 | 6 |
| 7 <script> | 7 <script> |
| 8 var test = function() | 8 var test = function() |
| 9 { | 9 { |
| 10 function step1() | 10 InspectorTest.NetworkAgent.setCacheDisabled(true, sendCSSRequest); |
| 11 |
| 12 function sendCSSRequest() |
| 11 { | 13 { |
| 12 InspectorTest.makeSimpleXHR("GET", "resources/binary.data", false, step2
); | 14 InspectorTest.makeSimpleXHR("GET", "resources/initiator.css", false, sen
dBinaryRequest); |
| 13 } | 15 } |
| 14 | 16 |
| 15 function step2() | 17 function sendBinaryRequest() |
| 18 { |
| 19 InspectorTest.makeSimpleXHR("GET", "resources/binary.data", false, makeH
AR); |
| 20 } |
| 21 |
| 22 function makeHAR() |
| 16 { | 23 { |
| 17 var writer = new Network.HARWriter(); | 24 var writer = new Network.HARWriter(); |
| 18 var stream = new InspectorTest.StringOutputStream(onSaved); | 25 var stream = new InspectorTest.StringOutputStream(onSaved); |
| 19 writer.write(stream, InspectorTest.networkRequests(), new Common.Progres
s()); | 26 writer.write(stream, InspectorTest.networkRequests(), new Common.Progres
s()); |
| 20 } | 27 } |
| 21 | 28 |
| 22 function dumpContent(content) | 29 function dumpContent(content) |
| 23 { | 30 { |
| 24 if (!content) { | 31 if (!content) { |
| 25 InspectorTest.addResult(" NOT FOUND"); | 32 InspectorTest.addResult(" NOT FOUND"); |
| (...skipping 26 matching lines...) Expand all Loading... |
| 52 { | 59 { |
| 53 var entries = har.log.entries; | 60 var entries = har.log.entries; |
| 54 for (var i = 0; i < entries.length; ++i) { | 61 for (var i = 0; i < entries.length; ++i) { |
| 55 var entry = entries[i]; | 62 var entry = entries[i]; |
| 56 if (regexp.test(entry.request.url)) | 63 if (regexp.test(entry.request.url)) |
| 57 return entry; | 64 return entry; |
| 58 } | 65 } |
| 59 InspectorTest.addResult("FAIL: can't find resource for " + regexp); | 66 InspectorTest.addResult("FAIL: can't find resource for " + regexp); |
| 60 return null; | 67 return null; |
| 61 } | 68 } |
| 62 | |
| 63 InspectorTest.makeSimpleXHR("GET", "resources/initiator.css", false, step1); | |
| 64 } | 69 } |
| 65 </script> | 70 </script> |
| 66 | 71 |
| 67 | 72 |
| 68 </head> | 73 </head> |
| 69 | 74 |
| 70 <body onload="runTest()"> | 75 <body onload="runTest()"> |
| 71 <p> | 76 <p> |
| 72 Tests conversion of Inspector's resource representation into HAR format. | 77 Tests conversion of Inspector's resource representation into HAR format. |
| 73 </p> | 78 </p> |
| 74 | 79 |
| 75 </body> | 80 </body> |
| 76 </html> | 81 </html> |
| OLD | NEW |