Fix BenchmarkRunner to only import selenium when needed
[WebKit-https.git] / Tools / Scripts / webkitpy / benchmark_runner / browser_driver / linux_chrome_driver.py
index 60c0ffff6785851b8db0d349353c1522291fa405..6b873f5f7f63435f488998ad8b452cbc951fcf0a 100644 (file)
@@ -27,8 +27,6 @@
 import os
 
 from linux_browser_driver import LinuxBrowserDriver
-from selenium import webdriver
-from selenium.webdriver.chrome.options import Options
 
 
 class LinuxChromeDriver(LinuxBrowserDriver):
@@ -41,6 +39,7 @@ class LinuxChromeDriver(LinuxBrowserDriver):
         super(LinuxChromeDriver, self).launch_url(url, options, browser_build_path)
 
     def launch_driver(self, url, options, browser_build_path):
+        from webkitpy.thirdparty.autoinstalled.selenium.webdriver.chrome.options import Options
         options = Options()
         options.add_argument("--disable-web-security")
         options.add_argument("--user-data-dir")
@@ -50,6 +49,7 @@ class LinuxChromeDriver(LinuxBrowserDriver):
             binary_path = os.path.join(browser_build_path, 'chromium-browser')
             options.binary_location = binary_path
         driver_executable = self.webdriver_binary_path
+        from webkitpy.thirdparty.autoinstalled.selenium import webdriver
         driver = webdriver.Chrome(chrome_options=options, executable_path=driver_executable)
         super(LinuxChromeDriver, self).launch_webdriver(url, driver)
         return driver