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="tracing-test.js"></script> | 4 <script src="tracing-test.js"></script> |
5 | 5 |
6 <script> | 6 <script> |
7 function test() | 7 function test() |
8 { | 8 { |
9 InspectorTest.invokeWithTracing("(function(callback) { callback(); })", proc
essTracingEvents); | 9 InspectorTest.invokeWithTracing("(function(callback) { callback(); })", proc
essTracingEvents); |
10 | 10 |
11 function processTracingEvents() | 11 function processTracingEvents() |
12 { | 12 { |
13 InspectorTest.tracingModel().sortedProcesses().forEach(function(process)
{ | 13 InspectorTest.tracingModel().sortedProcesses().forEach(function(process)
{ |
14 process.sortedThreads().forEach(function(thread) { | 14 process.sortedThreads().forEach(function(thread) { |
15 thread.events().forEach(processEvent); | 15 thread.events().forEach(processEvent); |
16 }); | 16 }); |
17 }); | 17 }); |
18 InspectorTest.completeTest(); | 18 InspectorTest.completeTest(); |
19 } | 19 } |
20 | 20 |
21 function processEvent(event) | 21 function processEvent(event) |
22 { | 22 { |
23 var metadataEvents = [ | 23 var metadataEvents = [ |
24 WebInspector.TracingTimelineModel.RecordType.SetLayerTreeId, | 24 WebInspector.TimelineModel.RecordType.SetLayerTreeId, |
25 WebInspector.TracingTimelineModel.RecordType.TracingStartedInPage | 25 WebInspector.TimelineModel.RecordType.TracingStartedInPage |
26 ]; | 26 ]; |
27 | 27 |
28 if (event.category !== WebInspector.TracingModel.DevToolsMetadataEventCa
tegory || metadataEvents.indexOf(event.name) < 0) | 28 if (event.category !== WebInspector.TracingModel.DevToolsMetadataEventCa
tegory || metadataEvents.indexOf(event.name) < 0) |
29 return; | 29 return; |
30 | 30 |
31 InspectorTest.assertEquals(InspectorTest.tracingModel().sessionId(), eve
nt.args["sessionId"]); | 31 InspectorTest.assertEquals(InspectorTest.tracingModel().sessionId(), eve
nt.args["sessionId"]); |
32 InspectorTest.addResult("Got DevTools metadata event: " + event.name); | 32 InspectorTest.addResult("Got DevTools metadata event: " + event.name); |
33 } | 33 } |
34 } | 34 } |
35 </script> | 35 </script> |
36 | 36 |
37 <body onload="runTestAfterDisplay()"> | 37 <body onload="runTestAfterDisplay()"> |
38 <p style="transform: translateZ(10px)"> <!-- Force compositing so we have SetLay
erTreeHostId event as well --> | 38 <p style="transform: translateZ(10px)"> <!-- Force compositing so we have SetLay
erTreeHostId event as well --> |
39 Tests that Tracing agent returns a session id upon a start that is matching one
issued in trace events. | 39 Tests that Tracing agent returns a session id upon a start that is matching one
issued in trace events. |
40 </p> | 40 </p> |
41 </body> | 41 </body> |
42 </html> | 42 </html> |
OLD | NEW |