blob: 963051600960dcdce2777c56260851e5425e7e04 [file] [log] [blame]
<html>
<head>
<script src="../../http/tests/inspector/inspector-test.js"></script>
<script src="profiler-test.js"></script>
<script>
function pageFunction() {
console.profile("outer");
console.profile("inner"); // [Chromium] Make sure we capture the current callstack.
console.profileEnd("outer");
console.profileEnd("inner");
}
function test()
{
InspectorTest.runProfilerTestSuite([
function testProfiling(next)
{
function findPageFunctionInProfileView(view)
{
var tree = view.profileDataGridTree;
if (!tree)
InspectorTest.addResult("no tree");
var node = tree.children[0];
if (!node)
InspectorTest.addResult("no node");
while (node) {
if (node.functionName.indexOf("pageFunction") !== -1) {
InspectorTest.addResult("found pageFunction");
break;
}
node = node.traverseNextNode(true, null, true);
}
next();
}
InspectorTest.showProfileWhenAdded("inner");
InspectorTest.waitUntilProfileViewIsShown("inner", findPageFunctionInProfileView);
InspectorTest.evaluateInConsole("pageFunction()", function done() {});
}
]);
}
</script>
</head>
<body onload="runTest()">
<p>
Tests that CPU profiling works.
<a href="https://bugs.webkit.org/show_bug.cgi?id=52634">Bug 52634.</a>
</p>
</body>
</html>