diff options
Diffstat (limited to 'main/src/core/MonoDevelop.Ide/MonoDevelop.Components.AutoTest/AutoTestClientSession.cs')
-rw-r--r-- | main/src/core/MonoDevelop.Ide/MonoDevelop.Components.AutoTest/AutoTestClientSession.cs | 32 |
1 files changed, 30 insertions, 2 deletions
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.AutoTest/AutoTestClientSession.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.AutoTest/AutoTestClientSession.cs index d8d656db72..56047273c4 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.AutoTest/AutoTestClientSession.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.AutoTest/AutoTestClientSession.cs @@ -65,6 +65,15 @@ namespace MonoDevelop.Components.AutoTest if (file == null) { var binDir = Path.GetDirectoryName (typeof(AutoTestClientSession).Assembly.Location); file = Path.Combine (binDir, "MonoDevelop.exe"); + if (!File.Exists (file)) { + file = Path.Combine (binDir, "XamarinStudio.exe"); + } + } else if (!File.Exists (file)) { + file = file.Replace ("MonoDevelop.exe", "XamarinStudio.exe"); + } + + if (!File.Exists (file)) { + throw new FileNotFoundException (file); } MonoDevelop.Core.Execution.RemotingService.RegisterRemotingChannel (); @@ -77,7 +86,6 @@ namespace MonoDevelop.Components.AutoTest var pi = new ProcessStartInfo (file, args) { UseShellExecute = false }; pi.EnvironmentVariables ["MONO_AUTOTEST_CLIENT"] = sref; - pi.EnvironmentVariables ["GTK_MODULES"] = "gail:atk-bridge"; if (environment != null) foreach (var e in environment) pi.EnvironmentVariables [e.Key] = e.Value; @@ -355,11 +363,31 @@ namespace MonoDevelop.Components.AutoTest } } + public bool SetActiveConfiguration (Func<AppQuery, AppQuery> query, string configuration) + { + AppResult[] results = Query (query); + if (results.Length == 0) { + return false; + } + + return session.SetActiveConfiguration (results [0], configuration); + } + + public bool SetActiveRuntime (Func<AppQuery, AppQuery> query, string runtime) + { + AppResult[] results = Query (query); + if (results.Length == 0) { + return false; + } + + return session.SetActiveRuntime (results [0], runtime); + } + public void RunAndWaitForTimer (Action action, string counterName, int timeout = 20000) { AutoTestSession.TimerCounterContext context = session.CreateNewTimerContext (counterName); action (); - session.WaitForTimerContext (context); + session.WaitForTimerContext (context, timeout); } public XmlDocument ResultsAsXml (AppResult[] results) |