/// <summary> /// Runs Test process. Returns duration of execution. /// </summary> internal static TimeSpan Launch(ExecutionSettings settings, List <TestRecord> tests, DirectoryInfo executionDirectory, DebuggingEngineCommand debuggingEngine) { //Small hack to lessen the chance that Mosh UI on Win8 will interfere with tests. //This can be removed once all tests play nice and don't bring up Mosh in the middle of the runs. if (Environment.OSVersion.Version.Major >= 6 && Environment.OSVersion.Version.Minor >= 2) { if (ModernShellUtilities.IsImmersiveWindowOpen()) { ModernShellUtilities.EnsureDesktop(); } } PrepareDriverPayload(tests, executionDirectory); //Hmm. Need to check for overflow, or be less Linq-ish... int timeout = AddUpTimeout(settings, tests); DriverLaunchSettings.StoreSettings(executionDirectory.FullName, settings.TestBinariesDirectory.FullName); ProcessStartInfo startInfo = PrepareProcessStartInfo(tests.First().TestInfo.Driver.Executable, executionDirectory, settings); ExecutionEventLog.RecordStatus("Running Driver sandbox."); Process p = Process.Start(startInfo); debuggingEngine.TestStarted(p.Id, executionDirectory); int millisecondsTimeout = timeout; if (!p.WaitForExit(millisecondsTimeout)) { TerminateLaggard(p, millisecondsTimeout); } debuggingEngine.TestEnded(p.StartTime); return(p.ExitTime - p.StartTime); }
public void ApplyState(StateModule settings) { if (Environment.OSVersion.Version.Major >= 6 && Environment.OSVersion.Version.Minor >= 2) { if (ModernShellUtilities.IsImmersiveWindowOpen()) { ModernShellUtilities.EnsureDesktop(); } } }