| OLD | NEW |
| 1 <html> | 1 <html> |
| 2 <head> | 2 <head> |
| 3 <script src="../inspector-test.js"></script> | 3 <script src="../inspector-test.js"></script> |
| 4 <script src="../timeline-test.js"></script> | 4 <script src="../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 // Use random urls to avoid caching. |
| 14 const random = Math.random(); |
| 15 image.src = "resources/anImage.png?random=" + random; |
| 14 | 16 |
| 15 function bar() | 17 function bar() |
| 16 { | 18 { |
| 17 var image = new Image(); | 19 var image = new Image(); |
| 18 image.onload = function(event) { callback(); } // do not pass event arg
ument to the callback. | 20 image.onload = function(event) { callback(); } // do not pass event arg
ument to the callback. |
| 19 image.src = "resources/anotherImage.png"; | 21 image.src = "resources/anotherImage.png?random=" + random; |
| 20 } | 22 } |
| 21 return promise; | 23 return promise; |
| 22 } | 24 } |
| 23 | 25 |
| 24 function test() | 26 function test() |
| 25 { | 27 { |
| 26 UI.viewManager.showView("timeline"); | 28 UI.viewManager.showView("timeline"); |
| 27 UI.panels.timeline._model._currentTarget = SDK.targetManager.mainTarget(); | 29 UI.panels.timeline._model._currentTarget = SDK.targetManager.mainTarget(); |
| 28 UI.panels.timeline._captureJSProfileSetting.set(false); | 30 UI.panels.timeline._captureJSProfileSetting.set(false); |
| 29 InspectorTest.invokeAsyncWithTimeline("performActions", finish); | 31 InspectorTest.invokeAsyncWithTimeline("performActions", finish); |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 </script> | 66 </script> |
| 65 </head> | 67 </head> |
| 66 | 68 |
| 67 <body onload="runTest()"> | 69 <body onload="runTest()"> |
| 68 <p> | 70 <p> |
| 69 Tests the Timeline API instrumentation of a SendRequest, ReceiveResponse etc. | 71 Tests the Timeline API instrumentation of a SendRequest, ReceiveResponse etc. |
| 70 </p> | 72 </p> |
| 71 | 73 |
| 72 </body> | 74 </body> |
| 73 </html> | 75 </html> |
| OLD | NEW |