Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / inspector / tracing / worker-events.html
blob688aac5eab278de8a09a56c6cedea64fc7a21fca
1 <html>
2 <head>
3 <script src="../../http/tests/inspector/inspector-test.js"></script>
4 <script src="../../http/tests/inspector/timeline-test.js"></script>
5 <script src="../tracing-test.js"></script>
6 <script>
8 // Save references to the worker objects to make sure they are not GC'ed.
9 var worker1;
10 var worker2;
12 function startWorkerAndRunTest()
14 worker1 = new Worker("resources/worker.js");
15 worker1.postMessage("");
17 if (window.testRunner) {
18 testRunner.dumpAsText();
19 testRunner.waitUntilDone();
22 worker1.onmessage = function(event)
24 worker1.onmessage = null;
25 runTest();
29 function startSecondWorker(onActionComplete)
31 worker2 = new Worker("resources/worker.js");
32 worker2.postMessage("");
33 worker2.onmessage = function(event)
35 onActionComplete();
36 worker2.onmessage = null;
40 function test()
42 InspectorTest.invokeWithTracing("startSecondWorker", InspectorTest.safeWrap(processTracingEvents));
44 var workerMetadataEventCount = 0;
45 function processTracingEvents()
47 InspectorTest.tracingModel().sortedProcesses().forEach(function(process) {
48 process.sortedThreads().forEach(function(thread) {
49 thread.events().forEach(processEvent);
50 });
51 });
52 InspectorTest.assertEquals(2, workerMetadataEventCount);
53 InspectorTest.completeTest();
56 function processEvent(event)
58 if (!event.hasCategory(WebInspector.TracingModel.DevToolsMetadataEventCategory) || event.name !== WebInspector.TimelineModel.DevToolsMetadataEvent.TracingSessionIdForWorker)
59 return;
61 ++workerMetadataEventCount;
62 InspectorTest.assertEquals(InspectorTest.tracingTimelineModel().sessionId(), event.args["data"]["sessionId"]);
63 InspectorTest.addResult("Got DevTools worker metadata event(" + workerMetadataEventCount + "): " + event.name);
68 </script>
69 </head>
71 <body onload="startWorkerAndRunTest()">
72 <p>
73 Tests that worker events are recorded with proper devtools metadata events.
74 </p>
75 </body>
76 </html>