-
-
Notifications
You must be signed in to change notification settings - Fork 8.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implementing *webdriver launcher as an extension of RC server
- Loading branch information
Showing
11 changed files
with
242 additions
and
65 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 49 additions & 0 deletions
49
java/server/src/org/openqa/selenium/server/webdriven/DrivenBrowserLauncherFactory.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
/* | ||
* Copyright 2011 Software Freedom Conservancy. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
* | ||
*/ | ||
package org.openqa.selenium.server.webdriven; | ||
|
||
import org.openqa.selenium.Capabilities; | ||
import org.openqa.selenium.remote.server.DriverSessions; | ||
import org.openqa.selenium.server.RemoteControlConfiguration; | ||
import org.openqa.selenium.server.browserlaunchers.BrowserLauncher; | ||
import org.openqa.selenium.server.browserlaunchers.BrowserLauncherFactory; | ||
import org.openqa.selenium.server.browserlaunchers.webdriven.DrivenSeleniumLauncher; | ||
|
||
public class DrivenBrowserLauncherFactory extends BrowserLauncherFactory { | ||
|
||
private final DriverSessions webdriverSessions; | ||
|
||
static { | ||
addBrowserLauncher("webdriver", DrivenSeleniumLauncher.class); | ||
} | ||
|
||
public DrivenBrowserLauncherFactory(DriverSessions webdriverSessions) { | ||
super(); | ||
this.webdriverSessions = webdriverSessions; | ||
} | ||
|
||
protected BrowserLauncher createBrowserLauncher(Class<? extends BrowserLauncher> c, | ||
String browserStartCommand, | ||
String sessionId, RemoteControlConfiguration configuration, Capabilities browserOptions) { | ||
final BrowserLauncher browserLauncher = super.createBrowserLauncher( | ||
c, browserStartCommand, sessionId, configuration, browserOptions); | ||
if (browserLauncher instanceof DrivenSeleniumLauncher) { | ||
((DrivenSeleniumLauncher) browserLauncher).setDriverSessions(webdriverSessions); | ||
} | ||
return browserLauncher; | ||
} | ||
} |
33 changes: 33 additions & 0 deletions
33
.../server/src/org/openqa/selenium/server/webdriven/DrivenSeleniumDriverResourceHandler.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/* | ||
* Copyright 2011 Software Freedom Conservancy. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
* | ||
*/ | ||
|
||
package org.openqa.selenium.server.webdriven; | ||
|
||
|
||
import org.openqa.selenium.remote.server.DriverSessions; | ||
import org.openqa.selenium.server.SeleniumDriverResourceHandler; | ||
import org.openqa.selenium.server.SeleniumServer; | ||
|
||
@SuppressWarnings("serial") | ||
public class DrivenSeleniumDriverResourceHandler extends SeleniumDriverResourceHandler { | ||
|
||
public DrivenSeleniumDriverResourceHandler( | ||
SeleniumServer remoteControl, DriverSessions webdriverSessions) { | ||
super(remoteControl, new DrivenBrowserLauncherFactory(webdriverSessions)); | ||
} | ||
|
||
} |
Oops, something went wrong.