| 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 src="../../http/tests/inspector/timeline-test.js"></script> | 4 <script src="../../http/tests/inspector/timeline-test.js"></script> |
| 5 <script> | 5 <script> |
| 6 | 6 |
| 7 function performActions(callback) | 7 function performActions(callback) |
| 8 { | 8 { |
| 9 function onRequestFinished() | 9 function onRequestFinished() |
| 10 { | 10 { |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 } | 24 } |
| 25 | 25 |
| 26 function test() | 26 function test() |
| 27 { | 27 { |
| 28 var model = WebInspector.panels.timeline._model; | 28 var model = WebInspector.panels.timeline._model; |
| 29 | 29 |
| 30 InspectorTest.invokeAsyncWithTimeline("performActions", finish); | 30 InspectorTest.invokeAsyncWithTimeline("performActions", finish); |
| 31 | 31 |
| 32 function finish() | 32 function finish() |
| 33 { | 33 { |
| 34 var linkifier = new WebInspector.Linkifier(); |
| 34 function printRequestDetails(request) | 35 function printRequestDetails(request) |
| 35 { | 36 { |
| 36 return WebInspector.TimelineUIUtils.buildNetworkRequestDetails(reque
st, model, null).then(printElement); | 37 return WebInspector.TimelineUIUtils.buildNetworkRequestDetails(reque
st, model, linkifier).then(printElement); |
| 37 } | 38 } |
| 38 function printElement(element) | 39 function printElement(element) |
| 39 { | 40 { |
| 40 var rows = element.querySelectorAll(".timeline-details-view-row"); | 41 var rows = element.querySelectorAll(".timeline-details-view-row"); |
| 41 for (var i = 0; i < rows.length; ++i) { | 42 for (var i = 0; i < rows.length; ++i) { |
| 42 var title = rows[i].firstChild.firstChild.textContent; | 43 var title = rows[i].firstChild.firstChild.textContent; |
| 43 var value = rows[i].lastChild.firstChild.textContent; | 44 var value = rows[i].lastChild.firstChild.textContent; |
| 44 if (title === "Duration" || title === "Mime Type") | 45 if (title === "Duration" || title === "Mime Type") |
| 45 value = typeof value; | 46 value = typeof value; |
| 46 if (title === "URL") | 47 if (/^file:\/\//.test(value)) |
| 47 value = /[^/]*$/.exec(value)[0]; | 48 value = /[^/]*$/.exec(value)[0]; |
| 48 InspectorTest.addResult(title + ": " + value); | 49 InspectorTest.addResult(title + ": " + value); |
| 49 } | 50 } |
| 50 } | 51 } |
| 51 Promise.all(model.networkRequests().map(printRequestDetails)).then(Inspe
ctorTest.completeTest); | 52 Promise.all(model.networkRequests().map(printRequestDetails)).then(Inspe
ctorTest.completeTest); |
| 52 } | 53 } |
| 53 } | 54 } |
| 54 | 55 |
| 55 </script> | 56 </script> |
| 56 </head> | 57 </head> |
| 57 | 58 |
| 58 <body onload="runTest()"> | 59 <body onload="runTest()"> |
| 59 <p> | 60 <p> |
| 60 Tests the Timeline UI API for network requests. | 61 Tests the Timeline UI API for network requests. |
| 61 </p> | 62 </p> |
| 62 </body> | 63 </body> |
| 63 </html> | 64 </html> |
| OLD | NEW |