awaitPromise method

Future<AwaitPromiseResult> awaitPromise(
  1. RemoteObjectId promiseObjectId, {
  2. bool? returnByValue,
  3. bool? generatePreview,
})

Add handler to promise with given promise object id. promiseObjectId Identifier of the promise. returnByValue Whether the result is expected to be a JSON object that should be sent by value. generatePreview Whether preview should be generated for the result.

Implementation

Future<AwaitPromiseResult> awaitPromise(RemoteObjectId promiseObjectId,
    {bool? returnByValue, bool? generatePreview}) async {
  var result = await _client.send('Runtime.awaitPromise', {
    'promiseObjectId': promiseObjectId,
    if (returnByValue != null) 'returnByValue': returnByValue,
    if (generatePreview != null) 'generatePreview': generatePreview,
  });
  return AwaitPromiseResult.fromJson(result);
}