/**
  * Set the size of the current window. This will change the outer window
  * dimension, not just the view port.
  *
  * @param int $width The target window width.
  * @param int $height The target height height.
  * @return WebDriverWindow The instance.
  */
 public function setSize(WebDriverDimension $size) {
   $params = array(
     'width' => $size->getWidth(),
     'height' => $size->getHeight(),
     ':windowHandle' => 'current',
   );
   $this->executor->execute('setWindowSize', $params);
   return $this;
 }
Example #2
0
 /**
  * Set the size of the current window. This will change the outer window
  * dimension, not just the view port.
  *
  * @param int $width The target window width.
  * @param int $height The target height height.
  * @return WebDriverWindow The instance.
  */
 public function setSize(WebDriverDimension $size)
 {
     $params = array('width' => $size->getWidth(), 'height' => $size->getHeight(), ':windowHandle' => 'current');
     $this->executor->execute(DriverCommand::SET_WINDOW_SIZE, $params);
     return $this;
 }
 /**
  * Check whether the given dimension is the same as the instance.
  *
  * @param WebDriverDimension $dimension The dimension to be compared with.
  * @return bool Whether the height and the width are the same as the
  *              instance.
  */
 public function equals(WebDriverDimension $dimension)
 {
     return $this->height === $dimension->getHeight() && $this->width === $dimension->getWidth();
 }