| 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() | 7 function performActions() |
| 8 { | 8 { |
| 9 var callback; | 9 var callback; |
| 10 var promise = new Promise((fulfill) => callback = fulfill); | 10 var promise = new Promise((fulfill) => callback = fulfill); |
| 11 var image = new Image(); | 11 var image = new Image(); |
| 12 image.onload = bar; | 12 image.onload = bar; |
| 13 image.src = "../resources/anImage.png"; | 13 image.src = "../resources/anImage.png"; |
| 14 | 14 |
| 15 function bar() | 15 function bar() |
| 16 { | 16 { |
| 17 var image = new Image(); | 17 var image = new Image(); |
| 18 image.onload = function(event) { callback(); } // do not pass event arg
ument to the callback. | 18 image.onload = function(event) { callback(); } // do not pass event arg
ument to the callback. |
| 19 image.src = "../resources/anotherImage.png"; | 19 image.src = "../resources/anotherImage.png"; |
| 20 } | 20 } |
| 21 return promise; | 21 return promise; |
| 22 } | 22 } |
| 23 | 23 |
| 24 function test() | 24 function test() |
| 25 { | 25 { |
| 26 WebInspector.TimelinePanel.show(); | 26 WebInspector.viewManager.showView("timeline"); |
| 27 WebInspector.panels.timeline._model._currentTarget = WebInspector.targetMana
ger.mainTarget(); | 27 WebInspector.panels.timeline._model._currentTarget = WebInspector.targetMana
ger.mainTarget(); |
| 28 WebInspector.panels.timeline._captureJSProfileSetting.set(false); | 28 WebInspector.panels.timeline._captureJSProfileSetting.set(false); |
| 29 InspectorTest.invokeAsyncWithTimeline("performActions", finish); | 29 InspectorTest.invokeAsyncWithTimeline("performActions", finish); |
| 30 | 30 |
| 31 function finish() | 31 function finish() |
| 32 { | 32 { |
| 33 var recordTypes = WebInspector.TimelineModel.RecordType; | 33 var recordTypes = WebInspector.TimelineModel.RecordType; |
| 34 var typesToDump = new Set([recordTypes.ResourceSendRequest, recordTypes.
ResourceReceiveResponse, recordTypes.ResourceReceivedData, recordTypes.ResourceF
inish, | 34 var typesToDump = new Set([recordTypes.ResourceSendRequest, recordTypes.
ResourceReceiveResponse, recordTypes.ResourceReceivedData, recordTypes.ResourceF
inish, |
| 35 recordTypes.EventDispatch, recordTypes.FunctionCall]); | 35 recordTypes.EventDispatch, recordTypes.FunctionCall]); |
| 36 function dumpEvent(traceEvent, level) | 36 function dumpEvent(traceEvent, level) |
| (...skipping 18 matching lines...) Expand all Loading... |
| 55 </script> | 55 </script> |
| 56 </head> | 56 </head> |
| 57 | 57 |
| 58 <body onload="runTest()"> | 58 <body onload="runTest()"> |
| 59 <p> | 59 <p> |
| 60 Tests the Timeline API instrumentation of a SendRequest, ReceiveResponse etc. | 60 Tests the Timeline API instrumentation of a SendRequest, ReceiveResponse etc. |
| 61 </p> | 61 </p> |
| 62 | 62 |
| 63 </body> | 63 </body> |
| 64 </html> | 64 </html> |
| OLD | NEW |