| 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 var scriptUrl = "timeline-network-resource.js"; | 7 var scriptUrl = "timeline-network-resource.js"; |
| 8 | 8 |
| 9 function performActions(callback) | 9 function performActions(callback) |
| 10 { | 10 { |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 var model = WebInspector.panels.timeline._model; | 22 var model = WebInspector.panels.timeline._model; |
| 23 var presentationModel = InspectorTest.timelinePresentationModel(); | 23 var presentationModel = InspectorTest.timelinePresentationModel(); |
| 24 | 24 |
| 25 InspectorTest.invokeAsyncWithTimeline("performActions", finish); | 25 InspectorTest.invokeAsyncWithTimeline("performActions", finish); |
| 26 | 26 |
| 27 function finish() | 27 function finish() |
| 28 { | 28 { |
| 29 var lastRecordStartTime; | 29 var lastRecordStartTime; |
| 30 function format(record) | 30 function format(record) |
| 31 { | 31 { |
| 32 if (record.type() === WebInspector.TimelineModel.RecordType.Resource
SendRequest) | 32 if (record.type() === WebInspector.TimelineModel.RecordType.Resource
FetcherRequestResource) |
| 33 printSend(record); | 33 printSend(record); |
| 34 else if (record.type() === WebInspector.TimelineModel.RecordType.Res
ourceReceiveResponse) | 34 else if (record.type() === WebInspector.TimelineModel.RecordType.Res
ourceDispatcherOnReceivedResponse) |
| 35 printReceive(record); | 35 printReceive(record); |
| 36 else if (record.type() === WebInspector.TimelineModel.RecordType.Res
ourceFinish) | 36 else if (record.type() === WebInspector.TimelineModel.RecordType.Res
ourceDispatcherOnRequestComplete) |
| 37 printFinish(record); | 37 printFinish(record); |
| 38 | 38 |
| 39 var presentationRecord = presentationModel.toPresentationRecord(reco
rd); | 39 var presentationRecord = presentationModel.toPresentationRecord(reco
rd); |
| 40 if (presentationRecord && record.thread() === WebInspector.TimelineM
odel.MainThreadName) { | 40 if (presentationRecord && record.thread() === WebInspector.TimelineM
odel.MainThreadName) { |
| 41 var parentIsRoot = presentationRecord.presentationParent() && !p
resentationRecord.presentationParent().presentationParent(); | 41 var parentIsRoot = presentationRecord.presentationParent() && !p
resentationRecord.presentationParent().presentationParent(); |
| 42 if (parentIsRoot) { | 42 if (parentIsRoot) { |
| 43 if (lastRecordStartTime) | 43 if (lastRecordStartTime) |
| 44 InspectorTest.assertGreaterOrEqual(record.startTime(), l
astRecordStartTime, "Top level records order violation"); | 44 InspectorTest.assertGreaterOrEqual(record.startTime(), l
astRecordStartTime, "Top level records order violation"); |
| 45 lastRecordStartTime = record.startTime(); | 45 lastRecordStartTime = record.startTime(); |
| 46 } | 46 } |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 | 91 |
| 92 </script> | 92 </script> |
| 93 </head> | 93 </head> |
| 94 | 94 |
| 95 <body onload="runTest()"> | 95 <body onload="runTest()"> |
| 96 <p> | 96 <p> |
| 97 Tests the Timeline API instrumentation of a network resource load | 97 Tests the Timeline API instrumentation of a network resource load |
| 98 </p> | 98 </p> |
| 99 </body> | 99 </body> |
| 100 </html> | 100 </html> |
| OLD | NEW |