2008-11-04 Anders Carlsson <andersca@apple.com>
[webkit/qt.git] / LayoutTests / fast / profiler / anonymous-event-handler.html
blob3a86628210d575b88623f2628f6f128ce17392cf
1 <html>
2 <head>
3 <script src="resources/profiler-test-JS-resources.js"></script>
4 <script>
5 if (window.layoutTestController) {
6 layoutTestController.dumpAsText();
7 layoutTestController.setJavaScriptProfilingEnabled(true);
10 function startTest()
12 console.profile("Anonymous event handler");
14 var buttonWithAnonymousHandler = document.getElementById("buttonWithAnAnonymousEventHandler")
15 buttonWithAnonymousHandler.onclick = function () {
16 insertNewText();
19 buttonWithAnonymousHandler.click();
21 endTest();
23 </script>
24 </head>
26 <body onload="startTest()">
27 This page has an anonymous event handler.
28 <br>
29 <br>
30 To run this test manually, load it in the browser then load the WebInspector and look at
31 the profile. It should show the anonymous function at the same level as the onload
32 handler.
33 <input type="button" id="buttonWithAnAnonymousEventHandler" value="Button with an anonymous event handler">
34 <div id="output"></div>
35 </body>
36 </html>