Exemplo n.º 1
0
 internal void ContextDestroyed(FrameExecutionContext context)
 {
     foreach (var contextType in _contextData.Keys)
     {
         var data = _contextData[contextType];
         if (data.Context == context)
         {
             SetContext(contextType, null);
         }
     }
 }
Exemplo n.º 2
0
        internal void ContextCreated(ContextType contextType, FrameExecutionContext context)
        {
            var data = _contextData[contextType];

            // In case of multiple sessions to the same target, there's a race between
            // connections so we might end up creating multiple isolated worlds.
            // We can use either.
            if (data.Context != null)
            {
                SetContext(contextType, null);
            }

            SetContext(contextType, context);
        }
Exemplo n.º 3
0
        private void SetContext(ContextType contextType, FrameExecutionContext context)
        {
            var data = _contextData[contextType];

            data.Context = context;

            if (context != null)
            {
                data.ContextTsc.TrySetResult(context);

                foreach (var rerunnableTask in data.RerunnableTasks)
                {
                    _ = rerunnableTask.RerunAsync(context);
                }
            }
            else
            {
                data.ContextTsc = new TaskCompletionSource <FrameExecutionContext>();
            }
        }
Exemplo n.º 4
0
 internal ElementHandle(FrameExecutionContext context, IRemoteObject remoteObject) : base(context, remoteObject)
 {
     Page    = context.Frame.Page;
     Context = context;
 }