3 <script src=
"../../http/tests/inspector/inspector-test.js"></script>
4 <script src=
"../../http/tests/inspector/network-test.js"></script>
8 var requestsToWatch
= /\/network-test\.js$|\/non-existent-file.js$|^data:application\/javascript,|/;
11 function dumpRequests()
13 var logView
= WebInspector
.panels
.network
._networkLogView
;
15 var dataGrid
= logView
.element
.querySelector("table.data");
16 var urls
= document
.evaluate("//tbody/tr/td[position()=1]/@title", dataGrid
, null, XPathResult
.ORDERED_NODE_SNAPSHOT_TYPE
, null);
17 var outputStrings
= [];
19 for (var request
of WebInspector
.targetManager
.mainTarget().networkLog
._requests
) {
20 var line
= request
.displayName
+ ":" + request
.statusCode
+ " " + request
.statusText
23 else if (request
.finished
)
25 InspectorTest
.addResult(line
);
27 InspectorTest
.completeTest();
30 function onRequestFinished(request
)
32 if (!requestsToWatch
.test(request
.url
))
34 if (++seenRequests
=== 3)
35 setTimeout(dumpRequests
);
38 InspectorTest
.networkManager
.addEventListener(WebInspector
.NetworkManager
.EventTypes
.RequestFinished
, onRequestFinished
);
39 InspectorTest
.recordNetwork();
40 InspectorTest
.evaluateInPage("loadResources()");
43 function addScriptElement(src
)
45 var element
= document
.createElement("script");
47 document
.body
.appendChild(element
);
50 function loadResources()
52 addScriptElement("../../http/tests/inspector/network-test.js");
53 addScriptElement("non-existent-file.js");
55 // Test that data-url doesn't appear in network panel.
56 addScriptElement("data:application/javascript,var x = 0;");
61 <body onload=
"runTest()">