Chromium Code Reviews| Index: LayoutTests/http/tests/inspector-enabled/console-exception-source-url.html |
| diff --git a/LayoutTests/http/tests/inspector-enabled/console-exception-source-url.html b/LayoutTests/http/tests/inspector-enabled/console-exception-source-url.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..af2672fe7b0a843c3518fe561e236bdd272bc7b4 |
| --- /dev/null |
| +++ b/LayoutTests/http/tests/inspector-enabled/console-exception-source-url.html |
| @@ -0,0 +1,43 @@ |
| +<html> |
| +<head> |
| +<script src="../inspector/inspector-test.js"></script> |
| +<script type="text/javascript"> |
| +function onload() |
| +{ |
| + if (window.testRunner) |
| + testRunner.waitUntilDone(); |
| + setTimeout(showInspectorAndRunTest, 0); |
| + |
| + var scriptContents = "function foo() { FAIL.FAIL; } \n //# sourceURL=foo2.js"; |
| + eval(scriptContents); |
| + foo(); |
| +} |
| + |
| + |
| +function showInspectorAndRunTest() |
| +{ |
| + if (window.testRunner) |
| + testRunner.showWebInspector(); |
| + runTest(); |
| +} |
| + |
| +function test() |
| +{ |
| + var messages = WebInspector.console.messages; |
| + if (messages.length == 1) |
| + { |
| + var m = messages[0]; |
| + InspectorTest.addResult("Message: " + WebInspector.displayNameForURL(m.url) + ":" + m.line + " " + m.messageText); |
|
vsevik
2014/04/30 10:23:57
Let's use InspectorTest.dumpConsoleMessages instea
|
| + } |
| + else |
| + InspectorTest.addResult("FAILED: bad messages count"); |
| + |
| + InspectorTest.addResult("TEST COMPLETE"); |
| + InspectorTest.completeTest(); |
| +} |
| +</script> |
| +</head> |
| +<body onload="onload()"> |
| +<p>Tests that when exception happens before inspector is open source url is correctly shown in console.</p> |
| +</body> |
| +</html> |