Chromium Code Reviews| Index: LayoutTests/inspector/tracing/worker-js-profile.html |
| diff --git a/LayoutTests/inspector/tracing/worker-events.html b/LayoutTests/inspector/tracing/worker-js-profile.html |
| similarity index 56% |
| copy from LayoutTests/inspector/tracing/worker-events.html |
| copy to LayoutTests/inspector/tracing/worker-js-profile.html |
| index aea4430c27e93e89edcfdbd7d44682faede97c1d..a78e28f6aef9fc7bf2595fb7b12027cd3b81f8fa 100644 |
| --- a/LayoutTests/inspector/tracing/worker-events.html |
| +++ b/LayoutTests/inspector/tracing/worker-js-profile.html |
| @@ -28,6 +28,7 @@ function startWorkerAndRunTest() |
| function startSecondWorker(onActionComplete) |
| { |
| + // FIXME: add a payload to the worker to make it produce a JSFrame. |
| worker2 = new Worker("resources/worker.js"); |
| worker2.postMessage(""); |
| worker2.onmessage = function(event) |
| @@ -39,30 +40,30 @@ function startSecondWorker(onActionComplete) |
| function test() |
| { |
| - InspectorTest.invokeWithTracing("startSecondWorker", processTracingEvents); |
| + InspectorTest.invokeWithTracing("startSecondWorker", processTracingEvents, |
| + "disabled-by-default-devtools.timeline.stack,disabled-by-default-devtools.js.profile"); |
| - var workerMetadataEventCount = 0; |
| + var seenFunctions = new Set(); |
| function processTracingEvents() |
| { |
| - InspectorTest.tracingModel().sortedProcesses().forEach(function(process) { |
| - process.sortedThreads().forEach(function(thread) { |
| - thread.events().forEach(processEvent); |
| - }); |
| - }); |
| - InspectorTest.assertEquals(2, workerMetadataEventCount); |
| + InspectorTest.addResult("Main thread"); |
| + InspectorTest.tracingTimelineModel()._mainThreadEvents.forEach(processEvent); |
| + var threads = InspectorTest.tracingTimelineModel()._virtualThreads; |
| + for (var i = 0; i < threads.length; ++i) { |
| + InspectorTest.addResult(threads[i].name); |
| + threads[i].events.forEach(processEvent); |
| + } |
| + InspectorTest.assertTrue(seenFunctions.has("startSecondWorker")); |
| + InspectorTest.assertTrue(seenFunctions.has("worker2.onmessage")); |
| InspectorTest.completeTest(); |
| } |
| function processEvent(event) |
| { |
| - if (event.category !== WebInspector.TracingModel.DevToolsMetadataEventCategory || event.name !== WebInspector.TracingModel.DevToolsMetadataEvent.TracingSessionIdForWorker) |
| + if (event.name !== WebInspector.TimelineModel.RecordType.JSFrame) |
| return; |
| - |
| - ++workerMetadataEventCount; |
| - InspectorTest.assertEquals(InspectorTest.tracingModel().sessionId(), event.args["data"]["sessionId"]); |
| - InspectorTest.addResult("Got DevTools worker metadata event(" + workerMetadataEventCount + "): " + event.name); |
| + seenFunctions.add(event.args.data.functionName); |
| } |
| - |
| } |
| </script> |
| @@ -70,7 +71,7 @@ function test() |
| <body onload="startWorkerAndRunTest()"> |
| <p> |
| -Tests that worker events are recorded with proper devtools metadata events. |
| +Tests js cpu profile in timeline. |
|
yurys
2014/11/14 13:25:26
... for worker?
alph
2014/11/14 15:01:59
for worker after FIXME is addressed.
|
| </p> |
| </body> |
| </html> |