3 <script src="../../http/tests/inspector/inspector-test.js"></script>
4 <script src="profiler-test.js"></script>
7 function pageFunction() {
9 console.profile("profile");
10 console.profileEnd("profile");
16 function checkFunction(name, tree)
18 var node = tree.children[0];
20 InspectorTest.addResult("no node");
22 if (node.functionName === name) {
23 InspectorTest.addResult("found " + name);
26 node = node.traverseNextNode(true, null, true);
28 InspectorTest.addResult(name + " not found");
31 InspectorTest.runProfilerTestSuite([
32 function testProfiling(next)
34 function findPageFunctionInProfileView(view)
36 var tree = view.profileDataGridTree;
38 InspectorTest.addResult("no tree");
39 checkFunction("pageFunction", tree);
40 checkFunction("(anonymous function)", tree);
43 InspectorTest.showProfileWhenAdded("profile");
44 InspectorTest.waitUntilProfileViewIsShown("profile", findPageFunctionInProfileView);
45 InspectorTest.evaluateInPage("pageFunction()", function done() {});
52 <body onload="runTest()">
54 Tests that CPU profiling works.
56 <a href="https://bugs.webkit.org/show_bug.cgi?id=52634">Bug 52634.</a>