Index: LayoutTests/inspector/sources/debugger/debugger-uncaught-promise-on-dom-exception.html |
diff --git a/LayoutTests/inspector/sources/debugger/debugger-uncaught-promise-on-pause.html b/LayoutTests/inspector/sources/debugger/debugger-uncaught-promise-on-dom-exception.html |
similarity index 60% |
copy from LayoutTests/inspector/sources/debugger/debugger-uncaught-promise-on-pause.html |
copy to LayoutTests/inspector/sources/debugger/debugger-uncaught-promise-on-dom-exception.html |
index 846d4698838876f8740ece3a4a3cad03c409b114..1fd7dd2221cbe7c95b525a9a450e6e47042fccf3 100644 |
--- a/LayoutTests/inspector/sources/debugger/debugger-uncaught-promise-on-pause.html |
+++ b/LayoutTests/inspector/sources/debugger/debugger-uncaught-promise-on-dom-exception.html |
@@ -11,34 +11,30 @@ function testFunction() |
debugger; |
} |
-function runPromises(source) |
+function runPromises() |
{ |
- Promise.reject(new Error(source + ".err1")) |
- .then() |
- .then() |
- .then(); // Last is unhandled. |
- |
- var reject |
- var m0 = new Promise(function(res, rej) { reject = rej; }); |
- var m1 = m0.then(function() {}); |
- var m2 = m0.then(function() {}); |
- var m3 = m0.then(function() {}); |
- var m4 = 0; |
- m0.catch(function() { |
- m2.catch(function() { |
- m1.catch(function() { |
- m4 = m3.then(function() {}); // Unhandled. |
- }); |
- }); |
+ var reject; |
+ var p = new Promise(function(res, rej) { |
+ reject = rej; |
+ }); |
+ p.catch(function p_catch() { |
+ throwDOMException(); |
}); |
- reject(new Error(source + ".err2")); |
+ reject(new Error("FAIL: Should not be printed to console")); |
+} |
+ |
+function throwDOMException() |
+{ |
+ var a = document.createElement("div"); |
+ var b = document.createElement("div"); |
+ a.removeChild(b); |
} |
function runPromisesFromInspector() |
{ |
// setTimeout to cut off VM call frames from the stack trace. |
setTimeout(function timeout() { |
- runPromises("inspector") |
+ runPromises() |
}, 0); |
} |
@@ -63,13 +59,9 @@ function test() |
InspectorTest.resumeExecution(); |
} |
- var count = 0; |
function addMessage(uiMessage) |
{ |
- if (uiMessage.toString().indexOf("inspector.err") !== -1) |
- ++count; |
- if (count === 2) |
- InspectorTest.expandConsoleMessages(dump); |
+ InspectorTest.expandConsoleMessages(dump); |
} |
function dump() |
@@ -84,7 +76,7 @@ function test() |
<body onload="runTest()"> |
<p> |
-Tests uncaught promise rejections fired during pause. |
+Tests unhandled promise that was rejected with a DOM exception. |
</p> |
</body> |