summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/inspector/console/console-trace-in-eval.html
blob: cab63bf6e26b5ffa6577f9d063c482d894508b7c (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
41
42
43
44
45
46
47
48
49
50
51
52
<html>
<head>
<script src="../../http/tests/inspector/inspector-test.js"></script>
<script src="../../http/tests/inspector/console-test.js"></script>
<script>


function evalSource()
{
    function b()
    {
        console.trace();
    }

    function a()
    {
        b();
    }

    a();
}

function doEvalSource()
{
    setTimeout(function() {
        eval("(" + evalSource + ")()//# sourceURL=evalURL.js");
    }, 0);
}

function test()
{
    function callback()
    {
        InspectorTest.dumpConsoleMessages();
        InspectorTest.completeTest();
    }
    InspectorTest.evaluateInPage("doEvalSource()");
    InspectorTest.addConsoleSniffer(callback);
}

</script>
</head>

<body onload="runTest()">
<p>
Tests that when console.trace is called in eval'ed script ending
with //# sourceURL=url it will dump a stack trace that will have
the url as the script source. <a href="https://bugs.webkit.org/show_bug.cgi?id=47252">Bug 47252.</a>
</p>

</body>
</html>