Changeset 239522 in webkit
- Timestamp:
- Dec 21, 2018 3:26:05 PM (5 years ago)
- Location:
- trunk/Tools
- Files:
-
- 17 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Tools/ChangeLog
r239520 r239522 1 2018-12-19 Simon Fraser <simon.fraser@apple.com> 2 3 Add support to run-benchmark to use non-default copies of the browser apps 4 https://bugs.webkit.org/show_bug.cgi?id=192905 5 rdar://problem/46845840 6 7 Reviewed by Dewei Zhu. 8 9 Add support for a --browser-path argument to run-benchmark, which allows you to use 10 a custom app bundle for a given browser (only implemented for Safari at present). 11 12 * Scripts/webkitpy/benchmark_runner/benchmark_runner.py: 13 (BenchmarkRunner.__init__): 14 * Scripts/webkitpy/benchmark_runner/browser_driver/browser_driver.py: 15 (BrowserDriver.__init__): 16 * Scripts/webkitpy/benchmark_runner/browser_driver/browser_driver_factory.py: 17 (BrowserDriverFactory.create): 18 * Scripts/webkitpy/benchmark_runner/browser_driver/osx_browser_driver.py: 19 (OSXBrowserDriver._launch_process): 20 (OSXBrowserDriver._launch_process_with_caffeinate): Fix spelling. 21 (OSXBrowserDriver._launch_process_with_caffinate): Deleted. 22 * Scripts/webkitpy/benchmark_runner/browser_driver/osx_chrome_driver.py: 23 (OSXChromeCanaryDriver.launch_url): 24 * Scripts/webkitpy/benchmark_runner/browser_driver/osx_firefox_driver.py: 25 (OSXFirefoxNightlyDriver.launch_url): 26 * Scripts/webkitpy/benchmark_runner/browser_driver/osx_safari_driver.py: 27 (OSXSafariDriver.__init__): 28 (OSXSafariDriver.launch_url): 29 * Scripts/webkitpy/benchmark_runner/run_benchmark.py: 30 (parse_args): 31 (run_benchmark_plan): 32 * Scripts/webkitpy/benchmark_runner/webserver_benchmark_runner.py: 33 (WebServerBenchmarkRunner.__init__): 34 * Scripts/webkitpy/browserperfdash/browserperfdash_unittest.py: 35 (FakeBenchmarkRunner.__init__): 36 1 37 2018-12-21 Jiewen Tan <jiewen_tan@apple.com> 2 38 -
trunk/Tools/Scripts/webkitpy/benchmark_runner/benchmark_runner.py
-
Property
svn:executable
set to
*
r227739 r239522 24 24 name = 'benchmark_runner' 25 25 26 def __init__(self, plan_file, local_copy, count_override, build_dir, output_file, platform, browser, scale_unit=True, show_iteration_values=False, device_id=None):26 def __init__(self, plan_file, local_copy, count_override, build_dir, output_file, platform, browser, browser_path, scale_unit=True, show_iteration_values=False, device_id=None): 27 27 try: 28 28 plan_file = self._find_plan_file(plan_file) … … 37 37 self._plan['count'] = count_override 38 38 self._browser_driver = BrowserDriverFactory.create(platform, browser) 39 self._browser_path = browser_path 39 40 self._build_dir = os.path.abspath(build_dir) if build_dir else None 40 41 self._output_file = output_file -
Property
svn:executable
set to
-
trunk/Tools/Scripts/webkitpy/benchmark_runner/browser_driver/browser_driver.py
-
Property
svn:executable
set to
*
r219853 r239522 16 16 17 17 @abstractmethod 18 def launch_url(self, url, options, browser_build_path=None ):18 def launch_url(self, url, options, browser_build_path=None, browser_path=None): 19 19 pass 20 20 -
Property
svn:executable
set to
-
trunk/Tools/Scripts/webkitpy/benchmark_runner/browser_driver/browser_driver_factory.py
-
Property
svn:executable
set to
*
-
Property
svn:executable
set to
-
trunk/Tools/Scripts/webkitpy/benchmark_runner/browser_driver/linux_browser_driver.py
r221656 r239522 89 89 browser_retcode=self._browser_process.returncode)) 90 90 91 def launch_url(self, url, options, browser_build_path ):91 def launch_url(self, url, options, browser_build_path, browser_path): 92 92 if not self._browser_arguments: 93 93 self._browser_arguments = [url] -
trunk/Tools/Scripts/webkitpy/benchmark_runner/browser_driver/linux_chrome_driver.py
r221655 r239522 34 34 process_search_list = ['chromium', 'chromium-browser', 'chrome'] 35 35 36 def launch_url(self, url, options, browser_build_path ):36 def launch_url(self, url, options, browser_build_path, browser_path): 37 37 self._browser_arguments = ['--temp-profile', '--start-maximized', 38 38 '--homepage', url] 39 super(LinuxChromeDriver, self).launch_url(url, options, browser_build_path )39 super(LinuxChromeDriver, self).launch_url(url, options, browser_build_path, browser_path) 40 40 41 41 def launch_driver(self, url, options, browser_build_path): -
trunk/Tools/Scripts/webkitpy/benchmark_runner/browser_driver/linux_epiphany_driver.py
r219850 r239522 32 32 process_search_list = ['epiphany', 'epiphany-browser'] 33 33 34 def launch_url(self, url, options, browser_build_path ):34 def launch_url(self, url, options, browser_build_path, browser_path): 35 35 self._browser_arguments = ['--new-window', '-p', 36 36 '--profile={profile}'.format(profile=self._temp_profiledir), 37 37 url] 38 super(EpiphanyBrowserDriver, self).launch_url(url, options, browser_build_path )38 super(EpiphanyBrowserDriver, self).launch_url(url, options, browser_build_path, browser_path) 39 39 40 40 def launch_driver(self, url, options, browser_build_path): -
trunk/Tools/Scripts/webkitpy/benchmark_runner/browser_driver/linux_firefox_driver.py
r221655 r239522 34 34 process_search_list = ['firefox', 'firefox-bin'] 35 35 36 def launch_url(self, url, options, browser_build_path ):36 def launch_url(self, url, options, browser_build_path, browser_path): 37 37 self._browser_arguments = ['-new-instance', '-profile', self._temp_profiledir, 38 38 '-width', str(self._screen_size().width), 39 39 '-height', str(self._screen_size().height), 40 40 url] 41 super(LinuxFirefoxDriver, self).launch_url(url, options, browser_build_path )41 super(LinuxFirefoxDriver, self).launch_url(url, options, browser_build_path, browser_path) 42 42 43 43 def launch_driver(self, url, options, browser_build_path): -
trunk/Tools/Scripts/webkitpy/benchmark_runner/browser_driver/linux_minibrowsergtk_driver.py
r219850 r239522 32 32 process_search_list = ['Tools/Scripts/run-minibrowser', 'MiniBrowser'] 33 33 34 def launch_url(self, url, options, browser_build_path ):34 def launch_url(self, url, options, browser_build_path, browser_path): 35 35 self._browser_arguments = [] 36 36 if self.process_name.endswith('run-minibrowser'): … … 38 38 self._browser_arguments.append('--geometry={w}x{h}'.format(w=self._screen_size().width, h=self._screen_size().height)) 39 39 self._browser_arguments.append(url) 40 super(GTKMiniBrowserDriver, self).launch_url(url, options, browser_build_path )40 super(GTKMiniBrowserDriver, self).launch_url(url, options, browser_build_path, browser_path) 41 41 42 42 def launch_driver(self, url, options, browser_build_path): -
trunk/Tools/Scripts/webkitpy/benchmark_runner/browser_driver/osx_browser_driver.py
r221656 r239522 41 41 # FIXME: May need to be modified for a local build such as setting up DYLD libraries 42 42 args = ['open', '-a', app_path] + args 43 cls._launch_process_with_caff inate(args)43 cls._launch_process_with_caffeinate(args) 44 44 45 45 @classmethod … … 58 58 59 59 @classmethod 60 def _launch_process_with_caffinate(cls, args, env=None): 61 process = subprocess.Popen(args, env=env) 60 def _launch_process_with_caffeinate(cls, args, env=None): 61 try: 62 process = subprocess.Popen(args, env=env) 63 except Exception as error: 64 _log.error('Popen failed: {error}'.format(error=error)) 65 return 66 62 67 subprocess.Popen(["/usr/bin/caffeinate", "-disw", str(process.pid)]) 63 68 return process -
trunk/Tools/Scripts/webkitpy/benchmark_runner/browser_driver/osx_chrome_driver.py
-
Property
svn:executable
set to
*
r224688 r239522 15 15 app_name = 'Google Chrome.app' 16 16 17 def launch_url(self, url, options, browser_build_path): 17 def launch_url(self, url, options, browser_build_path, browser_path): 18 # FIXME: handle self._browser_path. 18 19 args_with_url = self._insert_url(create_args(), 2, url) 19 20 self._launch_process(build_dir=browser_build_path, app_name=self.app_name, url=url, args=args_with_url) … … 38 39 app_name = 'Google Chrome Canary.app' 39 40 40 def launch_url(self, url, options, browser_build_path): 41 def launch_url(self, url, options, browser_build_path, browser_path): 42 # FIXME: handle self._browser_path. 41 43 args_with_url = self._insert_url(create_args(), 2, url) 42 44 self._launch_process(build_dir=browser_build_path, app_name=self.app_name, url=url, args=args_with_url) -
Property
svn:executable
set to
-
trunk/Tools/Scripts/webkitpy/benchmark_runner/browser_driver/osx_firefox_driver.py
-
Property
svn:executable
set to
*
r221655 r239522 15 15 app_name = 'Firefox.app' 16 16 17 def launch_url(self, url, options, browser_build_path): 17 def launch_url(self, url, options, browser_build_path, browser_path): 18 # FIXME: handle self._browser_path. 18 19 args_with_url = self._insert_url(create_args(), 0, url) 19 20 self._launch_process(build_dir=browser_build_path, app_name=self.app_name, url=url, args=args_with_url) … … 39 40 app_name = 'FirefoxNightly.app' 40 41 41 def launch_url(self, url, options, browser_build_path): 42 def launch_url(self, url, options, browser_build_path, browser_path): 43 # FIXME: handle self._browser_path. 42 44 args_with_url = self._insert_url(create_args(), 0, url) 43 45 self._launch_process(build_dir=browser_build_path, app_name=self.app_name, url=url, args=args_with_url) -
Property
svn:executable
set to
-
trunk/Tools/Scripts/webkitpy/benchmark_runner/browser_driver/osx_safari_driver.py
-
Property
svn:executable
set to
*
r223226 r239522 25 25 self._safari_preferences = ["-HomePage", "about:blank", "-WarnAboutFraudulentWebsites", "0", "-ExtensionsEnabled", "0", "-ShowStatusBar", "0", "-NewWindowBehavior", "1", "-NewTabBehavior", "1"] 26 26 27 def launch_url(self, url, options, browser_build_path ):27 def launch_url(self, url, options, browser_build_path, browser_path): 28 28 args = ['/Applications/Safari.app/Contents/MacOS/Safari'] 29 29 env = {} … … 35 35 else: 36 36 _log.info('Could not find Safari.app at %s, using the system Safari instead' % safari_app_in_build_path) 37 elif browser_path: 38 safari_app_in_browser_path = os.path.join(browser_path, 'Contents/MacOS/Safari') 39 if os.path.exists(safari_app_in_browser_path): 40 args = [safari_app_in_browser_path] 41 else: 42 _log.info('Could not find application at %s, using the system Safari instead' % safari_app_in_browser_path) 37 43 38 44 args.extend(self._safari_preferences) 39 45 _log.info('Launching safari: %s with url: %s' % (args[0], url)) 40 self._safari_process = OSXSafariDriver._launch_process_with_caff inate(args, env)46 self._safari_process = OSXSafariDriver._launch_process_with_caffeinate(args, env) 41 47 42 48 # Stop for initialization of the safari process, otherwise, open -
Property
svn:executable
set to
-
trunk/Tools/Scripts/webkitpy/benchmark_runner/run_benchmark.py
r229946 r239522 41 41 mutual_group.add_argument('--read-results-json', dest='json_file', help='Instead of running a benchmark, format the output saved in JSON_FILE.') 42 42 parser.add_argument('--output-file', default=None, help='Save detailed results to OUTPUT in JSON format. By default, results will not be saved.') 43 parser.add_argument('--build-directory', dest='build_dir', help='Path to the browser executable (e.g. WebKitBuild/Release/).')44 43 parser.add_argument('--count', type=int, help='Number of times to run the benchmark (e.g. 5).') 45 44 parser.add_argument('--driver', default=WebServerBenchmarkRunner.name, choices=benchmark_runner_subclasses.keys(), help='Use the specified benchmark driver. Defaults to %s.' % WebServerBenchmarkRunner.name) … … 51 50 parser.add_argument('--no-adjust-unit', dest='scale_unit', action='store_false', help="Don't convert to scientific notation.") 52 51 parser.add_argument('--show-iteration-values', dest='show_iteration_values', action='store_true', help="Show the measured value for each iteration in addition to averages.") 52 53 group = parser.add_mutually_exclusive_group() 54 group.add_argument('--browser-path', help='Specify the path to a non-default copy of the target browser as a path to the .app.') 55 group.add_argument('--build-directory', dest='build_dir', help='Path to the browser executable (e.g. WebKitBuild/Release/).') 53 56 54 57 args = parser.parse_args() … … 66 69 def run_benchmark_plan(args, plan): 67 70 benchmark_runner_class = benchmark_runner_subclasses[args.driver] 68 runner = benchmark_runner_class(plan, args.local_copy, args.count, args.build_dir, args.output_file, args.platform, args.browser, args. scale_unit, args.show_iteration_values, args.device_id)71 runner = benchmark_runner_class(plan, args.local_copy, args.count, args.build_dir, args.output_file, args.platform, args.browser, args.browser_path, args.scale_unit, args.show_iteration_values, args.device_id) 69 72 runner.execute() 70 73 -
trunk/Tools/Scripts/webkitpy/benchmark_runner/webdriver_benchmark_runner.py
-
Property
svn:executable
set to
*
r221656 r239522 23 23 try: 24 24 url = 'file://{root}/{plan_name}/{test_file}'.format(root=web_root, plan_name=self._plan_name, test_file=test_file) 25 driver = self._browser_driver.launch_driver(url, self._plan['options'], self._build_dir )25 driver = self._browser_driver.launch_driver(url, self._plan['options'], self._build_dir, self._browser_path) 26 26 _log.info('Waiting on results from web browser') 27 27 result = WebDriverWait(driver, self._plan['timeout'], poll_frequency=1.0).until(self._get_result) -
Property
svn:executable
set to
-
trunk/Tools/Scripts/webkitpy/benchmark_runner/webserver_benchmark_runner.py
-
Property
svn:executable
set to
*
r227739 r239522 16 16 name = 'webserver' 17 17 18 def __init__(self, plan_file, local_copy, count_override, build_dir, output_file, platform, browser, scale_unit=True, show_iteration_values=False, device_id=None):18 def __init__(self, plan_file, local_copy, count_override, build_dir, output_file, platform, browser, browser_path, scale_unit=True, show_iteration_values=False, device_id=None): 19 19 self._http_server_driver = HTTPServerDriverFactory.create(platform) 20 20 self._http_server_driver.set_device_id(device_id) 21 super(WebServerBenchmarkRunner, self).__init__(plan_file, local_copy, count_override, build_dir, output_file, platform, browser, scale_unit, show_iteration_values, device_id)21 super(WebServerBenchmarkRunner, self).__init__(plan_file, local_copy, count_override, build_dir, output_file, platform, browser, browser_path, scale_unit, show_iteration_values, device_id) 22 22 23 23 def _get_result(self, test_url): … … 31 31 self._http_server_driver.serve(web_root) 32 32 url = urlparse.urljoin(self._http_server_driver.base_url(), self._plan_name + '/' + test_file) 33 self._browser_driver.launch_url(url, self._plan['options'], self._build_dir )33 self._browser_driver.launch_url(url, self._plan['options'], self._build_dir, self._browser_path) 34 34 with Timeout(self._plan['timeout']): 35 35 result = self._get_result(url) -
Property
svn:executable
set to
-
trunk/Tools/Scripts/webkitpy/browserperfdash/browserperfdash_unittest.py
-
Property
svn:executable
set to
*
r232820 r239522 41 41 name = 'fake' 42 42 43 def __init__(self, plan_file, local_copy, count_override, build_dir, output_file, platform, browser ):44 super(FakeBenchmarkRunner, self).__init__(plan_file, local_copy, count_override, build_dir, output_file, platform, browser )43 def __init__(self, plan_file, local_copy, count_override, build_dir, output_file, platform, browser, browser_path): 44 super(FakeBenchmarkRunner, self).__init__(plan_file, local_copy, count_override, build_dir, output_file, platform, browser, browser_path) 45 45 46 46 def execute(self): … … 61 61 plan_list = BenchmarkRunner.available_plans() 62 62 build_dir = os.path.abspath(os.curdir) 63 runner = FakeBenchmarkRunner(plan_list[0], False, 1, build_dir, "/tmp/testOutput.txt", default_platform(), default_browser() )63 runner = FakeBenchmarkRunner(plan_list[0], False, 1, build_dir, "/tmp/testOutput.txt", default_platform(), default_browser(), None) 64 64 self.assertTrue(runner.execute()) -
Property
svn:executable
set to
Note: See TracChangeset
for help on using the changeset viewer.