Update To 11.40.268.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / LayoutTests / inspector / tracing-session-id.html
1 <html>
2 <head>
3 <script src="../http/tests/inspector/inspector-test.js"></script>
4 <script src="tracing-test.js"></script>
5
6 <script>
7 function test()
8 {
9     InspectorTest.invokeWithTracing("(function(callback) { callback(); })", processTracingEvents);
10
11     function processTracingEvents()
12     {
13         InspectorTest.tracingModel().sortedProcesses().forEach(function(process) {
14             process.sortedThreads().forEach(function(thread) {
15                 thread.events().forEach(processEvent);
16             });
17         });
18         InspectorTest.completeTest();
19     }
20
21     function processEvent(event)
22     {
23         var metadataEvents = [
24             WebInspector.TracingTimelineModel.RecordType.SetLayerTreeId,
25             WebInspector.TracingTimelineModel.RecordType.TracingStartedInPage
26         ];
27
28         if (event.category !== WebInspector.TracingModel.DevToolsMetadataEventCategory || metadataEvents.indexOf(event.name) < 0)
29             return;
30
31         InspectorTest.assertEquals(InspectorTest.tracingModel().sessionId(), event.args["sessionId"]);
32         InspectorTest.addResult("Got DevTools metadata event: " + event.name);
33     }
34 }
35 </script>
36
37 <body onload="runTestAfterDisplay()">
38 <p style="transform: translateZ(10px)"> <!-- Force compositing so we have SetLayerTreeHostId event as well -->
39 Tests that Tracing agent returns a session id upon a start that is matching one issued in trace events.
40 </p>
41 </body>
42 </html>