Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(257)

Unified Diff: LayoutTests/inspector/sources/debugger/debugger-uncaught-promise-on-dom-exception.html

Issue 660543002: Fix unhandled promise console message to show stack trace of a DOMException. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 2 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
« no previous file with comments | « no previous file | LayoutTests/inspector/sources/debugger/debugger-uncaught-promise-on-dom-exception-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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>
« no previous file with comments | « no previous file | LayoutTests/inspector/sources/debugger/debugger-uncaught-promise-on-dom-exception-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698