3 <script src="resources/profiler-test-JS-resources.js"></script>
5 if (window.layoutTestController)
6 layoutTestController.dumpAsText();
8 internals.settings.setJavaScriptProfilingEnabled(true);
10 function anonymousFunctionGenerator(iterations)
12 var variableThatPointsToAnAnonymousFunction = function()
14 for (var i = 0; i < iterations; ++i) ;
17 variableThatPointsToAnAnonymousFunction.displayName = iterations + " iterations function";
19 return variableThatPointsToAnAnonymousFunction;
24 console.profile("Anonymous functions with display names");
26 anonymousFunctionGenerator(0)();
27 anonymousFunctionGenerator(1)();
28 anonymousFunctionGenerator(2)();
29 anonymousFunctionGenerator(20)();
30 anonymousFunctionGenerator(1000)();
37 <body onload="startTest()">
38 This page's JavaScript calls anonymous functions with display names.
41 To run this test manually, load it in the browser then load the WebInspector and look at
42 the profile. You should see functions named "[x] iterations function", and no anonymous functions.
43 <div id="output"></div>