Permalink
Browse files

* Fix for SRC-694:

  * Renamed DestroyableRuntimeExecutingBrowserLauncher to CustomBrowserLauncher
  


git-svn-id: https://svn.openqa.org/svn/selenium-rc/trunk@2703 0891141a-5dea-0310-ad27-ebc607f31677
  • Loading branch information...
1 parent 8d131f6 commit c32ce1e2ec6f1c454c718705a3cfdc64d6561cf5 andras.hatvani committed Jul 9, 2009
@@ -99,15 +99,15 @@ public BrowserLauncher getBrowserLauncher(String browser, String sessionId, Remo
}
}
- LOGGER.debug("Requested browser string '" + browser + "' does not match any known browser, treating is as a custom browser...");
+ LOGGER.debug("Requested browser string '" + browser + "' does not match any known browser, treating it as a custom browser...");
Matcher CustomMatcher = CUSTOM_PATTERN.matcher(browser);
if (CustomMatcher.find()) {
String browserStartCommand = CustomMatcher.group(1);
if (browserStartCommand == null) {
throw new RuntimeException("You must specify the path to an executable when using *custom!\n\n");
}
browserStartCommand = browserStartCommand.substring(1);
- return new DestroyableRuntimeExecutingBrowserLauncher(browserStartCommand, sessionId);
+ return new CustomBrowserLauncher(browserStartCommand, sessionId, configuration, browserOptions);
}
throw browserNotSupported(browser);
}
@@ -19,21 +19,25 @@
import java.io.IOException;
+import org.openqa.selenium.server.RemoteControlConfiguration;
+
+import org.openqa.selenium.server.BrowserConfigurationOptions;
+
/**
* Runs the specified command path to start the browser, and kills the process to quit.
* @author Paul Hammant
* @version $Revision: 189 $
*/
-public class DestroyableRuntimeExecutingBrowserLauncher extends AbstractBrowserLauncher{
+public class CustomBrowserLauncher extends AbstractBrowserLauncher{
protected Process process;
protected String commandPath;
/** Specifies a command path to run */
- public DestroyableRuntimeExecutingBrowserLauncher(String commandPath, String sessionId) {
- super(sessionId, null, null);
+ public CustomBrowserLauncher(String commandPath, String sessionId, RemoteControlConfiguration configuration, BrowserConfigurationOptions browserOptions) {
+ super(sessionId, configuration, browserOptions);
this.commandPath = commandPath;
this.sessionId = sessionId;
}
@@ -0,0 +1,18 @@
+package org.openqa.selenium.server.browserlaunchers;
+import static org.junit.Assert.*;
+
+import org.junit.Test;
+import org.openqa.selenium.server.RemoteControlConfiguration;
+
+import org.openqa.selenium.server.BrowserConfigurationOptions;
+
+public class CustomBrowserLauncherTest {
+
+ @Test
+ public void constructor_setsBrowserOptions() {
+ BrowserConfigurationOptions browserOptions = new BrowserConfigurationOptions();
+ RemoteControlConfiguration configuration = new RemoteControlConfiguration();
+ CustomBrowserLauncher launcher = new CustomBrowserLauncher("command", "sessionId", configuration, browserOptions);
+ assertNotNull(launcher.browserConfigurationOptions.isSingleWindow());
+ }
+}

0 comments on commit c32ce1e

Please sign in to comment.