| 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 var image = new Image(); | 9 var image = new Image(); |
| 10 image.onload = bar; | 10 image.onload = bar; |
| 11 image.src = "resources/anImage.png"; | 11 image.src = "resources/anImage.png"; |
| 12 | 12 |
| 13 function bar() | 13 function bar() |
| 14 { | 14 { |
| 15 var image = new Image(); | 15 var image = new Image(); |
| 16 image.onload = function(event) { callback(); } // do not pass event arg
ument to the callback. | 16 image.onload = function(event) { callback(); } // do not pass event arg
ument to the callback. |
| 17 image.src = "resources/anotherImage.png"; | 17 image.src = "resources/anotherImage.png"; |
| 18 } | 18 } |
| 19 } | 19 } |
| 20 | 20 |
| 21 function test() | 21 function test() |
| 22 { | 22 { |
| 23 WebInspector.TimelinePanel.show(); | 23 WebInspector.TimelinePanel.show(); |
| 24 WebInspector.panels.timeline._model._currentTarget = WebInspector.targetMana
ger.mainTarget(); | 24 WebInspector.panels.timeline._model._currentTarget = WebInspector.targetMana
ger.mainTarget(); |
| 25 InspectorTest.invokeAsyncWithTimeline("performActions", finish); | 25 InspectorTest.invokeAsyncWithTimeline("performActions", finish); |
| 26 | 26 |
| 27 function finish() | 27 function finish() |
| 28 { | 28 { |
| 29 var recordTypes = WebInspector.TimelineModel.RecordType; | 29 var recordTypes = WebInspector.TimelineModel.RecordType; |
| 30 var typesToDump = new Set([recordTypes.ResourceSendRequest, recordTypes.
ResourceReceiveResponse, recordTypes.ResourceReceivedData, recordTypes.ResourceF
inish, | 30 var typesToDump = new Set([recordTypes.ResourceFetcherRequestResource, r
ecordTypes.ResourceDispatcherOnReceivedResponse, recordTypes.ResourceDispatcherO
nReceivedData, recordTypes.ResourceDispatcherOnRequestComplete, |
| 31 recordTypes.EventDispatch, recordTypes.FunctionCall]); | 31 recordTypes.EventDispatch, recordTypes.FunctionCall]); |
| 32 function dumpFormattedRecord(presentationRecord, prefix) | 32 function dumpFormattedRecord(presentationRecord, prefix) |
| 33 { | 33 { |
| 34 var record = presentationRecord.record(); | 34 var record = presentationRecord.record(); |
| 35 prefix = prefix || ""; | 35 prefix = prefix || ""; |
| 36 // Ignore stray paint & rendering events for better stability. | 36 // Ignore stray paint & rendering events for better stability. |
| 37 var categoryName = WebInspector.TimelineUIUtils.categoryForRecord(re
cord).name; | 37 var categoryName = WebInspector.TimelineUIUtils.categoryForRecord(re
cord).name; |
| 38 if (categoryName !== "loading" && categoryName !== "scripting") | 38 if (categoryName !== "loading" && categoryName !== "scripting") |
| 39 return; | 39 return; |
| 40 var childPrefix = prefix; | 40 var childPrefix = prefix; |
| (...skipping 22 matching lines...) Expand all Loading... |
| 63 </script> | 63 </script> |
| 64 </head> | 64 </head> |
| 65 | 65 |
| 66 <body onload="runTest()"> | 66 <body onload="runTest()"> |
| 67 <p> | 67 <p> |
| 68 Tests the Timeline API instrumentation of a SendRequest, ReceiveResponse etc. | 68 Tests the Timeline API instrumentation of a SendRequest, ReceiveResponse etc. |
| 69 </p> | 69 </p> |
| 70 | 70 |
| 71 </body> | 71 </body> |
| 72 </html> | 72 </html> |
| OLD | NEW |