From e49e62132eca7c7a4e7926ee496b821d85a635b9 Mon Sep 17 00:00:00 2001 From: titusfortner Date: Mon, 20 Sep 2021 18:15:43 -0500 Subject: [PATCH] Remove Safari specific new window feature which no longer works; w3c compliant endpoint is available --- .../openqa/selenium/safari/SafariDriver.java | 27 +------------- .../safari/SafariDriverCommandExecutor.java | 37 ------------------- 2 files changed, 2 insertions(+), 62 deletions(-) delete mode 100644 java/src/org/openqa/selenium/safari/SafariDriverCommandExecutor.java diff --git a/java/src/org/openqa/selenium/safari/SafariDriver.java b/java/src/org/openqa/selenium/safari/SafariDriver.java index 125c72bc6cf59..6fbc457ad6109 100644 --- a/java/src/org/openqa/selenium/safari/SafariDriver.java +++ b/java/src/org/openqa/selenium/safari/SafariDriver.java @@ -17,14 +17,11 @@ package org.openqa.selenium.safari; -import static java.util.Collections.singletonMap; - -import org.openqa.selenium.Beta; import org.openqa.selenium.Capabilities; import org.openqa.selenium.WebDriverException; import org.openqa.selenium.remote.FileDetector; import org.openqa.selenium.remote.RemoteWebDriver; -import org.openqa.selenium.remote.Response; +import org.openqa.selenium.remote.service.DriverCommandExecutor; /** * A WebDriver implementation that controls Safari using a browser extension @@ -78,7 +75,7 @@ public SafariDriver(SafariDriverService safariService) { * @param safariOptions safari specific options / capabilities for the driver */ public SafariDriver(SafariDriverService safariServer, SafariOptions safariOptions) { - super(new SafariDriverCommandExecutor(safariServer), safariOptions); + super(new DriverCommandExecutor(safariServer), safariOptions); } @Override @@ -87,24 +84,4 @@ public void setFileDetector(FileDetector detector) { "Setting the file detector only works on remote webdriver instances obtained " + "via RemoteWebDriver"); } - - /** - * Open either a new tab or window, depending on what is requested, and return the window handle - * without switching to it. - * - * @return The handle of the new window. - */ - @Beta - public String newWindow(WindowType type) { - Response response = execute( - "SAFARI_NEW_WINDOW", - singletonMap("newTab", type == WindowType.TAB)); - - return (String) response.getValue(); - } - - public enum WindowType { - TAB, - WINDOW, - } } diff --git a/java/src/org/openqa/selenium/safari/SafariDriverCommandExecutor.java b/java/src/org/openqa/selenium/safari/SafariDriverCommandExecutor.java deleted file mode 100644 index 307eb9eb42a57..0000000000000 --- a/java/src/org/openqa/selenium/safari/SafariDriverCommandExecutor.java +++ /dev/null @@ -1,37 +0,0 @@ -// Licensed to the Software Freedom Conservancy (SFC) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The SFC licenses this file -// to you 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.safari; - -import static java.util.Collections.singletonMap; -import static org.openqa.selenium.remote.http.HttpMethod.POST; - -import org.openqa.selenium.remote.CommandInfo; -import org.openqa.selenium.remote.service.DriverCommandExecutor; -import org.openqa.selenium.remote.service.DriverService; - -import java.util.Map; - -class SafariDriverCommandExecutor extends DriverCommandExecutor { - - private static final Map SAFARI_COMMANDS = singletonMap( - "SAFARI_NEW_WINDOW", new CommandInfo("/session/:sessionId/apple/window/new", POST)); - - SafariDriverCommandExecutor(DriverService service) { - super(service, SAFARI_COMMANDS); - } -}