Ejemplo n.º 1
0
        public async Task InvalidInitCommands()
        {
            var bad_cmd_name = "non-existant.command";

            Func <InspectorClient, CancellationToken, List <(string, Task <Result>)> > fn = (client, token) =>
                                                                                            new List <(string, Task <Result>)>
            {
                ("Profiler.enable", client.SendCommand("Profiler.enable", null, token)),
                (bad_cmd_name, client.SendCommand(bad_cmd_name, null, token))
            };

            await Ready();

            var ae = await Assert.ThrowsAsync <ArgumentException>(async() => await insp.OpenSessionAsync(fn));

            Assert.Contains(bad_cmd_name, ae.Message);
        }
Ejemplo n.º 2
0
        public virtual async Task InitializeAsync()
        {
            Func <InspectorClient, CancellationToken, List <(string, Task <Result>)> > fn = (client, token) =>
            {
                Func <string, (string, Task <Result>)> getInitCmdFn = (cmd) => (cmd, client.SendCommand(cmd, null, token));
                var init_cmds = new List <(string, Task <Result>)>
                {
                    getInitCmdFn("Profiler.enable"),
                    getInitCmdFn("Runtime.enable"),
                    getInitCmdFn("Debugger.enable"),
                    getInitCmdFn("Runtime.runIfWaitingForDebugger")
                };

                return(init_cmds);
            };

            await Ready();

            await insp.OpenSessionAsync(fn);
        }