Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 <html> | |
| 2 <head> | |
| 3 <script src="../../http/tests/inspector/inspector-test.js"></script> | |
| 4 <script src="../../http/tests/inspector/network-test.js"></script> | |
| 5 <script> | |
| 6 function test() { | |
| 7 function checkHAREntry (message, url, remoteAddress, port) { | |
| 8 return new Promise(function (resolve) { | |
|
caseq
2016/03/15 21:50:11
Why does it have to be a promise?
| |
| 9 var request = new WebInspector.NetworkRequest(WebInspector.targetMan ager.mainTarget(), url, url, "", "", ""); | |
| 10 request.setRemoteAddress(remoteAddress, port); | |
| 11 | |
| 12 var harBuild = new WebInspector.HAREntry(request).build(); | |
| 13 | |
| 14 InspectorTest.addResult(message); | |
| 15 InspectorTest.addResult("Has cache: " + typeof harBuild.cache); | |
| 16 InspectorTest.addResult("Has request: " + typeof harBuild.request); | |
| 17 InspectorTest.addResult("Has response: " + typeof harBuild.response) ; | |
| 18 | |
| 19 InspectorTest.addResult("serverIPAddress: " + harBuild.serverIPAddre ss); | |
| 20 | |
| 21 InspectorTest.addResult("Has startedDateTime: " + typeof harBuild.st artedDateTime); | |
| 22 InspectorTest.addResult("Has time: " + typeof harBuild.time); | |
| 23 InspectorTest.addResult("Has timings: " + typeof harBuild.timings); | |
| 24 InspectorTest.addResult(""); | |
| 25 | |
| 26 resolve(); | |
| 27 }); | |
| 28 } | |
| 29 | |
| 30 Promise.all([ | |
| 31 checkHAREntry("Checking IPv4", "http://127.0.0.1", "127.0.0.1", "80"), | |
| 32 checkHAREntry("Checking IPv6", "http://localhost", "[[::1]]", "443") | |
| 33 ]).then( () => InspectorTest.completeTest() ); | |
| 34 } | |
| 35 | |
| 36 </script> | |
| 37 </head> | |
| 38 <body onload="runTest()"> | |
| 39 <p>Tests HAR output format.</p> | |
| 40 </body> | |
| 41 </html> | |
| OLD | NEW |