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 src="../tracing-test.js"></script> | 5 <script src="../tracing-test.js"></script> |
6 <script> | 6 <script> |
7 function test() | 7 function test() |
8 { | 8 { |
9 var sessionId = "4.20"; | 9 var sessionId = "4.20"; |
10 var mainThread = 1; | 10 var mainThread = 1; |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 {"name": "FunctionCall", "ts": 2000001, "ph": "B", args: {}, "tid": main
Thread, "pid": 100, "cat":"disabled-by-default.devtools.timeline" }, | 43 {"name": "FunctionCall", "ts": 2000001, "ph": "B", args: {}, "tid": main
Thread, "pid": 100, "cat":"disabled-by-default.devtools.timeline" }, |
44 {"name": "ResourceSendRequest", "ts": 2000002, "ph": "I", args: {"data":
{"requestId": 1, "url": "http://example.com", "requestMethod": "GET"}}, "tid": m
ainThread, "pid": 100, "cat":"disabled-by-default.devtools.timeline" }, | 44 {"name": "ResourceSendRequest", "ts": 2000002, "ph": "I", args: {"data":
{"requestId": 1, "url": "http://example.com", "requestMethod": "GET"}}, "tid": m
ainThread, "pid": 100, "cat":"disabled-by-default.devtools.timeline" }, |
45 {"name": "RecalculateStyles", "ts": 2001003, "ph": "B", args: {}, "tid":
mainThread, "pid": 100, "cat":"disabled-by-default.devtools.timeline"}, | 45 {"name": "RecalculateStyles", "ts": 2001003, "ph": "B", args: {}, "tid":
mainThread, "pid": 100, "cat":"disabled-by-default.devtools.timeline"}, |
46 {"name": "RecalculateStyles", "ts": 2002000, "ph": "E", args: {}, "tid":
mainThread, "pid": 100, "cat":"disabled-by-default.devtools.timeline"}, | 46 {"name": "RecalculateStyles", "ts": 2002000, "ph": "E", args: {}, "tid":
mainThread, "pid": 100, "cat":"disabled-by-default.devtools.timeline"}, |
47 {"name": "Layout", "ts": 2002101, "ph": "B", args: {beginData: {}}, "tid
": mainThread, "pid": 100, "cat":"disabled-by-default.devtools.timeline"}, | 47 {"name": "Layout", "ts": 2002101, "ph": "B", args: {beginData: {}}, "tid
": mainThread, "pid": 100, "cat":"disabled-by-default.devtools.timeline"}, |
48 {"name": "Layout", "ts": 2003001, "ph": "E", args: {endData: {}}, "tid":
mainThread, "pid": 100, "cat":"disabled-by-default.devtools.timeline"}, | 48 {"name": "Layout", "ts": 2003001, "ph": "E", args: {endData: {}}, "tid":
mainThread, "pid": 100, "cat":"disabled-by-default.devtools.timeline"}, |
49 {"name": "FunctionCall", "ts": 2009999, "ph": "E", args: {}, "tid": main
Thread, "pid": 100, "cat":"disabled-by-default.devtools.timeline" }, | 49 {"name": "FunctionCall", "ts": 2009999, "ph": "E", args: {}, "tid": main
Thread, "pid": 100, "cat":"disabled-by-default.devtools.timeline" }, |
50 {"name": "Program", "ts": 2009999, "ph": "E", args: {}, "tid": mainThre
ad, "pid": 100, "cat":"disabled-by-default.devtools.timeline"} | 50 {"name": "Program", "ts": 2009999, "ph": "E", args: {}, "tid": mainThre
ad, "pid": 100, "cat":"disabled-by-default.devtools.timeline"} |
51 ]; | 51 ]; |
52 | 52 |
53 var recordsFromEvent = []; | |
54 function onRecordAdded(event) | |
55 { | |
56 recordsFromEvent.push(event.data); | |
57 } | |
58 var tracingTimelineModel = InspectorTest.tracingTimelineModel(); | 53 var tracingTimelineModel = InspectorTest.tracingTimelineModel(); |
59 tracingTimelineModel.addEventListener(WebInspector.TimelineModel.Events.Reco
rdAdded, onRecordAdded); | |
60 tracingTimelineModel.setEventsForTest(commonMetadata.concat(traceEvents)); | 54 tracingTimelineModel.setEventsForTest(commonMetadata.concat(traceEvents)); |
61 var records = tracingTimelineModel.records(); | 55 var records = tracingTimelineModel.records(); |
62 InspectorTest.assertEquals(records.length, recordsFromEvent.length); | 56 var topLevelRecordsCount = 2; |
| 57 InspectorTest.assertEquals(topLevelRecordsCount, records.length); |
63 for (var i = 0; i < records.length; ++i) { | 58 for (var i = 0; i < records.length; ++i) { |
64 InspectorTest.assertEquals(records[i], recordsFromEvent[i]); | |
65 InspectorTest.dumpTimelineModelRecord(records[i]); | 59 InspectorTest.dumpTimelineModelRecord(records[i]); |
66 } | 60 } |
67 InspectorTest.completeTest(); | 61 InspectorTest.completeTest(); |
68 } | 62 } |
69 | 63 |
70 </script> | 64 </script> |
71 </head> | 65 </head> |
72 | 66 |
73 <body onload="runTest()"> | 67 <body onload="runTest()"> |
74 <p> | 68 <p> |
75 Test trace-specific implementation of timeline model | 69 Test trace-specific implementation of timeline model |
76 </p> | 70 </p> |
77 | 71 |
78 </body> | 72 </body> |
79 </html> | 73 </html> |
OLD | NEW |