| 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 iframe = document.createElement("iframe"); | 9 var iframe = document.createElement("iframe"); |
| 10 iframe.src = "resources/timeline-iframe-data.html"; | 10 iframe.src = "resources/timeline-iframe-data.html"; |
| 11 document.body.appendChild(iframe); | 11 document.body.appendChild(iframe); |
| 12 } | 12 } |
| 13 | 13 |
| 14 function test() | 14 function test() |
| 15 { | 15 { |
| 16 InspectorTest.startTimeline(step1); | 16 InspectorTest.startTimeline(step1); |
| 17 function step1() | 17 function step1() |
| 18 { | 18 { |
| 19 InspectorTest.addConsoleSniffer(step2); | 19 InspectorTest.addConsoleSniffer(step2); |
| 20 InspectorTest.evaluateInPage("performActions()"); | 20 InspectorTest.evaluateInPage("performActions()"); |
| 21 } | 21 } |
| 22 | 22 |
| 23 function step2() | 23 function step2() |
| 24 { | 24 { |
| 25 InspectorTest.stopTimeline(step3); | 25 InspectorTest.stopTimeline(step3); |
| 26 } | 26 } |
| 27 | 27 |
| 28 function step3() | 28 function step3() |
| 29 { | 29 { |
| 30 function format1(record) | 30 function format(record) |
| 31 { | 31 { |
| 32 if (record.type() === WebInspector.TimelineModel.RecordType.ParseHTM
L) { | 32 if (record.type() === WebInspector.TimelineModel.RecordType.Evaluate
Script) { |
| 33 InspectorTest.dumpTimelineRecord(record, undefined, undefined, [ | 33 InspectorTest.dumpTimelineRecord(record, undefined, undefined, [ |
| 34 "ParseHTML", | |
| 35 "EvaluateScript", | |
| 36 "EventDispatch", | |
| 37 "FunctionCall", | |
| 38 "TimeStamp", | 34 "TimeStamp", |
| 39 "MarkLoad", | |
| 40 "MarkDOMContent" | |
| 41 ]); | 35 ]); |
| 36 InspectorTest.printTimelineRecordProperties(record); |
| 42 } | 37 } |
| 43 } | 38 } |
| 44 | 39 |
| 45 function format2(record) | 40 InspectorTest.printTimelineRecords(null, InspectorTest.safeWrap(format))
; |
| 46 { | |
| 47 if (record.type() === WebInspector.TimelineModel.RecordType.Evaluate
Script) | |
| 48 InspectorTest.printTimelineRecordProperties(record); | |
| 49 } | |
| 50 | |
| 51 InspectorTest.printTimelineRecords(null, InspectorTest.safeWrap(format1)
); | |
| 52 InspectorTest.printTimelineRecords(null, InspectorTest.safeWrap(format2)
); | |
| 53 InspectorTest.completeTest(); | 41 InspectorTest.completeTest(); |
| 54 } | 42 } |
| 55 } | 43 } |
| 56 | 44 |
| 57 </script> | 45 </script> |
| 58 </head> | 46 </head> |
| 59 | 47 |
| 60 <body onload="runTest()"> | 48 <body onload="runTest()"> |
| 61 <p> | 49 <p> |
| 62 Tests the Timeline API instrumentation of an HTML script tag. | 50 Tests the Timeline API instrumentation of an HTML script tag. |
| 63 </p> | 51 </p> |
| 64 | 52 |
| 65 </body> | 53 </body> |
| 66 </html> | 54 </html> |
| OLD | NEW |