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 function test() | 6 function test() |
7 { | 7 { |
8 var sessionId = "6.23"; | 8 var sessionId = "6.23"; |
9 var rawTraceEvents = [ | 9 var rawTraceEvents = [ |
10 { | 10 { |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 "ph": "X", | 58 "ph": "X", |
59 "pid": 17851, | 59 "pid": 17851, |
60 "tid": 23, | 60 "tid": 23, |
61 "ts": 110000, | 61 "ts": 110000, |
62 "tts": 5610000, | 62 "tts": 5610000, |
63 "dur": 90000, | 63 "dur": 90000, |
64 "args": {} | 64 "args": {} |
65 }, | 65 }, |
66 { | 66 { |
67 "cat": "disabled-by-default-v8.cpu_profile2", | 67 "cat": "disabled-by-default-v8.cpu_profile2", |
68 "name": "CpuProfile", | 68 "name": "Profile", |
69 "ph": "P", | 69 "ph": "P", |
70 "id": "0xa1f", | 70 "id": "0xa1f", |
71 "pid": 17851, | 71 "pid": 17851, |
72 "tid": 23, | 72 "tid": 23, |
73 "ts": 110000, | 73 "ts": 110000, |
74 "tts": 5610000, | 74 "tts": 5610000, |
75 "args": { | 75 "args": { |
76 "data": { | 76 "data": { |
77 "startTime": 110000, | 77 "startTime": 110000, |
78 "nodes": [{ | 78 "cpuProfile": { |
79 "callFrame": { | 79 "nodes": [{ |
80 "functionName": "(root)", | 80 "callFrame": { |
81 "scriptId": 0 | 81 "functionName": "(root)", |
82 }, | 82 "scriptId": 0 |
83 "id": 1 | 83 }, |
84 }, { | 84 "id": 1 |
85 "callFrame": { | 85 }, { |
86 "columnNumber": 26, | 86 "callFrame": { |
87 "functionName": "foo", | 87 "columnNumber": 26, |
88 "lineNumber": 1306, | 88 "functionName": "foo", |
89 "scriptId": 260, | 89 "lineNumber": 1306, |
90 "url": "http://example.com/www-embed-player.js" | 90 "scriptId": 260, |
91 }, | 91 "url": "http://example.com/www-embed-player.js" |
92 "id": 2, | 92 }, |
93 "parent": 1 | 93 "id": 2, |
94 }] | 94 "parent": 1 |
| 95 }] |
| 96 } |
95 } | 97 } |
96 }, | 98 }, |
97 }, | 99 }, |
98 { | 100 { |
99 "cat": "disabled-by-default-v8.cpu_profile2", | 101 "cat": "disabled-by-default-v8.cpu_profile2", |
100 "name": "CpuProfileChunk", | 102 "name": "ProfileChunk", |
101 "ph": "P", | 103 "ph": "P", |
102 "id": "0xa1f", | 104 "id": "0xa1f", |
103 "pid": 17851, | 105 "pid": 17851, |
104 "tid": 24, | 106 "tid": 24, |
105 "ts": 120000, | 107 "ts": 120000, |
106 "tts": 5620000, | 108 "tts": 5620000, |
107 "args": { | 109 "args": { |
108 "data": { | 110 "data": { |
109 "samples": [2, 2, 2], | 111 "cpuProfile": { |
| 112 "samples": [2, 2, 2] |
| 113 }, |
110 "timeDeltas": [1000, 1500, 1000] | 114 "timeDeltas": [1000, 1500, 1000] |
111 } | 115 } |
112 } | 116 } |
113 }, | 117 }, |
114 { | 118 { |
115 "cat": "disabled-by-default-v8.cpu_profile2", | 119 "cat": "disabled-by-default-v8.cpu_profile2", |
116 "name": "CpuProfileChunk", | 120 "name": "ProfileChunk", |
117 "ph": "P", | 121 "ph": "P", |
118 "id": "0xa1f", | 122 "id": "0xa1f", |
119 "pid": 17851, | 123 "pid": 17851, |
120 "tid": 24, | 124 "tid": 24, |
121 "ts": 120000, | 125 "ts": 120000, |
122 "tts": 5630000, | 126 "tts": 5630000, |
123 "args": { | 127 "args": { |
124 "data": { | 128 "data": { |
125 "nodes": [{ | 129 "cpuProfile": { |
126 "callFrame": { | 130 "nodes": [{ |
127 "columnNumber": 2, | 131 "callFrame": { |
128 "functionName": "bar", | 132 "columnNumber": 2, |
129 "lineNumber": 1400, | 133 "functionName": "bar", |
130 "scriptId": 260, | 134 "lineNumber": 1400, |
131 "url": "http://example.com/www-embed-player.js" | 135 "scriptId": 260, |
132 }, | 136 "url": "http://example.com/www-embed-player.js" |
133 "id": 3, | 137 }, |
134 "parent": 2 | 138 "id": 3, |
135 }], | 139 "parent": 2 |
136 "samples": [2, 3, 3, 3, 2, 1], | 140 }], |
| 141 "samples": [2, 3, 3, 3, 2, 1] |
| 142 }, |
137 "timeDeltas": [500, 500, 1000, 500, 1000, 500] | 143 "timeDeltas": [500, 500, 1000, 500, 1000, 500] |
138 } | 144 } |
139 } | 145 } |
140 }, | 146 }, |
141 { | 147 { |
142 "cat": "disabled-by-default-v8.cpu_profile2", | 148 "cat": "disabled-by-default-v8.cpu_profile2", |
143 "name": "CpuProfileChunk", | 149 "name": "ProfileChunk", |
144 "ph": "P", | 150 "ph": "P", |
145 "id": "0xa1f", | 151 "id": "0xa1f", |
146 "pid": 17851, | 152 "pid": 17851, |
147 "tid": 24, | 153 "tid": 24, |
148 "ts": 120000, | 154 "ts": 120000, |
149 "tts": 5630000, | 155 "tts": 5630000, |
150 "args": { | 156 "args": { |
151 "data": {} | 157 "data": {} |
152 } | 158 } |
153 }]; | 159 }]; |
154 | 160 |
155 var tracingTimelineModel = InspectorTest.createTimelineModelWithEvents(rawTr
aceEvents); | 161 var tracingTimelineModel = InspectorTest.createTimelineModelWithEvents(rawTr
aceEvents); |
156 var events = tracingTimelineModel.mainThreadEvents(); | 162 var events = tracingTimelineModel.mainThreadEvents(); |
157 events.filter(e => e.name === "JSFrame").forEach(e => { | 163 events.filter(e => e.name === "JSFrame").forEach(e => { |
158 InspectorTest.addResult(`${e.name}: ${e.startTime.toFixed(3)} / ${(e.dur
ation || 0).toFixed(3)} ${e.args.data.functionName}`); | 164 InspectorTest.addResult(`${e.name}: ${e.startTime.toFixed(3)} / ${(e.dur
ation || 0).toFixed(3)} ${e.args.data.functionName}`); |
159 }); | 165 }); |
160 | 166 |
161 InspectorTest.completeTest(); | 167 InspectorTest.completeTest(); |
162 } | 168 } |
163 | 169 |
164 </script> | 170 </script> |
165 </head> | 171 </head> |
166 <body onload="runTest()"> | 172 <body onload="runTest()"> |
167 Tests streaming CPU profile within trace log. | 173 Tests streaming CPU profile within trace log. |
168 </body> | 174 </body> |
169 </html> | 175 </html> |
OLD | NEW |