annotate vendor/instaclick/php-webdriver/lib/WebDriver/Window.php @ 5:12f9dff5fda9 tip

Update to Drupal core 8.7.1
author Chris Cannam
date Thu, 09 May 2019 15:34:47 +0100
parents c75dbcec494b
children
rev   line source
Chris@0 1 <?php
Chris@0 2 /**
Chris@0 3 * Copyright 2011-2017 Anthon Pang. All Rights Reserved.
Chris@0 4 *
Chris@0 5 * Licensed under the Apache License, Version 2.0 (the "License");
Chris@0 6 * you may not use this file except in compliance with the License.
Chris@0 7 * You may obtain a copy of the License at
Chris@0 8 *
Chris@0 9 * http://www.apache.org/licenses/LICENSE-2.0
Chris@0 10 *
Chris@0 11 * Unless required by applicable law or agreed to in writing, software
Chris@0 12 * distributed under the License is distributed on an "AS IS" BASIS,
Chris@0 13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
Chris@0 14 * See the License for the specific language governing permissions and
Chris@0 15 * limitations under the License.
Chris@0 16 *
Chris@0 17 * @package WebDriver
Chris@0 18 *
Chris@0 19 * @author Anthon Pang <apang@softwaredevelopment.ca>
Chris@0 20 * @author Fabrizio Branca <mail@fabrizio-branca.de>
Chris@0 21 */
Chris@0 22
Chris@0 23 namespace WebDriver;
Chris@0 24
Chris@0 25 /**
Chris@0 26 * WebDriver\Window class
Chris@0 27 *
Chris@0 28 * @package WebDriver
Chris@0 29 *
Chris@0 30 * @method array getSize() Get size of the window.
Chris@0 31 * @method void postSize($json) Change the size of the window.
Chris@0 32 * @method array getPosition() Get position of the window.
Chris@0 33 * @method void postPosition($json) Change position of the window.
Chris@0 34 * @method void maximize() Maximize the window if not already maximized.
Chris@0 35 */
Chris@0 36 final class Window extends AbstractWebDriver
Chris@0 37 {
Chris@0 38 /**
Chris@0 39 * Window handle
Chris@0 40 *
Chris@0 41 * @var string
Chris@0 42 */
Chris@0 43 private $windowHandle;
Chris@0 44
Chris@0 45 /**
Chris@0 46 * {@inheritdoc}
Chris@0 47 */
Chris@0 48 protected function methods()
Chris@0 49 {
Chris@0 50 return array(
Chris@0 51 'size' => array('GET', 'POST'),
Chris@0 52 'position' => array('GET', 'POST'),
Chris@0 53 'maximize' => array('POST'),
Chris@0 54 );
Chris@0 55 }
Chris@0 56
Chris@0 57 /**
Chris@0 58 * {@inheritdoc}
Chris@0 59 */
Chris@0 60 protected function obsoleteMethods()
Chris@0 61 {
Chris@0 62 return array(
Chris@0 63 'restore' => array('POST'),
Chris@0 64 );
Chris@0 65 }
Chris@0 66
Chris@0 67 /**
Chris@0 68 * Get window handle
Chris@0 69 *
Chris@0 70 * @return string
Chris@0 71 */
Chris@0 72 public function getHandle()
Chris@0 73 {
Chris@0 74 return $this->windowHandle;
Chris@0 75 }
Chris@0 76
Chris@0 77 /**
Chris@0 78 * Constructor
Chris@0 79 *
Chris@0 80 * @param string $url URL
Chris@0 81 * @param string $windowHandle Window handle
Chris@0 82 */
Chris@0 83 public function __construct($url, $windowHandle)
Chris@0 84 {
Chris@0 85 $this->windowHandle = $windowHandle;
Chris@0 86
Chris@0 87 parent::__construct($url . '/' . $windowHandle);
Chris@0 88 }
Chris@0 89 }