示例#1
0
        public async Task Test_HTMLApp_Start_Should_Create_Session()
        {
            HTMLApp     target = null;
            IDispatcher disp   = await Task.Run(() =>
            {
                target = new HTMLApp();
                return(new WPFUIDispatcher(target.Dispatcher));
            });

            Task.Run(() =>
            {
                Thread.Sleep(1000);
                CefCoreSessionSingleton.Session.Should().NotBeNull();
                disp.Run(() => target.Shutdown(0));
            });

            disp.Run(() => target.Run());
        }
示例#2
0
        public async Task Test_HTMLApp_Start_Should_Create_Session()
        {
            HTMLApp target = null;
            IDispatcher disp = await Task.Run(() =>
            {
                target = new HTMLApp();
                return new WPFUIDispatcher(target.Dispatcher);
            });

            Task.Run(() =>
            {
                Thread.Sleep(1000);
                CefCoreSessionSingleton.Session.Should().NotBeNull();
                disp.Run(() => target.Shutdown(0));
            });

            disp.Run(() => target.Run());

        }
示例#3
0
        public async Task Test_HTMLApp_Start_Should_not_Override_Session()
        {
            using (var ctx = new EnvironmentBuilder())
            {
                HTMLApp     target = null;
                IDispatcher disp   = await Task.Run(() =>
                {
                    target = new HTMLApp();
                    return(new WPFUIDispatcher(target.Dispatcher));
                });

                Task.Run(() =>
                {
                    Thread.Sleep(1000);
                    CefCoreSessionSingleton.Session.Should().Be(ctx.Session);
                    disp.Run(() => target.Shutdown(0));
                });

                disp.Run(() => target.Run());
            }
        }
示例#4
0
        public async Task Test_HTMLApp_Start_Should_not_Override_Session()
        {
            using (var ctx = new EnvironmentBuilder())
            {
                HTMLApp target = null;
                IDispatcher disp = await Task.Run(() =>
                {
                    target = new HTMLApp();
                    return new WPFUIDispatcher(target.Dispatcher);

                });

                Task.Run(() =>
                {
                    Thread.Sleep(1000);
                    CefCoreSessionSingleton.Session.Should().Be(ctx.Session);
                    disp.Run(() => target.Shutdown(0));
                });

                disp.Run(() => target.Run());
            }
        }