summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/fast/profiler/profiling-from-a-nested-location.html
blob: e6251c78aa29730b6341e8bb8abb65c40211fccb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<html>
<head>
<script src="resources/profiler-test-JS-resources.js"></script>
<script>
if (window.layoutTestController) {
    layoutTestController.dumpAsText();
    layoutTestController.setJavaScriptProfilingEnabled(true);
}

function startTest()
{
    functionWichStartsAndStopsTheProfiler();
}

function functionWichStartsAndStopsTheProfiler()
{
    console.profile("Profiling From A Nested Location");

    for (var i = 0; i < 10000000; i++)
        var b = i + 2;

    endTest();
}

</script>
</head>

<body onload="startTest()">
This page's JavaScript starts profiling from within a nested location.
<br>
<br>
To run this test manually, load it in the browser then load the WebInspector and look at
the profile.  In the profile there should be a call to functionWichStartsAndStopsTheProfiler().
<div id="output"></div>
</body>
</html>