| 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 | 4 |
| 5 print("Tests that Runtime.compileScript and Runtime.runScript work with awaitPro
mise flag."); | 5 InspectorTest.log("Tests that Runtime.compileScript and Runtime.runScript work w
ith awaitPromise flag."); |
| 6 | 6 |
| 7 InspectorTest.runTestSuite([ | 7 InspectorTest.runTestSuite([ |
| 8 function testRunAndCompileWithoutAgentEnable(next) | 8 function testRunAndCompileWithoutAgentEnable(next) |
| 9 { | 9 { |
| 10 Protocol.Runtime.compileScript({ expression: "", sourceURL: "", persistScrip
t: true }) | 10 Protocol.Runtime.compileScript({ expression: "", sourceURL: "", persistScrip
t: true }) |
| 11 .then((result) => InspectorTest.logMessage(result)) | 11 .then((result) => InspectorTest.logMessage(result)) |
| 12 .then(() => Protocol.Runtime.runScript({ scriptId: "1" })) | 12 .then(() => Protocol.Runtime.runScript({ scriptId: "1" })) |
| 13 .then((result) => InspectorTest.logMessage(result)) | 13 .then((result) => InspectorTest.logMessage(result)) |
| 14 .then(() => next()); | 14 .then(() => next()); |
| 15 }, | 15 }, |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 function testAwaitRejectedPromise(next) | 101 function testAwaitRejectedPromise(next) |
| 102 { | 102 { |
| 103 Protocol.Runtime.enable() | 103 Protocol.Runtime.enable() |
| 104 .then(() => Protocol.Runtime.compileScript({ expression: "Promise.reject({
a:1})", sourceURL: "boo.js", persistScript: true })) | 104 .then(() => Protocol.Runtime.compileScript({ expression: "Promise.reject({
a:1})", sourceURL: "boo.js", persistScript: true })) |
| 105 .then((result) => Protocol.Runtime.runScript({ scriptId: result.result.scr
iptId, awaitPromise: true, returnByValue: true })) | 105 .then((result) => Protocol.Runtime.runScript({ scriptId: result.result.scr
iptId, awaitPromise: true, returnByValue: true })) |
| 106 .then((result) => InspectorTest.logMessage(result)) | 106 .then((result) => InspectorTest.logMessage(result)) |
| 107 .then(() => Protocol.Runtime.disable()) | 107 .then(() => Protocol.Runtime.disable()) |
| 108 .then(() => next()); | 108 .then(() => next()); |
| 109 } | 109 } |
| 110 ]); | 110 ]); |
| OLD | NEW |