diff --git a/Rakefile b/Rakefile index 7c945e686959a..000ff7cb14235 100644 --- a/Rakefile +++ b/Rakefile @@ -117,7 +117,7 @@ JAVA_RELEASE_TARGETS = [ '//java/client/src/org/openqa/selenium/chrome:chrome', '//java/client/src/org/openqa/selenium/edge:edge', '//java/client/src/org/openqa/selenium/firefox:firefox', - '//java/client/src/org/openqa/selenium/firefox:firefox-legacy', + '//java/client/src/org/openqa/selenium/firefox/xpi:firefox-xpi', '//java/client/src/org/openqa/selenium/ie:ie', '//java/client/src/org/openqa/selenium/lift:lift', '//java/client/src/org/openqa/selenium/opera:opera', diff --git a/cpp/prebuilt/BUCK b/cpp/prebuilt/BUCK index 439bf3ebb428d..58b6fb86453e2 100644 --- a/cpp/prebuilt/BUCK +++ b/cpp/prebuilt/BUCK @@ -4,7 +4,7 @@ export_file( src = 'i386/libnoblur.so', visibility = [ '//dotnet/src/webdriver:webdriver_deps', - '//java/client/src/org/openqa/selenium/firefox:i386', + '//java/client/src/org/openqa/selenium/firefox/xpi:i386', ], ) @@ -14,7 +14,7 @@ export_file( src = 'amd64/libnoblur64.so', visibility = [ '//dotnet/src/webdriver:webdriver_deps', - '//java/client/src/org/openqa/selenium/firefox:amd64', + '//java/client/src/org/openqa/selenium/firefox/xpi:amd64', ], ) diff --git a/java/client/src/org/openqa/selenium/BUCK b/java/client/src/org/openqa/selenium/BUCK index 61a22b4bb2c97..fc849fe2107c2 100644 --- a/java/client/src/org/openqa/selenium/BUCK +++ b/java/client/src/org/openqa/selenium/BUCK @@ -53,7 +53,7 @@ java_library( ':selenium', '//java/client/src/org/openqa/selenium/chrome:chrome', '//java/client/src/org/openqa/selenium/firefox:firefox', - '//java/client/src/org/openqa/selenium/firefox:firefox-legacy', + '//java/client/src/org/openqa/selenium/firefox/xpi:firefox-xpi', '//java/client/src/org/openqa/selenium/edge:edge', '//java/client/src/org/openqa/selenium/ie:ie', '//java/client/src/org/openqa/selenium/opera:opera', diff --git a/java/client/src/org/openqa/selenium/firefox/BUCK b/java/client/src/org/openqa/selenium/firefox/BUCK index 7df16e00411ca..cf1a8b4c9933b 100644 --- a/java/client/src/org/openqa/selenium/firefox/BUCK +++ b/java/client/src/org/openqa/selenium/firefox/BUCK @@ -1,47 +1,11 @@ load("//:selenium-version.bzl", "SE_VERSION") load("//java:rules.bzl", "java_library") -LEGACY_SOURCES = [ - 'XpiDriverInfo.java', - 'XpiDriverService.java', -] - -java_library(name = 'firefox-legacy', - maven_coords = 'org.seleniumhq.selenium:selenium-firefox-legacy-driver:jar:' + SE_VERSION, - maven_pom_template = '//java/client/src/org/openqa/selenium:template-pom', - module_info = "module-info-legacy.txt", - srcs = LEGACY_SOURCES, - resources = [ - ':amd64', - ':i386', - ':webdriver.xpi', - ], - exported_deps = [ - '//java/client/src/org/openqa/selenium/remote:remote', - ], - provided_deps = [ - '//third_party/java/service:auto-service', - ], - annotation_processor_deps = [ - '//third_party/java/auto:auto-common', - '//third_party/java/service:auto-service', - '//third_party/java/guava:guava', - ], - annotation_processors = [ - 'com.google.auto.service.processor.AutoServiceProcessor', - ], - deps = [ - ':firefox', - '//third_party/java/guava:guava', - ], - visibility = [ 'PUBLIC' ], -) - java_library(name = 'firefox', maven_coords = 'org.seleniumhq.selenium:selenium-firefox-driver:jar:' + SE_VERSION, maven_pom_template = '//java/client/src/org/openqa/selenium:template-pom', module_info = "module-info.txt", - srcs = glob(['*.java'], exclude = LEGACY_SOURCES), + srcs = glob(['*.java']), resources = [ ':prefs', ], @@ -69,19 +33,3 @@ export_file(name = 'prefs', src = '//javascript/firefox-driver:webdriver_prefs', out = 'webdriver_prefs.json', ) - -export_file(name = 'webdriver.xpi', - src = '//javascript/firefox-driver:webdriver', -) - -export_file( - name = 'i386', - src = '//cpp/prebuilt:noblur32', - out = 'x86/x_ignore_nofocus.so' -) - -export_file( - name = 'amd64', - src = '//cpp/prebuilt:noblur64', - out = 'amd64/x_ignore_nofocus.so' -) diff --git a/java/client/src/org/openqa/selenium/firefox/ClasspathExtension.java b/java/client/src/org/openqa/selenium/firefox/ClasspathExtension.java index 487863939a7f5..5d5afe8d4d0a9 100644 --- a/java/client/src/org/openqa/selenium/firefox/ClasspathExtension.java +++ b/java/client/src/org/openqa/selenium/firefox/ClasspathExtension.java @@ -28,11 +28,11 @@ import java.io.OutputStream; import java.net.URL; -class ClasspathExtension implements Extension { +public class ClasspathExtension implements Extension { private final Class loadResourcesUsing; private final String loadFrom; - ClasspathExtension(Class loadResourcesUsing, String loadFrom) { + public ClasspathExtension(Class loadResourcesUsing, String loadFrom) { this.loadResourcesUsing = loadResourcesUsing; this.loadFrom = loadFrom; } diff --git a/java/client/src/org/openqa/selenium/firefox/Extension.java b/java/client/src/org/openqa/selenium/firefox/Extension.java index 8a3517a1cf905..629adb4762724 100644 --- a/java/client/src/org/openqa/selenium/firefox/Extension.java +++ b/java/client/src/org/openqa/selenium/firefox/Extension.java @@ -20,6 +20,6 @@ import java.io.File; import java.io.IOException; -interface Extension { +public interface Extension { void writeTo(File parentDirectory) throws IOException; } diff --git a/java/client/src/org/openqa/selenium/firefox/FileExtension.java b/java/client/src/org/openqa/selenium/firefox/FileExtension.java index 538dfc2350772..592bed0177687 100644 --- a/java/client/src/org/openqa/selenium/firefox/FileExtension.java +++ b/java/client/src/org/openqa/selenium/firefox/FileExtension.java @@ -47,12 +47,12 @@ import javax.xml.xpath.XPathConstants; import javax.xml.xpath.XPathFactory; -class FileExtension implements Extension { +public class FileExtension implements Extension { private static final String EM_NAMESPACE_URI = "http://www.mozilla.org/2004/em-rdf#"; private final File toInstall; - FileExtension(File toInstall) { + public FileExtension(File toInstall) { this.toInstall = toInstall; } diff --git a/java/client/src/org/openqa/selenium/firefox/FirefoxBinary.java b/java/client/src/org/openqa/selenium/firefox/FirefoxBinary.java index 7e25d1ae5d6d1..bab121f3f9306 100644 --- a/java/client/src/org/openqa/selenium/firefox/FirefoxBinary.java +++ b/java/client/src/org/openqa/selenium/firefox/FirefoxBinary.java @@ -131,15 +131,15 @@ void amendOptions(FirefoxOptions options) { options.addArguments(extraOptions); } - protected File getFile() { + public File getFile() { return executable.getFile(); } - protected String getPath() { + public String getPath() { return executable.getPath(); } - protected List getExtraOptions() { + public List getExtraOptions() { return extraOptions; } diff --git a/java/client/src/org/openqa/selenium/firefox/FirefoxProfile.java b/java/client/src/org/openqa/selenium/firefox/FirefoxProfile.java index 07402497fd2f3..b3f614dd24968 100644 --- a/java/client/src/org/openqa/selenium/firefox/FirefoxProfile.java +++ b/java/client/src/org/openqa/selenium/firefox/FirefoxProfile.java @@ -376,7 +376,7 @@ public static FirefoxProfile fromJson(String json) throws IOException { "duplicated")); } - protected void cleanTemporaryModel() { + public void cleanTemporaryModel() { clean(model); } diff --git a/java/client/src/org/openqa/selenium/firefox/xpi/BUCK b/java/client/src/org/openqa/selenium/firefox/xpi/BUCK new file mode 100644 index 0000000000000..2e2d15d1aec25 --- /dev/null +++ b/java/client/src/org/openqa/selenium/firefox/xpi/BUCK @@ -0,0 +1,49 @@ +load("//:selenium-version.bzl", "SE_VERSION") +load("//java:rules.bzl", "java_library") + +java_library(name = 'firefox-xpi', + maven_coords = 'org.seleniumhq.selenium:selenium-firefox-xpi-driver:jar:' + SE_VERSION, + maven_pom_template = '//java/client/src/org/openqa/selenium:template-pom', + module_info = "module-info.txt", + srcs = glob(['*.java']), + resources = [ + ':amd64', + ':i386', + ':webdriver.xpi', + ], + exported_deps = [ + '//java/client/src/org/openqa/selenium/remote:remote', + ], + provided_deps = [ + '//third_party/java/service:auto-service', + ], + annotation_processor_deps = [ + '//third_party/java/auto:auto-common', + '//third_party/java/service:auto-service', + '//third_party/java/guava:guava', + ], + annotation_processors = [ + 'com.google.auto.service.processor.AutoServiceProcessor', + ], + deps = [ + '//java/client/src/org/openqa/selenium/firefox:firefox', + '//third_party/java/guava:guava', + ], + visibility = [ 'PUBLIC' ], +) + +export_file(name = 'webdriver.xpi', + src = '//javascript/firefox-driver:webdriver', +) + +export_file( + name = 'i386', + src = '//cpp/prebuilt:noblur32', + out = 'x86/x_ignore_nofocus.so' +) + +export_file( + name = 'amd64', + src = '//cpp/prebuilt:noblur64', + out = 'amd64/x_ignore_nofocus.so' +) diff --git a/java/client/src/org/openqa/selenium/firefox/XpiDriverInfo.java b/java/client/src/org/openqa/selenium/firefox/xpi/XpiDriverInfo.java similarity index 94% rename from java/client/src/org/openqa/selenium/firefox/XpiDriverInfo.java rename to java/client/src/org/openqa/selenium/firefox/xpi/XpiDriverInfo.java index d65aafacfc63a..0bcc3cbe7bedf 100644 --- a/java/client/src/org/openqa/selenium/firefox/XpiDriverInfo.java +++ b/java/client/src/org/openqa/selenium/firefox/xpi/XpiDriverInfo.java @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. -package org.openqa.selenium.firefox; +package org.openqa.selenium.firefox.xpi; import static org.openqa.selenium.firefox.FirefoxDriver.MARIONETTE; import static org.openqa.selenium.remote.CapabilityType.BROWSER_NAME; @@ -28,6 +28,8 @@ import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebDriverException; import org.openqa.selenium.WebDriverInfo; +import org.openqa.selenium.firefox.FirefoxBinary; +import org.openqa.selenium.firefox.FirefoxDriver; import org.openqa.selenium.remote.BrowserType; import java.util.Optional; diff --git a/java/client/src/org/openqa/selenium/firefox/XpiDriverService.java b/java/client/src/org/openqa/selenium/firefox/xpi/XpiDriverService.java similarity index 97% rename from java/client/src/org/openqa/selenium/firefox/XpiDriverService.java rename to java/client/src/org/openqa/selenium/firefox/xpi/XpiDriverService.java index e1e0c5d4a0967..6507124afdfa9 100644 --- a/java/client/src/org/openqa/selenium/firefox/XpiDriverService.java +++ b/java/client/src/org/openqa/selenium/firefox/xpi/XpiDriverService.java @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. -package org.openqa.selenium.firefox; +package org.openqa.selenium.firefox.xpi; import static java.util.concurrent.TimeUnit.SECONDS; import static org.openqa.selenium.firefox.FirefoxOptions.FIREFOX_OPTIONS; @@ -31,6 +31,14 @@ import org.openqa.selenium.Capabilities; import org.openqa.selenium.Platform; import org.openqa.selenium.WebDriverException; +import org.openqa.selenium.firefox.ClasspathExtension; +import org.openqa.selenium.firefox.Extension; +import org.openqa.selenium.firefox.FileExtension; +import org.openqa.selenium.firefox.FirefoxBinary; +import org.openqa.selenium.firefox.FirefoxDriver; +import org.openqa.selenium.firefox.FirefoxDriverService; +import org.openqa.selenium.firefox.FirefoxOptions; +import org.openqa.selenium.firefox.FirefoxProfile; import org.openqa.selenium.io.FileHandler; import org.openqa.selenium.net.UrlChecker; import org.openqa.selenium.os.CommandLine; diff --git a/java/client/src/org/openqa/selenium/firefox/module-info-legacy.txt b/java/client/src/org/openqa/selenium/firefox/xpi/module-info.txt similarity index 87% rename from java/client/src/org/openqa/selenium/firefox/module-info-legacy.txt rename to java/client/src/org/openqa/selenium/firefox/xpi/module-info.txt index 1251d68d01162..f2d662c54e8bc 100644 --- a/java/client/src/org/openqa/selenium/firefox/module-info-legacy.txt +++ b/java/client/src/org/openqa/selenium/firefox/xpi/module-info.txt @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. -module org.openqa.selenium.firefox { +module org.openqa.selenium.firefox.xpi { requires java.xml; requires transitive com.google.common; @@ -26,9 +26,9 @@ module org.openqa.selenium.firefox { exports org.openqa.selenium.firefox; provides org.openqa.selenium.remote.service.DriverService$Builder with - org.openqa.selenium.firefox.XpiDriverService$Builder; + org.openqa.selenium.firefox.xpi.XpiDriverService$Builder; provides org.openqa.selenium.WebDriverInfo with - org.openqa.selenium.firefox.XpiDriverInfo; + org.openqa.selenium.firefox.xpi.XpiDriverInfo; } diff --git a/java/client/test/org/openqa/selenium/firefox/BUCK b/java/client/test/org/openqa/selenium/firefox/BUCK index 9bd84f827aa87..4383dacae847b 100644 --- a/java/client/test/org/openqa/selenium/firefox/BUCK +++ b/java/client/test/org/openqa/selenium/firefox/BUCK @@ -39,6 +39,7 @@ java_library(name = 'tests', deps = [ '//java/client/src/org/openqa/selenium:selenium', '//java/client/src/org/openqa/selenium/firefox:firefox', + '//java/client/src/org/openqa/selenium/firefox/xpi:firefox-xpi', '//java/client/src/org/openqa/selenium/remote:remote', '//java/client/src/org/openqa/selenium/support/ui:wait', '//java/client/test/org/openqa/selenium:tests', diff --git a/java/client/test/org/openqa/selenium/firefox/FirefoxDriverTest.java b/java/client/test/org/openqa/selenium/firefox/FirefoxDriverTest.java index cf0187ece777a..7d2d974181633 100644 --- a/java/client/test/org/openqa/selenium/firefox/FirefoxDriverTest.java +++ b/java/client/test/org/openqa/selenium/firefox/FirefoxDriverTest.java @@ -45,6 +45,7 @@ import org.openqa.selenium.ParallelTestRunner.Worker; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; +import org.openqa.selenium.firefox.xpi.XpiDriverService; import org.openqa.selenium.remote.CapabilityType; import org.openqa.selenium.remote.Command; import org.openqa.selenium.remote.CommandExecutor; diff --git a/java/server/src/org/openqa/selenium/remote/server/ActiveSessionFactory.java b/java/server/src/org/openqa/selenium/remote/server/ActiveSessionFactory.java index edc7d2b0be146..183ad0cfeccaa 100644 --- a/java/server/src/org/openqa/selenium/remote/server/ActiveSessionFactory.java +++ b/java/server/src/org/openqa/selenium/remote/server/ActiveSessionFactory.java @@ -83,7 +83,7 @@ public ActiveSessionFactory() { return marionette instanceof Boolean && !(Boolean) marionette; }, - "org.openqa.selenium.firefox.XpiDriverService") + "org.openqa.selenium.firefox.xpi.XpiDriverService") .put(browserName(CHROME), "org.openqa.selenium.chrome.ChromeDriverService") .put(containsKey("chromeOptions"), "org.openqa.selenium.chrome.ChromeDriverService") .put(browserName(EDGE), "org.openqa.selenium.edge.EdgeDriverService") diff --git a/javascript/firefox-driver/BUCK b/javascript/firefox-driver/BUCK index 215f4d41fe780..0089807903913 100644 --- a/javascript/firefox-driver/BUCK +++ b/javascript/firefox-driver/BUCK @@ -1,4 +1,5 @@ + export_file(name = 'webdriver_prefs', src = 'webdriver.json', visibility = [ @@ -36,7 +37,7 @@ mozilla_extension(name = 'webdriver', chrome = 'extension/chrome.manifest', install = 'extension/install.rdf', visibility = [ - 'PUBLIC', + '//java/client/src/org/openqa/selenium/firefox/xpi:webdriver.xpi', ] )