Пример #1
0
        private void RunPlayerTest(string clipTitle, Func <TestContext, Task> testImpl)
        {
            AsyncContext.Run(async() =>
            {
                using (var service = new JuvoPlayer.TizenTests.Utils.PlayerService())
                    using (var cts = new CancellationTokenSource())
                    {
                        var context = new TestContext
                        {
                            Service   = service,
                            ClipTitle = clipTitle,
                            Token     = cts.Token,
                            Timeout   = TimeSpan.FromSeconds(20)
                        };
                        await new PrepareOperation().Execute(context);
                        await new StartOperation().Execute(context);

                        await testImpl(context);
                    }
            });
        }
Пример #2
0
        private TimeSpan RandomSeekTime(PlayerService service)
        {
            var rand = new Random();

            return(TimeSpan.FromSeconds(rand.Next((int)service.Duration.TotalSeconds - 10)));
        }