summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/inspector/debugger/debugger-pause-in-eval-script.html
blob: 45bdfcbcff7793e84ddaab9fa7315f2ab82da9a7 (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
37
38
39
40
<html>
<head>
<script src="../../http/tests/inspector/inspector-test.js"></script>
<script src="../../http/tests/inspector/debugger-test.js"></script>
<script>


var test = function()
{
    var scriptToEvaluate = "function testFunction() {\n" +
                           "    debugger;\n" +
                           "}\n" +
                           "setTimeout(testFunction, 0);\n";

    InspectorTest.startDebuggerTest(step1);

    function step1()
    {
        InspectorTest.evaluateInConsole(scriptToEvaluate, InspectorTest.addResult.bind(InspectorTest, "Evaluated script in console."));
        InspectorTest.waitUntilPaused(step2);
    }

    function step2(callFrames)
    {
        InspectorTest.captureStackTrace(callFrames);
        InspectorTest.completeDebuggerTest();
    }
}

</script>
</head>

<body onload="runTest()">
<p>
Tests that debugger will stop on "debugger" statement in a function that was added
to the inspected page via evaluation in Web Inspector console.<a href="https://bugs.webkit.org/show_bug.cgi?id=41058">Bug 41058</a>
</p>

</body>
</html>