49ad05f68f
Fetch message and stack trace from error object if Promise is rejected with native JS error. Bug: v8:6249 Cq-Include-Trybots: master.tryserver.chromium.linux:linux_chromium_rel_ng Change-Id: Icf84205eb9d16e860600b7cc916ddcb1922be040 Reviewed-on: https://chromium-review.googlesource.com/563096 Reviewed-by: Jakob Gruber <jgruber@chromium.org> Commit-Queue: Aleksey Kozyatinskiy <kozyatinskiy@chromium.org> Cr-Commit-Position: refs/heads/master@{#46483}
182 lines
4.6 KiB
Plaintext
182 lines
4.6 KiB
Plaintext
Tests that Runtime.awaitPromise works.
|
|
|
|
Running test: testResolvedPromise
|
|
{
|
|
id : <messageId>
|
|
result : {
|
|
result : {
|
|
description : 239
|
|
type : number
|
|
value : 239
|
|
}
|
|
}
|
|
}
|
|
|
|
Running test: testRejectedPromise
|
|
{
|
|
id : <messageId>
|
|
result : {
|
|
exceptionDetails : {
|
|
columnNumber : 0
|
|
exception : {
|
|
type : object
|
|
value : {
|
|
a : 1
|
|
}
|
|
}
|
|
exceptionId : <exceptionId>
|
|
lineNumber : 0
|
|
stackTrace : {
|
|
callFrames : [
|
|
]
|
|
parent : {
|
|
callFrames : [
|
|
[0] : {
|
|
columnNumber : 8
|
|
functionName :
|
|
lineNumber : 0
|
|
scriptId : <scriptId>
|
|
url :
|
|
}
|
|
]
|
|
description : Promise.reject
|
|
}
|
|
}
|
|
text : Uncaught (in promise)
|
|
}
|
|
result : {
|
|
type : object
|
|
value : {
|
|
a : 1
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
Running test: testRejectedPromiseWithStack
|
|
{
|
|
id : <messageId>
|
|
result : {
|
|
exceptionDetails : {
|
|
columnNumber : 0
|
|
exception : {
|
|
description : 239
|
|
type : number
|
|
value : 239
|
|
}
|
|
exceptionId : <exceptionId>
|
|
lineNumber : 0
|
|
stackTrace : {
|
|
callFrames : [
|
|
]
|
|
parent : {
|
|
callFrames : [
|
|
[0] : {
|
|
columnNumber : 4
|
|
functionName : rejectPromise
|
|
lineNumber : 17
|
|
scriptId : <scriptId>
|
|
url : test.js
|
|
}
|
|
[1] : {
|
|
columnNumber : 0
|
|
functionName :
|
|
lineNumber : 0
|
|
scriptId : <scriptId>
|
|
url :
|
|
}
|
|
]
|
|
description : Promise.reject
|
|
}
|
|
}
|
|
text : Uncaught (in promise)
|
|
}
|
|
result : {
|
|
description : 239
|
|
type : number
|
|
value : 239
|
|
}
|
|
}
|
|
}
|
|
|
|
Running test: testRejectedPromiseWithError
|
|
{
|
|
id : <messageId>
|
|
result : {
|
|
exceptionDetails : {
|
|
columnNumber : 0
|
|
exception : {
|
|
className : Error
|
|
description : Error: MyError at rejectPromiseWithAnError (test.js:25:20) at <anonymous>:1:1
|
|
objectId : <objectId>
|
|
subtype : error
|
|
type : object
|
|
}
|
|
exceptionId : <exceptionId>
|
|
lineNumber : 0
|
|
stackTrace : {
|
|
callFrames : [
|
|
]
|
|
parent : {
|
|
callFrames : [
|
|
[0] : {
|
|
columnNumber : 4
|
|
functionName : rejectPromiseWithAnError
|
|
lineNumber : 24
|
|
scriptId : <scriptId>
|
|
url : test.js
|
|
}
|
|
[1] : {
|
|
columnNumber : 0
|
|
functionName :
|
|
lineNumber : 0
|
|
scriptId : <scriptId>
|
|
url :
|
|
}
|
|
]
|
|
description : Promise.reject
|
|
}
|
|
}
|
|
text : Uncaught (in promise) Error: MyError
|
|
}
|
|
result : {
|
|
className : Error
|
|
description : Error: MyError at rejectPromiseWithAnError (test.js:25:20) at <anonymous>:1:1
|
|
objectId : <objectId>
|
|
subtype : error
|
|
type : object
|
|
}
|
|
}
|
|
}
|
|
|
|
Running test: testPendingPromise
|
|
{
|
|
id : <messageId>
|
|
result : {
|
|
result : {
|
|
description : 239
|
|
type : number
|
|
value : 239
|
|
}
|
|
}
|
|
}
|
|
|
|
Running test: testResolvedWithoutArgsPromise
|
|
{
|
|
id : <messageId>
|
|
result : {
|
|
result : {
|
|
type : undefined
|
|
}
|
|
}
|
|
}
|
|
|
|
Running test: testGarbageCollectedPromise
|
|
{
|
|
error : {
|
|
code : -32000
|
|
message : Promise was collected
|
|
}
|
|
id : <messageId>
|
|
}
|