public static Task RunAsync(CefThreadId threadId, Action action)
 {
     if (CefRuntime.CurrentlyOn(threadId))
     {
         action();
         return(TaskHelpers.Completed());
     }
     else
     {
         var tcs = new TaskCompletionSource <FakeVoid>();
         StartNew(threadId, () =>
         {
             try
             {
                 action();
                 tcs.SetResultAsync(default(FakeVoid));
             }
             catch (Exception e)
             {
                 tcs.SetExceptionAsync(e);
             }
         });
         return(tcs.Task);
     }
 }
        async Task RegisterNotification(TaskCompletionSource <object> tcs, bool notifyAsync)
        {
            await Task.Delay(500);

            Debug.WriteLine("A.before");

            if (notifyAsync)
            {
                tcs.SetResultAsync(null);
            }
            else
            {
                tcs.SetResult(null);
            }

            Debug.WriteLine("A.after");
        }