protected override string?InvokeJS(string identifier, string?argsJson, JSCallResultType resultType, long targetInstanceId) { InvokeCalls.Add(new InvokeArgs { Identifier = identifier, ArgsJson = argsJson }); return(NextResultJson); }
/// <inheritdoc /> protected override string InvokeJS(string identifier, string?argsJson, JSCallResultType resultType, long targetInstanceId) { var callInfo = new JSCallInfo { FunctionIdentifier = identifier, TargetInstanceId = targetInstanceId, ResultType = resultType, MarshalledCallArgsJson = argsJson ?? "[]", MarshalledCallAsyncHandle = default }; var result = InternalCalls.InvokeJS <object, object, object, string>(out var exception, ref callInfo, null, null, null); return(exception != null ? throw new JSException(exception) : result); }
/// <summary> /// Begins an asynchronous function invocation. /// </summary> /// <param name="taskId">The identifier for the function invocation, or zero if no async callback is required.</param> /// <param name="identifier">The identifier for the function to invoke.</param> /// <param name="argsJson">A JSON representation of the arguments.</param> /// <param name="resultType">The type of result expected from the invocation.</param> /// <param name="targetInstanceId">The instance ID of the target JS object.</param> protected abstract void BeginInvokeJS(long taskId, string identifier, string?argsJson, JSCallResultType resultType, long targetInstanceId);
protected override string?InvokeJS(string identifier, string?argsJson, JSCallResultType resultType, long targetInstanceId) { InvokeJSInvocationCount++; return(null); }
protected override void BeginInvokeJS(long taskId, string identifier, string?argsJson, JSCallResultType resultType, long targetInstanceId) { BeginInvokeJSInvocationCount++; }
protected override void BeginInvokeJS(long asyncHandle, string identifier, string?argsJson, JSCallResultType resultType, long targetInstanceId) { throw new NotImplementedException(); }
/// <inheritdoc /> protected override void BeginInvokeJS(long asyncHandle, string identifier, string?argsJson, JSCallResultType resultType, long targetInstanceId) { var callInfo = new JSCallInfo { FunctionIdentifier = identifier, TargetInstanceId = targetInstanceId, ResultType = resultType, MarshalledCallArgsJson = argsJson ?? "[]", MarshalledCallAsyncHandle = asyncHandle }; InternalCalls.InvokeJS <object, object, object, string>(out _, ref callInfo, null, null, null); }
public void BeginInvokeJS(long taskId, string identifier, string argsJson, JSCallResultType resultType, long targetInstanceId) { DispatchMessageWithErrorHandling(IpcCommon.Serialize(IpcCommon.OutgoingMessageType.BeginInvokeJS, taskId, identifier, argsJson, resultType, targetInstanceId)); }
protected override void BeginInvokeJS(long taskId, string identifier, string argsJson, JSCallResultType resultType, long targetInstanceId) { _ipcSender.BeginInvokeJS(taskId, identifier, argsJson, resultType, targetInstanceId); }
protected override void BeginInvokeJS(long asyncHandle, string identifier, string?argsJson, JSCallResultType resultType, long targetInstanceId) => throw new NotImplementedException("This test only covers sync calls");
protected override void BeginInvokeJS(long taskId, string identifier, string argsJson, JSCallResultType resultType, long targetInstanceId) { throw new NotSupportedException(); }
protected override void BeginInvokeJS(long taskId, string identifier, string argsJson, JSCallResultType resultType, long targetInstanceId) { if (_ipcSender is null) { throw new InvalidOperationException("Cannot invoke JavaScript outside of a WebView context."); } _ipcSender.BeginInvokeJS(taskId, identifier, argsJson, resultType, targetInstanceId); }
protected override void BeginInvokeJS(long taskId, string identifier, string argsJson, JSCallResultType resultType, long targetInstanceId) { Called.Set(); }