blob: f94a82586f0b1e1540db97ce033537f94a85ddf2 [file] [log] [blame]
<html>
<head>
<script src="resources/profiler-test-JS-resources.js"></script>
<script>
if (window.testRunner)
testRunner.dumpAsText();
if (window.internals)
internals.setJavaScriptProfilingEnabled(true);
var j = 0;
function test(len) {
for (var i = 0; i < len; ++i)
++j;
}
function test2(len) {
for (var i = 0; i < len; ++i)
--j;
}
function startTest()
{
var script = "console.profile('Test');\n";
script += "test(1000);\n";
script += "console.profileEnd('Test');\n";
script += "test2(1000);\n";
eval(script);
printProfilesDataWithoutTime();
}
</script>
</head>
<body onload="startTest()">
This page has an anonymous JavaScript function that calls built-in functions.
<br>
<br>
To run this test manually, load it in the browser then load the WebInspector and look at
the profile. There should be two nodes in the profile, a "(program)" node with one child that is "test".
<div id="output"></div>
</body>
</html>