OLD | NEW |
1 // Copyright 2016 the V8 project authors. All rights reserved. | 1 // Copyright 2016 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 // Flags: --expose_gc | 4 // Flags: --expose_gc |
5 | 5 |
6 InspectorTest.log("Tests that Runtime.awaitPromise works."); | 6 let {session, contextGroup, Protocol} = InspectorTest.start("Tests that Runtime.
awaitPromise works."); |
7 | 7 |
8 InspectorTest.addScript( | 8 contextGroup.addScript( |
9 ` | 9 ` |
10 var resolveCallback; | 10 var resolveCallback; |
11 var rejectCallback; | 11 var rejectCallback; |
12 function createPromise() | 12 function createPromise() |
13 { | 13 { |
14 return new Promise((resolve, reject) => { resolveCallback = resolve; rejectC
allback = reject }); | 14 return new Promise((resolve, reject) => { resolveCallback = resolve; rejectC
allback = reject }); |
15 } | 15 } |
16 | 16 |
17 function resolvePromise() | 17 function resolvePromise() |
18 { | 18 { |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 } | 107 } |
108 | 108 |
109 function gcPromise(objectId) | 109 function gcPromise(objectId) |
110 { | 110 { |
111 Protocol.Runtime.releaseObject({ objectId: objectId}) | 111 Protocol.Runtime.releaseObject({ objectId: objectId}) |
112 .then(() => Protocol.Runtime.evaluate({ expression: "gc()" })); | 112 .then(() => Protocol.Runtime.evaluate({ expression: "gc()" })); |
113 } | 113 } |
114 } | 114 } |
115 ]); | 115 ]); |
116 } | 116 } |
OLD | NEW |