Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / inspector / console / console-log-linkify-stack-in-errors.html
blob0150d318137b408a0e614f89bf8ef86876b2255f
1 <html>
2 <head>
3 <script src="../../http/tests/inspector/inspector-test.js"></script>
4 <script src="../../http/tests/inspector/console-test.js"></script>
5 <script src="../../http/tests/inspector/workspace-test.js"></script>
6 <script src="resources/stack-with-sourceUrl.js"></script>
7 <script src="resources/stack-with-sourceMap.js"></script>
8 <script>
9 function forStack()
11 console.log(new Error("line\nbreak").stack);
14 forStack();
16 function stack1(errorConstructor, text)
18 function stack2()
20 console.log(new errorConstructor(text).stack);
22 stack2();
25 function domError()
27 try {
28 document.body.removeChild(document.createElement("a"));
29 } catch (e) {
30 console.log(e.stack);
34 domError();
36 console.log("Error message without stacks http://www.chromium.org/");
38 console.log("Error valid stack #2\n at http://www.chromium.org/boo.js:40:70\n at foo(http://www.chromium.org/foo.js:10:50)");
39 console.log("Error valid stack #3\n at http://www.chromium.org/foo.js:40");
41 stack1(ReferenceError, "valid stack");
42 stack1(EvalError, "valid stack");
43 stack1(SyntaxError, "valid stack");
44 stack1(RangeError, "valid stack");
45 stack1(TypeError, "valid stack");
46 stack1(URIError, "valid stack");
48 console.log("Error broken stack\n at function_name(foob.js foob.js:30:1)\n at foob.js:40:70");
49 console.log("Error broken stack #2\n at function_name(foob.js:20:30");
50 console.log("Error broken stack #3\n at function_name(foob:20.js:30 bla");
51 console.log("Error broken stack #4\n at function_name)foob.js:20:30(");
52 console.log("Error broken stack #5\n at function_name foob.js:20:30)");
53 console.log("Error broken stack #6\n at foob.js foob.js:40:70");
55 //# sourceURL=console-log-linkify-stack-in-errors.html
56 </script>
58 <script>
59 function test()
61 InspectorTest.evaluateInPageWithTimeout("failure()");
62 InspectorTest.waitUntilMessageReceived(waitForUISourceCode);
63 function waitForUISourceCode()
65 InspectorTest.waitForGivenUISourceCode("stack-with-sourceMap.coffee", dumpMessages);
68 function dumpMessages()
70 InspectorTest.dumpConsoleMessages(false, true);
71 InspectorTest.completeTest();
74 </script>
75 </head>
76 <body onload="runTest()">
77 <p>
78 Test that console.log(new Error().stack) would linkify links in stacks for sourceUrls and sourceMaps <a href="http://crbug.com/424001">Bug 424001.</a>
79 </p>
80 </body>
81 </html>