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> |