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

Unified Diff: third_party/WebKit/LayoutTests/inspector-protocol/runtime/runtime-await-promise.html

Issue 2249743006: [DevTools] Fill ExceptionDetails with more details, unify usage across protocol. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: browser test Created 4 years, 4 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
Index: third_party/WebKit/LayoutTests/inspector-protocol/runtime/runtime-await-promise.html
diff --git a/third_party/WebKit/LayoutTests/inspector-protocol/runtime/runtime-await-promise.html b/third_party/WebKit/LayoutTests/inspector-protocol/runtime/runtime-await-promise.html
index 53c25920fa566548e5572589425b42f17333d489..fec2c2c2425d268cdf56b744b89c577ae9642b21 100644
--- a/third_party/WebKit/LayoutTests/inspector-protocol/runtime/runtime-await-promise.html
+++ b/third_party/WebKit/LayoutTests/inspector-protocol/runtime/runtime-await-promise.html
@@ -36,6 +36,22 @@ function test()
.then(() => InspectorTest.sendCommandPromise("Debugger.setAsyncCallStackDepth", { maxDepth: 128 }))
.then(() => testSuite());
+ function dumpResult(result)
+ {
+ if (result.exceptionDetails) {
+ if (result.exceptionDetails.stackTrace && result.exceptionDetails.stackTrace.parent) {
+ for (var frame of result.exceptionDetails.stackTrace.parent.callFrames) {
+ frame.scriptId = 0;
+ frame.url = "";
+ }
+ }
+ result.exceptionDetails.exceptionId = 0;
+ if (result.exceptionDetails.exception)
+ result.exceptionDetails.exception.objectId = 0;
+ }
+ InspectorTest.logObject(result);
+ }
+
function testSuite()
{
InspectorTest.runTestSuite([
@@ -43,7 +59,7 @@ function test()
{
InspectorTest.sendCommandPromise("Runtime.evaluate", { expression: "Promise.resolve(239)"})
.then((result) => InspectorTest.sendCommandPromise("Runtime.awaitPromise", { promiseObjectId: result.result.result.objectId, returnByValue: false, generatePreview: true }))
- .then((result) => InspectorTest.logObject(result.result))
+ .then((result) => dumpResult(result.result))
.then(() => next());
},
@@ -51,7 +67,7 @@ function test()
{
InspectorTest.sendCommandPromise("Runtime.evaluate", { expression: "Promise.reject({ a : 1 })"})
.then((result) => InspectorTest.sendCommandPromise("Runtime.awaitPromise", { promiseObjectId: result.result.result.objectId, returnByValue: true, generatePreview: false }))
- .then((result) => InspectorTest.logObject(result.result))
+ .then((result) => dumpResult(result.result))
.then(() => next());
},
@@ -68,22 +84,13 @@ function test()
InspectorTest.sendCommandPromise("Runtime.evaluate", { expression: "rejectPromise()" });
return promise;
}
-
- function dumpResult(result)
- {
- for (var frame of result.exceptionDetails.stackTrace.parent.callFrames) {
- frame.scriptId = 0;
- frame.url = "";
- }
- InspectorTest.logObject(result);
- }
},
function testPendingPromise(next)
{
InspectorTest.sendCommandPromise("Runtime.evaluate", { expression: "createPromise()"})
.then((result) => scheduleFulfillAndAwaitPromise(result))
- .then((result) => InspectorTest.logObject(result.result))
+ .then((result) => dumpResult(result.result))
.then(() => next());
function scheduleFulfillAndAwaitPromise(result)
@@ -98,7 +105,7 @@ function test()
{
InspectorTest.sendCommandPromise("Runtime.evaluate", { expression: "Promise.resolve()"})
.then((result) => InspectorTest.sendCommandPromise("Runtime.awaitPromise", { promiseObjectId: result.result.result.objectId, returnByValue: true, generatePreview: false }))
- .then((result) => InspectorTest.logObject(result.result))
+ .then((result) => dumpResult(result.result))
.then(() => next());
},

Powered by Google App Engine
This is Rietveld 408576698