Skip to content

Commit

Permalink
Merge branch 'request-timeout--allow-specifying-during-connection' of h…
Browse files Browse the repository at this point in the history
…ttps://github.com/iFixit/php-webdriver into iFixit-request-timeout--allow-specifying-during-connection
  • Loading branch information
whhone committed Jan 12, 2015
2 parents 58223ee + c84d655 commit daf6263
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
3 changes: 2 additions & 1 deletion lib/chrome/ChromeDriver.php
Expand Up @@ -47,7 +47,8 @@ public function startSession($desired_capabilities) {
public static function create(
$url = 'http://localhost:4444/wd/hub',
$desired_capabilities = null,
$timeout_in_ms = 300000
$timeout_in_ms = 300000,
$request_timeout_in_ms = 300000
) {
throw new WebDriverException('Please use ChromeDriver::start() instead.');
}
Expand Down
5 changes: 4 additions & 1 deletion lib/remote/RemoteWebDriver.php
Expand Up @@ -47,12 +47,14 @@ protected function __construct() {}
* @param string $url The url of the remote server
* @param DesiredCapabilities $desired_capabilities The desired capabilities
* @param int $connection_timeout_in_ms
* @param int $request_timeout_in_ms
* @return RemoteWebDriver
*/
public static function create(
$url = 'http://localhost:4444/wd/hub',
$desired_capabilities = null,
$connection_timeout_in_ms = 300000
$connection_timeout_in_ms = 300000,
$request_timeout_in_ms = 300000
) {
$url = preg_replace('#/+$#', '', $url);

Expand All @@ -64,6 +66,7 @@ public static function create(

$executor = new HttpCommandExecutor($url);
$executor->setConnectionTimeout($connection_timeout_in_ms);
$executor->setRequestTimeout($request_timeout_in_ms);

$command = new WebDriverCommand(
null,
Expand Down

0 comments on commit daf6263

Please sign in to comment.