Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(11)

Unified Diff: LayoutTests/inspector/console/worker-exception-message-contains-stack.html

Issue 743153002: [DevTools] Show stack trace for exceptions in dedicated workers (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@worker-capture-stack
Patch Set: Rebased Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: LayoutTests/inspector/console/worker-exception-message-contains-stack.html
diff --git a/LayoutTests/inspector/console/worker-exception-message-contains-stack.html b/LayoutTests/inspector/console/worker-exception-message-contains-stack.html
new file mode 100644
index 0000000000000000000000000000000000000000..70aa701f4ab9764b925fd5e4627ef63513c079e8
--- /dev/null
+++ b/LayoutTests/inspector/console/worker-exception-message-contains-stack.html
@@ -0,0 +1,62 @@
+<html>
+<head>
+<script src="../../http/tests/inspector/inspector-test.js"></script>
+<script src="../../http/tests/inspector/console-test.js"></script>
+<script>
+var worker;
+
+function startWorker()
+{
+ worker = new Worker("resources/worker-with-throw.js");
+}
+
+function postMessageToWorker()
+{
+ worker.postMessage();
+}
+
+function setupErrorHandler()
+{
+ worker.onerror = function(e) {
+ console.log(e.message);
+ e.preventDefault();
+ }
+}
+
+function test()
+{
+ InspectorTest.addSniffer(WebInspector.RuntimeModel.prototype, "_executionContextCreated", contextCreated);
+ InspectorTest.evaluateInPage("startWorker()");
+
+ function contextCreated()
+ {
+ InspectorTest.evaluateInPage("postMessageToWorker()", step2);
+ }
+
+ function step2()
+ {
+ InspectorTest.evaluateInPage("setupErrorHandler()", step3);
+ }
+
+ function step3()
+ {
+ InspectorTest.evaluateInPage("postMessageToWorker()", step4);
+ }
+
+ function step4()
+ {
+ InspectorTest.expandConsoleMessages(step5);
+ }
+
+ function step5()
+ {
+ InspectorTest.dumpConsoleMessages();
+ InspectorTest.completeTest();
+ }
+};
+</script>
+</head>
+<body onload="runTest()">
+<p>Tests exception message from worker contains stack trace.</p>
+</body>
+</html>

Powered by Google App Engine
This is Rietveld 408576698