Chromium Code Reviews| Index: third_party/WebKit/LayoutTests/http/tests/inspector-protocol/resources/protocol-test.html |
| diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector-protocol/resources/protocol-test.html b/third_party/WebKit/LayoutTests/http/tests/inspector-protocol/resources/protocol-test.html |
| index bc93957aee3d03044e32a749c5a5baac195fdc41..ccd1a1720ce389bd4a9735623b000d89ee33a3d9 100644 |
| --- a/third_party/WebKit/LayoutTests/http/tests/inspector-protocol/resources/protocol-test.html |
| +++ b/third_party/WebKit/LayoutTests/http/tests/inspector-protocol/resources/protocol-test.html |
| @@ -298,6 +298,17 @@ InspectorTest.evaluateInPage = function(string, callback) |
| }); |
| }; |
| +/** |
| + * Evaluates expression in page. |
|
dgozman
2017/05/02 19:36:37
We don't add comments.
|
| + * @param {string} expression |
| + * @return {!Promise<?>} |
| + */ |
| +InspectorTest.evaluateInPagePromise = function(expression) |
| +{ |
| + return InspectorTest.sendCommandPromise("Runtime.evaluate", { "expression": expression, awaitPromise: false, returnByValue: true }); |
| +}; |
| + |
| +// Use this if the expression being ran in page is a promise. |
| InspectorTest.evaluateInPageAsync = function(expression) |
| { |
| return InspectorTest.sendCommandPromise("Runtime.evaluate", { "expression": expression, awaitPromise: true, returnByValue: true }).then((message) => message.result.result.value); |