Chromium Code Reviews| 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() |
| 8 { | 8 { |
| 9 var callback; | |
| 10 var promise = new Promise((fulfill) => callback = fulfill); | |
| 9 window.callWhenDone = callback; | 11 window.callWhenDone = callback; |
|
caseq
2016/08/05 17:56:43
assign directly within new Promise(...)
kozy
2016/08/10 01:21:15
Done.
| |
| 10 var content = "" + | 12 var content = "" + |
| 11 "var fn2 = function() {" + | 13 "var fn2 = function() {" + |
| 12 " console.markTimeline(\"Script evaluated\");" + | 14 " console.markTimeline(\"Script evaluated\");" + |
| 13 " window.callWhenDone();" + | 15 " window.callWhenDone();" + |
| 14 "};\\n" + | 16 "};\\n" + |
| 15 "var fn1 = function() {" + | 17 "var fn1 = function() {" + |
| 16 " window.setTimeout(fn2, 1);" + | 18 " window.setTimeout(fn2, 1);" + |
| 17 "};\\n" + | 19 "};\\n" + |
| 18 "window.setTimeout(fn1, 1);\\n" + | 20 "window.setTimeout(fn1, 1);\\n" + |
| 19 "//# sourceURL=fromEval.js"; | 21 "//# sourceURL=fromEval.js"; |
| 20 content = "eval('" + content + "');"; | 22 content = "eval('" + content + "');"; |
| 21 var scriptElement = document.createElement('script'); | 23 var scriptElement = document.createElement('script'); |
| 22 var contentNode = document.createTextNode(content); | 24 var contentNode = document.createTextNode(content); |
| 23 scriptElement.appendChild(contentNode); | 25 scriptElement.appendChild(contentNode); |
| 24 document.body.appendChild(scriptElement); | 26 document.body.appendChild(scriptElement); |
| 25 document.body.removeChild(scriptElement); | 27 document.body.removeChild(scriptElement); |
| 28 return promise; | |
| 26 } | 29 } |
| 27 | 30 |
| 28 function test() | 31 function test() |
| 29 { | 32 { |
| 30 InspectorTest.invokeAsyncWithTimeline("performActions", finish); | 33 InspectorTest.invokeAsyncWithTimeline("performActions", finish); |
| 31 | 34 |
| 32 function finish() | 35 function finish() |
| 33 { | 36 { |
| 34 function formatter(record) | 37 function formatter(record) |
| 35 { | 38 { |
| (...skipping 13 matching lines...) Expand all Loading... | |
| 49 </script> | 52 </script> |
| 50 </head> | 53 </head> |
| 51 | 54 |
| 52 <body onload="runTest()"> | 55 <body onload="runTest()"> |
| 53 <p> | 56 <p> |
| 54 Tests the Timeline API instrumentation of a TimerFired events inside evaluated s cripts. | 57 Tests the Timeline API instrumentation of a TimerFired events inside evaluated s cripts. |
| 55 </p> | 58 </p> |
| 56 | 59 |
| 57 </body> | 60 </body> |
| 58 </html> | 61 </html> |
| OLD | NEW |