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: third_party/WebKit/LayoutTests/inspector/console/exception-objects.html

Issue 2170263002: [DevTools] Pass error object when reporting exceptions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: typo Created 4 years, 5 months 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: third_party/WebKit/LayoutTests/inspector/console/exception-objects.html
diff --git a/third_party/WebKit/LayoutTests/inspector/console/exception-objects.html b/third_party/WebKit/LayoutTests/inspector/console/exception-objects.html
new file mode 100644
index 0000000000000000000000000000000000000000..d8e58d9b1fc9ef7e4699272210b3ea2155f3806d
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/inspector/console/exception-objects.html
@@ -0,0 +1,70 @@
+<html>
+<head>
+<script src="../../http/tests/inspector/inspector-test.js"></script>
+<script src="../../http/tests/inspector/console-test.js"></script>
+<script>
+function throwError()
+{
+ throw new Error("error_text");
+}
+
+function throwObject()
+{
+ throw {a: 42};
+}
+
+function throwNumber()
+{
+ throw 42;
+}
+
+function rejectWithError()
+{
+ Promise.reject(new Error("promise_error"));
+}
+
+function rejectWithObject()
+{
+ Promise.reject({b: 42});
+}
+//# sourceURL=foo.js
+</script>
+<script>
+function test()
+{
+ var expressions = [
+ ["setTimeout(throwError, 0); undefined", 3],
+ ["throwError();", 2],
+ ["setTimeout(throwObject, 0); undefined", 3],
+ ["throwObject();", 2],
+ ["setTimeout(throwNumber, 0); undefined", 3],
+ ["throwNumber();", 2],
+ ["setTimeout(rejectWithError, 0); undefined", 3],
+ ["rejectWithError();", 3],
+ ["setTimeout(rejectWithObject, 0); undefined", 3],
+ ["rejectWithObject();", 3]
+ ];
+
+ function nextExpression()
+ {
+ if (!expressions.length) {
+ InspectorTest.dumpConsoleMessages();
+ InspectorTest.completeTest();
+ return;
+ }
+
+ var expression = expressions.shift();
+ InspectorTest.waitUntilNthMessageReceived(expression[1], nextExpression);
+ InspectorTest.evaluateInConsole(expression[0], function() {});
+ }
+
+ nextExpression();
+}
+</script>
+</head>
+<body onload="runTest()">
+<p>
+Tests that expressions have thrown objects.
+</p>
+</body>
+</html>

Powered by Google App Engine
This is Rietveld 408576698