OLD | NEW |
(Empty) | |
| 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> |
| 6 function throwError() |
| 7 { |
| 8 throw new Error("error_text"); |
| 9 } |
| 10 |
| 11 function throwObject() |
| 12 { |
| 13 throw {a: 42}; |
| 14 } |
| 15 |
| 16 function throwNumber() |
| 17 { |
| 18 throw 42; |
| 19 } |
| 20 |
| 21 function rejectWithError() |
| 22 { |
| 23 Promise.reject(new Error("promise_error")); |
| 24 } |
| 25 |
| 26 function rejectWithObject() |
| 27 { |
| 28 Promise.reject({b: 42}); |
| 29 } |
| 30 //# sourceURL=foo.js |
| 31 </script> |
| 32 <script> |
| 33 function test() |
| 34 { |
| 35 var expressions = [ |
| 36 ["setTimeout(throwError, 0); undefined", 3], |
| 37 ["throwError();", 2], |
| 38 ["setTimeout(throwObject, 0); undefined", 3], |
| 39 ["throwObject();", 2], |
| 40 ["setTimeout(throwNumber, 0); undefined", 3], |
| 41 ["throwNumber();", 2], |
| 42 ["setTimeout(rejectWithError, 0); undefined", 3], |
| 43 ["rejectWithError();", 3], |
| 44 ["setTimeout(rejectWithObject, 0); undefined", 3], |
| 45 ["rejectWithObject();", 3] |
| 46 ]; |
| 47 |
| 48 function nextExpression() |
| 49 { |
| 50 if (!expressions.length) { |
| 51 InspectorTest.dumpConsoleMessages(); |
| 52 InspectorTest.completeTest(); |
| 53 return; |
| 54 } |
| 55 |
| 56 var expression = expressions.shift(); |
| 57 InspectorTest.waitUntilNthMessageReceived(expression[1], nextExpression)
; |
| 58 InspectorTest.evaluateInConsole(expression[0], function() {}); |
| 59 } |
| 60 |
| 61 nextExpression(); |
| 62 } |
| 63 </script> |
| 64 </head> |
| 65 <body onload="runTest()"> |
| 66 <p> |
| 67 Tests that expressions have thrown objects. |
| 68 </p> |
| 69 </body> |
| 70 </html> |
OLD | NEW |