| 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 type="text/javascript"> | 5 <script type="text/javascript"> |
| 5 | 6 |
| 6 var test = function() | 7 var test = function() |
| 7 { | 8 { |
| 8 WebInspector.showPanel("timeline"); | 9 WebInspector.showPanel("timeline"); |
| 9 | 10 |
| 10 function dumper(record) | 11 function dumper(record) |
| 11 { | 12 { |
| 12 InspectorTest.addResult(record.name); | 13 InspectorTest.addResult(record.type); |
| 13 } | 14 } |
| 14 | 15 |
| 15 var records = [ | 16 var records = [ |
| 16 {"name" : "a", "children" : [ | 17 {"type" : "a", "children" : [ |
| 17 {"name" : "aa", "children": [ | 18 {"type" : "aa", "children": [ |
| 18 {"name" : "aaa"}, | 19 {"type" : "aaa"}, |
| 19 {"name" : "aab"}, | 20 {"type" : "aab"}, |
| 20 ]}, | 21 ]}, |
| 21 {"name" : "ab", "children":[ | 22 {"type" : "ab", "children":[ |
| 22 {"name" : "aba"}, | 23 {"type" : "aba"}, |
| 23 {"name" : "abb"}, | 24 {"type" : "abb"}, |
| 24 ]} | 25 ]} |
| 25 ]}, | 26 ]}, |
| 26 {"name" : "b", "children" : [ | 27 {"type" : "b", "children" : [ |
| 27 {"name" : "ba", "children" : [ | 28 {"type" : "ba", "children" : [ |
| 28 {"name" : "baa"}, | 29 {"type" : "baa"}, |
| 29 {"name" : "bab"}, | 30 {"type" : "bab"}, |
| 30 ]}, | 31 ]}, |
| 31 {"name" : "bb", "children":[ | 32 {"type" : "bb", "children":[ |
| 32 {"name" : "bba"}, | 33 {"type" : "bba"}, |
| 33 {"name" : "bbb"}, | 34 {"type" : "bbb"}, |
| 34 ]} | 35 ]} |
| 35 ]}, | 36 ]}, |
| 36 ]; | 37 ]; |
| 37 | 38 |
| 39 InspectorTest.loadTimelineRecords(records); |
| 38 InspectorTest.addResult("DFS preorder:"); | 40 InspectorTest.addResult("DFS preorder:"); |
| 39 WebInspector.TimelineModel.forAllRecords(records, dumper); | 41 InspectorTest.timelineModel().forAllRecords(dumper); |
| 40 InspectorTest.addResult(""); | 42 InspectorTest.addResult(""); |
| 41 | 43 |
| 42 InspectorTest.addResult("DFS postorder:"); | 44 InspectorTest.addResult("DFS postorder:"); |
| 43 WebInspector.TimelineModel.forAllRecords(records, null, dumper); | 45 InspectorTest.timelineModel().forAllRecords(null, dumper); |
| 44 InspectorTest.completeTest(); | 46 InspectorTest.completeTest(); |
| 45 } | 47 } |
| 46 | 48 |
| 47 </script> | 49 </script> |
| 48 </head> | 50 </head> |
| 49 <body onload="runTest()"> | 51 <body onload="runTest()"> |
| 50 <p>Tests TimelineModel.forAllRecords function.</p> | 52 <p>Tests TimelineModel.forAllRecords function.</p> |
| 51 </body> | 53 </body> |
| 52 </html> | 54 </html> |
| OLD | NEW |