Beispiel #1
0
        public async Task BrowseOnExistingPrompt()
        {
            using (var inter = await _session.BeginInteractionAsync()) {
                await inter.RespondAsync("browser()\n");
            }

            using (var inter = await _session.BeginInteractionAsync()) {
                inter.Contexts.IsBrowser().Should().BeTrue();
            }

            using (var debugSession = new DebugSession(_session)) {
                await debugSession.InitializeAsync();

                await EventTaskSources.DebugSession.Browse.Create(debugSession);
            }
        }
        public async Task<DebugSession> GetDebugSessionAsync(IRSession session, CancellationToken cancellationToken = default(CancellationToken)) {
            DebugSession debugSession;

            await _sem.WaitAsync(cancellationToken).ConfigureAwait(false);
            try {
                if (!_debugSessions.TryGetValue(session, out debugSession)) {
                    debugSession = new DebugSession(session);
                    await debugSession.InitializeAsync(cancellationToken).ConfigureAwait(false);
                    _debugSessions.Add(session, debugSession);
                }

                session.Disposed += Session_Disposed;
            } finally {
                _sem.Release();
            }

            return debugSession;
        }
Beispiel #3
0
        public async Task <DebugSession> GetDebugSessionAsync(IRSession session, CancellationToken cancellationToken = default(CancellationToken))
        {
            DebugSession debugSession;

            await _sem.WaitAsync(cancellationToken).ConfigureAwait(false);

            try {
                if (!_debugSessions.TryGetValue(session, out debugSession))
                {
                    debugSession = new DebugSession(session);
                    await debugSession.InitializeAsync(cancellationToken).ConfigureAwait(false);

                    _debugSessions.Add(session, debugSession);
                }

                session.Disposed += Session_Disposed;
            } finally {
                _sem.Release();
            }

            return(debugSession);
        }
Beispiel #4
0
        public async Task BrowseOnExistingPrompt() {
            using (var inter = await _session.BeginInteractionAsync()) {
                await inter.RespondAsync("browser()\n");
            }

            using (var inter = await _session.BeginInteractionAsync()) {
                inter.Contexts.IsBrowser().Should().BeTrue();
            }

            using (var debugSession = new DebugSession(_session)) {
                await debugSession.InitializeAsync();
                await EventTaskSources.DebugSession.Browse.Create(debugSession);
            }
        }