Example #1
0
        /// <summary>
        /// Turns on virtual time for all frames (replacing real-time with a synthetic time source) and sets
        /// the current virtual time policy.  Note this supersedes any previous time budget.
        /// </summary>
        /// <param name = "policy">policy</param>
        /// <param name = "budget">If set, after this many virtual milliseconds have elapsed virtual time will be paused and a
        public async System.Threading.Tasks.Task <SetVirtualTimePolicyResponse> SetVirtualTimePolicyAsync(CefSharp.DevTools.Emulation.VirtualTimePolicy policy, long?budget = null, int?maxVirtualTimeTaskStarvationCount = null, bool?waitForNavigation = null, long?initialVirtualTime = null)
        {
            ValidateSetVirtualTimePolicy(policy, budget, maxVirtualTimeTaskStarvationCount, waitForNavigation, initialVirtualTime);
            var dict = new System.Collections.Generic.Dictionary <string, object>();

            dict.Add("policy", this.EnumToString(policy));
            if (budget.HasValue)
            {
                dict.Add("budget", budget.Value);
            }

            if (maxVirtualTimeTaskStarvationCount.HasValue)
            {
                dict.Add("maxVirtualTimeTaskStarvationCount", maxVirtualTimeTaskStarvationCount.Value);
            }

            if (waitForNavigation.HasValue)
            {
                dict.Add("waitForNavigation", waitForNavigation.Value);
            }

            if (initialVirtualTime.HasValue)
            {
                dict.Add("initialVirtualTime", initialVirtualTime.Value);
            }

            var methodResult = await _client.ExecuteDevToolsMethodAsync("Emulation.setVirtualTimePolicy", dict);

            return(methodResult.DeserializeJson <SetVirtualTimePolicyResponse>());
        }
Example #2
0
 partial void ValidateSetVirtualTimePolicy(CefSharp.DevTools.Emulation.VirtualTimePolicy policy, long?budget = null, int?maxVirtualTimeTaskStarvationCount = null, bool?waitForNavigation = null, long?initialVirtualTime = null);