private static NodejsVisualStudioApp WaitForReport(INodeProfiling profiling, INodeProfileSession session, NodejsVisualStudioApp app, out string reportFilename) { while (profiling.IsProfiling) { System.Threading.Thread.Sleep(100); } var report = session.GetReport(1); var filename = report.Filename; Assert.IsTrue(filename.Contains("NodejsProfileTest")); app.OpenNodejsPerformance(); var pyPerf = app.NodejsPerformanceExplorerTreeView; Assert.AreNotEqual(null, pyPerf); var item = pyPerf.FindItem("NodejsProfileTest *", "Reports"); var child = item.FindFirst(System.Windows.Automation.TreeScope.Descendants, Condition.TrueCondition); var childName = child.GetCurrentPropertyValue(AutomationElement.NameProperty) as string; reportFilename = report.Filename; Assert.IsTrue(childName.StartsWith("NodejsProfileTest")); child.SetFocus(); Keyboard.PressAndRelease(System.Windows.Input.Key.Delete); return app; }
private static void WaitForReport(INodeProfiling profiling, INodeProfileSession session, out INodePerformanceReport report, NodejsVisualStudioApp app, out AutomationElement child) { while (profiling.IsProfiling) { System.Threading.Thread.Sleep(500); } report = session.GetReport(1); var filename = report.Filename; Assert.IsTrue(filename.Contains("NodejsProfileTest")); app.OpenNodejsPerformance(); var pyPerf = app.NodejsPerformanceExplorerTreeView; Assert.AreNotEqual(null, pyPerf); var item = pyPerf.FindItem("NodejsProfileTest *", "Reports"); child = item.FindFirst(System.Windows.Automation.TreeScope.Descendants, Condition.TrueCondition); var childName = child.GetCurrentPropertyValue(AutomationElement.NameProperty) as string; Assert.IsTrue(childName.StartsWith("NodejsProfileTest")); AutomationWrapper.EnsureExpanded(child); }
private static INodePerformanceReport WaitForReportIndex(INodeProfileSession session, int index) { var report = session.GetReport(index); for (int trial = 0; trial < 20 && report == null; ++trial) { System.Threading.Thread.Sleep(500); report = session.GetReport(index); } WaitForFileExistenceOnDisk(report.Filename); return report; }