3 <script src=
"../http/tests/inspector/inspector-test.js"></script>
4 <script src=
"tracing-test.js"></script>
12 { "cat": "blink.console", "name": "simple1", "ph": "S", "ts": 100000, "args": {}, "id": 1, "tid": mainThread
, "pid": pid
},
13 { "cat": "blink.console", "name": "simple1", "ph": "F", "ts": 101000, "args": {}, "id": 1, "tid": mainThread
, "pid": pid
},
14 { "cat": "blink.console", "name": "simple2", "ph": "S", "ts": 110000, "args": {}, "id": 1, "tid": mainThread
, "pid": pid
},
15 { "cat": "blink.console", "name": "simple2", "ph": "F", "ts": 111000, "args": {}, "id": 1, "tid": mainThread
, "pid": pid
},
17 { "cat": "blink.console", "name": "nested", "ph": "S", "ts": 120000, "args": {}, "id": 1, "tid": mainThread
, "pid": pid
},
18 { "cat": "blink.console", "name": "nested", "ph": "S", "ts": 121001, "args": {}, "id": 42, "tid": mainThread
, "pid": pid
},
19 { "cat": "blink.console", "name": "nested", "ph": "F", "ts": 126100, "args": {}, "id": 42, "tid": mainThread
, "pid": pid
},
20 { "cat": "blink.console", "name": "nested", "ph": "F", "ts": 126999, "args": {}, "id": 1, "tid": mainThread
, "pid": pid
},
22 { "cat": "blink.console", "name": "stepInto", "ph": "S", "ts": 130000, "args": {}, "id": 1, "tid": mainThread
, "pid": pid
},
23 { "cat": "blink.console", "name": "stepInto", "ph": "T", "ts": 130200, "args": {"step": "s1"}, "id": 1, "tid": mainThread
, "pid": pid
},
24 { "cat": "blink.console", "name": "stepInto", "ph": "T", "ts": 130800, "args": {"step": "s2"}, "id": 1, "tid": mainThread
, "pid": pid
},
25 { "cat": "blink.console", "name": "stepInto", "ph": "F", "ts": 131000, "args": {}, "id": 1, "tid": mainThread
, "pid": pid
},
27 { "cat": "blink.console", "name": "stepPast", "ph": "S", "ts": 140000, "args": {}, "id": 1, "tid": mainThread
, "pid": pid
},
28 { "cat": "blink.console", "name": "stepPast", "ph": "p", "ts": 140220, "args": {"step": "s1"}, "id": 1, "tid": mainThread
, "pid": pid
},
29 { "cat": "blink.console", "name": "stepPast", "ph": "p", "ts": 140800, "args": {"step": "s2"}, "id": 1, "tid": mainThread
, "pid": pid
},
30 { "cat": "blink.console", "name": "stepPast", "ph": "F", "ts": 141000, "args": {}, "id": 1, "tid": mainThread
, "pid": pid
},
32 { "cat": "blink.console", "name": "nestedOverlapping1", "ph": "S", "ts": 150000, "args": {}, "id": 1, "tid": mainThread
, "pid": pid
},
33 { "cat": "blink.console", "name": "nestedOverlapping2", "ph": "S", "ts": 151000, "args": {}, "id": 1, "tid": mainThread
, "pid": pid
},
34 { "cat": "blink.console", "name": "nestedOverlapping3", "ph": "S", "ts": 152000, "args": {}, "id": 1, "tid": mainThread
, "pid": pid
},
35 { "cat": "blink.console", "name": "nestedOverlapping1", "ph": "F", "ts": 153000, "args": {}, "id": 1, "tid": mainThread
, "pid": pid
},
36 { "cat": "blink.console", "name": "nestedOverlapping4", "ph": "S", "ts": 153500, "args": {}, "id": 1, "tid": mainThread
, "pid": pid
},
37 { "cat": "blink.console", "name": "nestedOverlapping2", "ph": "F", "ts": 154000, "args": {}, "id": 1, "tid": mainThread
, "pid": pid
},
38 { "cat": "blink.console", "name": "nestedOverlapping5", "ph": "S", "ts": 154000, "args": {}, "id": 1, "tid": mainThread
, "pid": pid
},
39 { "cat": "blink.console", "name": "nestedOverlapping6", "ph": "S", "ts": 154500, "args": {}, "id": 1, "tid": mainThread
, "pid": pid
},
40 { "cat": "blink.console", "name": "nestedOverlapping4", "ph": "F", "ts": 154500, "args": {}, "id": 1, "tid": mainThread
, "pid": pid
},
41 { "cat": "blink.console", "name": "nestedOverlapping3", "ph": "F", "ts": 155000, "args": {}, "id": 1, "tid": mainThread
, "pid": pid
},
42 { "cat": "blink.console", "name": "nestedOverlapping5", "ph": "F", "ts": 155000, "args": {}, "id": 1, "tid": mainThread
, "pid": pid
},
43 { "cat": "blink.console", "name": "nestedOverlapping7", "ph": "S", "ts": 155500, "args": {}, "id": 1, "tid": mainThread
, "pid": pid
},
44 { "cat": "blink.console", "name": "nestedOverlapping6", "ph": "F", "ts": 155500, "args": {}, "id": 1, "tid": mainThread
, "pid": pid
},
45 { "cat": "blink.console", "name": "nestedOverlapping7", "ph": "F", "ts": 156500, "args": {}, "id": 1, "tid": mainThread
, "pid": pid
},
46 { "cat": "blink.console", "name": "nestedOverlapping8", "ph": "S", "ts": 157500, "args": {}, "id": 1, "tid": mainThread
, "pid": pid
},
47 { "cat": "blink.console", "name": "nestedOverlapping8", "ph": "F", "ts": 158500, "args": {}, "id": 1, "tid": mainThread
, "pid": pid
},
49 { "cat": "blink.console", "name": "unterminated", "ph": "S", "ts": 160000, "args": {}, "id": 1, "tid": mainThread
, "pid": pid
},
51 { "cat": "blink.console", "name": "multithread", "ph": "S", "ts": 160000, "args": {}, "id": 1, "tid": mainThread
, "pid": pid
},
52 { "cat": "blink.console", "name": "multithread", "ph": "T", "ts": 161000, "args": {"step": "step"}, "id": 1, "tid": 101, "pid": pid
},
53 { "cat": "blink.console", "name": "multithread", "ph": "F", "ts": 162000, "args": {}, "id": 1, "tid": 102, "pid": pid
},
55 { "cat": "blink.console", "name": "nestableNested1", "ph": "b", "ts": 170000, "args": {}, "id": 123, "tid": mainThread
, "pid": pid
},
56 { "cat": "blink.console", "name": "nestableNested2", "ph": "b", "ts": 171000, "args": {"step": "n1"}, "id": 123, "tid": mainThread
, "pid": pid
},
57 { "cat": "blink.console", "name": "nestableNested2", "ph": "e", "ts": 177000, "args": {"step": "n2"}, "id": 123, "tid": mainThread
, "pid": pid
},
58 { "cat": "blink.console", "name": "nestableNested1", "ph": "e", "ts": 179000, "args": {}, "id": 123, "tid": mainThread
, "pid": pid
},
60 { "cat": "blink.console", "name": "nestableEndWithoutBegin", "ph": "e", "ts": 181000, "args": {}, "id": 124, "tid": mainThread
, "pid": pid
},
61 { "cat": "blink.console", "name": "nestableUnterminated", "ph": "b", "ts": 182000, "args": {}, "id": 124, "tid": mainThread
, "pid": pid
},
63 { "cat": "blink.console", "name": "crossProcess", "ph": "S", "ts": 190000, "args": {}, "id": 1, "tid": mainThread
, "pid": pid
},
64 { "cat": "blink.console", "name": "crossProcess", "ph": "T", "ts": 190800, "args": {"step": "s2"}, "id": 1, "tid": mainThread
+ 10, "pid": pid
+ 1 },
65 { "cat": "blink.console", "name": "crossProcess", "ph": "F", "ts": 191000, "args": {}, "id": 1, "tid": mainThread
+ 100, "pid": pid
+ 2 },
69 var model
= InspectorTest
.createTracingModel();
70 model
.setEventsForTest(testData
);
71 var events
= model
.sortedProcesses()[0].threadById(mainThread
).asyncEvents();
72 for (var i
= 0; i
< events
.length
; ++i
) {
73 var stepString
= events
[i
].name
+ " " + events
[i
].startTime
+ "-" + events
[i
].endTime
+ ": ";
74 var steps
= events
[i
].steps
;
75 for (var j
= 0; j
< steps
.length
; ++j
) {
79 stepString
+= step
.phase
+ " " + step
.startTime
;
81 InspectorTest
.addResult(stepString
);
83 InspectorTest
.completeTest();
88 <body onload=
"runTest()">
89 <p>Test that tracing model correctly processes trace events.