| Index: LayoutTests/inspector/console/console-revoke-error.html
|
| diff --git a/LayoutTests/inspector/console/console-revoke-error.html b/LayoutTests/inspector/console/console-revoke-error.html
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..e23b0c24fe6af55c24d21cce429d4f68b32df54c
|
| --- /dev/null
|
| +++ b/LayoutTests/inspector/console/console-revoke-error.html
|
| @@ -0,0 +1,54 @@
|
| +<html>
|
| +<head>
|
| +<script src="../../http/tests/inspector/inspector-test.js"></script>
|
| +<script src="../../http/tests/inspector/console-test.js"></script>
|
| +<script>
|
| +
|
| +var p;
|
| +
|
| +function createPromise()
|
| +{
|
| + p = Promise.reject(new Error("Handled error"));
|
| +}
|
| +
|
| +function handlePromiseRejection()
|
| +{
|
| + p.catch(function() {});
|
| +}
|
| +
|
| +function test()
|
| +{
|
| + InspectorTest.consoleModel.addEventListener(WebInspector.ConsoleModel.Events.MessageAdded, messageAdded);
|
| +
|
| + InspectorTest.addResult("Creating promise");
|
| + InspectorTest.evaluateInPageWithTimeout("createPromise()");
|
| +
|
| + function messageAdded(event)
|
| + {
|
| + InspectorTest.addResult("");
|
| + InspectorTest.addResult("Message added: " + event.data.level + " " + event.data.type);
|
| + InspectorTest.addResult("errors: " + InspectorTest.consoleModel.errors());
|
| + InspectorTest.addResult("revokedErrors: " + InspectorTest.consoleModel.revokedErrors());
|
| +
|
| + if (event.data.level === WebInspector.ConsoleMessage.MessageLevel.Error) {
|
| + InspectorTest.dumpConsoleMessagesIgnoreErrorStackFrames(false, true);
|
| + InspectorTest.addResult("");
|
| + InspectorTest.addResult("Handling promise");
|
| + InspectorTest.evaluateInPageWithTimeout("handlePromiseRejection()");
|
| + }
|
| +
|
| + if (event.data.level === WebInspector.ConsoleMessage.MessageLevel.RevokedError) {
|
| + InspectorTest.dumpConsoleMessagesIgnoreErrorStackFrames(false, true);
|
| + InspectorTest.completeTest();
|
| + }
|
| + }
|
| +}
|
| +
|
| +</script>
|
| +</head>
|
| +
|
| +<body onload="runTest()">
|
| +<p>Tests that console revokes lazily handled promise rejections.</p>
|
| +
|
| +</body>
|
| +</html>
|
|
|