6 from osx_browser_driver import OSXBrowserDriver
9 _log = logging.getLogger(__name__)
11 args = ['--args', '-width', str(int(OSXBrowserDriver._screen_size().width)), '-height', str(int(OSXBrowserDriver._screen_size().height))]
14 class OSXFirefoxDriver(OSXBrowserDriver):
15 process_name = 'firefox'
16 browser_name = 'firefox'
17 app_name = 'Firefox.app'
19 def launch_url(self, url, options, browser_build_path):
20 args_with_url = self._insert_url(args, 0, url)
21 self._launch_process(build_dir=browser_build_path, app_name=self.app_name, url=url, args=args_with_url)
23 def launch_driver(self, url, options, browser_build_path):
24 from webkitpy.thirdparty.autoinstalled.selenium.webdriver.firefox.options import Options
25 firefox_options = Options()
26 if browser_build_path:
27 app_path = os.path.join(browser_build_path, self.app_name)
28 binary_path = os.path.join(app_path, "Contents/MacOS", self.process_name)
29 firefox_options.binary_location = binary_path
30 driver_executable = self.webdriver_binary_path
31 from webkitpy.thirdparty.autoinstalled.selenium import webdriver
32 driver = webdriver.Firefox(firefox_options=firefox_options, executable_path=driver_executable)
33 self._launch_webdriver(url=url, driver=driver)
37 class OSXFirefoxNightlyDriver(OSXBrowserDriver):
38 process_name = 'firefox'
39 browser_name = 'firefox-nightly'
40 app_name = 'FirefoxNightly.app'
42 def launch_url(self, url, options, browser_build_path):
43 args_with_url = self._insert_url(args, 0, url)
44 self._launch_process(build_dir=browser_build_path, app_name=self.app_name, url=url, args=args_with_url)
46 def launch_driver(self, url, options, browser_build_path):
47 from webkitpy.thirdparty.autoinstalled.selenium.webdriver.firefox.options import Options
48 firefox_options = Options()
49 if not browser_build_path:
50 browser_build_path = '/Applications/'
51 app_path = os.path.join(browser_build_path, self.app_name)
52 binary_path = os.path.join(app_path, "Contents/MacOS", self.process_name)
53 firefox_options.binary_location = binary_path
54 driver_executable = self.webdriver_binary_path
55 from webkitpy.thirdparty.autoinstalled.selenium import webdriver
56 driver = webdriver.Firefox(firefox_options=firefox_options, executable_path=driver_executable)
57 self._launch_webdriver(url=url, driver=driver)