Chromium Code Reviews| Index: third_party/WebKit/LayoutTests/inspector/network/network-request-server-ip-address.html |
| diff --git a/third_party/WebKit/LayoutTests/inspector/network/network-request-server-ip-address.html b/third_party/WebKit/LayoutTests/inspector/network/network-request-server-ip-address.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..ec531799958e8231b74b5f6adc515e236a9e1dc2 |
| --- /dev/null |
| +++ b/third_party/WebKit/LayoutTests/inspector/network/network-request-server-ip-address.html |
| @@ -0,0 +1,41 @@ |
| +<html> |
| +<head> |
| +<script src="../../http/tests/inspector/inspector-test.js"></script> |
| +<script src="../../http/tests/inspector/network-test.js"></script> |
| +<script> |
| +function test() { |
| + function checkHAREntry (message, url, remoteAddress, port) { |
| + return new Promise(function (resolve) { |
|
caseq
2016/03/15 21:50:11
Why does it have to be a promise?
|
| + var request = new WebInspector.NetworkRequest(WebInspector.targetManager.mainTarget(), url, url, "", "", ""); |
| + request.setRemoteAddress(remoteAddress, port); |
| + |
| + var harBuild = new WebInspector.HAREntry(request).build(); |
| + |
| + InspectorTest.addResult(message); |
| + InspectorTest.addResult("Has cache: " + typeof harBuild.cache); |
| + InspectorTest.addResult("Has request: " + typeof harBuild.request); |
| + InspectorTest.addResult("Has response: " + typeof harBuild.response); |
| + |
| + InspectorTest.addResult("serverIPAddress: " + harBuild.serverIPAddress); |
| + |
| + InspectorTest.addResult("Has startedDateTime: " + typeof harBuild.startedDateTime); |
| + InspectorTest.addResult("Has time: " + typeof harBuild.time); |
| + InspectorTest.addResult("Has timings: " + typeof harBuild.timings); |
| + InspectorTest.addResult(""); |
| + |
| + resolve(); |
| + }); |
| + } |
| + |
| + Promise.all([ |
| + checkHAREntry("Checking IPv4", "http://127.0.0.1", "127.0.0.1", "80"), |
| + checkHAREntry("Checking IPv6", "http://localhost", "[[::1]]", "443") |
| + ]).then( () => InspectorTest.completeTest() ); |
| +} |
| + |
| +</script> |
| +</head> |
| +<body onload="runTest()"> |
| +<p>Tests HAR output format.</p> |
| +</body> |
| +</html> |