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