diff options
author | tonyg@chromium.org <tonyg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-06-28 02:46:58 +0000 |
---|---|---|
committer | tonyg@chromium.org <tonyg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-06-28 02:46:58 +0000 |
commit | bdaff90ebfd141adf0b8cf7e0ba3170e53b1d20a (patch) | |
tree | b791841e17d8bdbf2b4526560a27b55bdc2f48d1 /tools | |
parent | de4e82cc4b03f8a9e37fa084a7cbb8f85a4f0603 (diff) | |
download | chromium_src-bdaff90ebfd141adf0b8cf7e0ba3170e53b1d20a.zip chromium_src-bdaff90ebfd141adf0b8cf7e0ba3170e53b1d20a.tar.gz chromium_src-bdaff90ebfd141adf0b8cf7e0ba3170e53b1d20a.tar.bz2 |
[Telemetry] Use PPAPI flash on locally built chrome instances.
All released desktop chromes use PPAPI flash, however the default for a
locally built chrome is to use the NPAPI version. We want the
performance tests on the perf bots to be as true to the released chrome
as possible, so we use the path of the system chrome's flash if it
exists.
This patch only implements it for Linux. After it lands, I'll
immediately implement on mac and win.
PERF SHERIFFS: I expect this to cause a very significant "regression"
on the page cyclers. This is because the benchmark is getting more
realistic, it is not a true regression.
BUG=255056
NOTRY=True
Review URL: https://chromiumcodereview.appspot.com/18121006
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@209080 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'tools')
4 files changed, 28 insertions, 10 deletions
diff --git a/tools/telemetry/docs/telemetry.core.chrome.desktop_browser_backend.html b/tools/telemetry/docs/telemetry.core.chrome.desktop_browser_backend.html index 65f9053..87dc3de 100644 --- a/tools/telemetry/docs/telemetry.core.chrome.desktop_browser_backend.html +++ b/tools/telemetry/docs/telemetry.core.chrome.desktop_browser_backend.html @@ -73,7 +73,7 @@ Methods defined here:<br> <dl><dt><a name="DesktopBrowserBackend-__del__"><strong>__del__</strong></a>(self)</dt></dl> -<dl><dt><a name="DesktopBrowserBackend-__init__"><strong>__init__</strong></a>(self, options, executable, is_content_shell, delete_profile_dir_after_run<font color="#909090">=True</font>)</dt></dl> +<dl><dt><a name="DesktopBrowserBackend-__init__"><strong>__init__</strong></a>(self, options, executable, flash_path, is_content_shell, delete_profile_dir_after_run<font color="#909090">=True</font>)</dt></dl> <hr> Data descriptors defined here:<br> diff --git a/tools/telemetry/docs/telemetry.core.chrome.desktop_browser_finder.html b/tools/telemetry/docs/telemetry.core.chrome.desktop_browser_finder.html index 6f31027..def38b9 100644 --- a/tools/telemetry/docs/telemetry.core.chrome.desktop_browser_finder.html +++ b/tools/telemetry/docs/telemetry.core.chrome.desktop_browser_finder.html @@ -63,7 +63,7 @@ Methods defined here:<br> <dl><dt><a name="PossibleDesktopBrowser-SupportsOptions"><strong>SupportsOptions</strong></a>(self, options)</dt></dl> -<dl><dt><a name="PossibleDesktopBrowser-__init__"><strong>__init__</strong></a>(self, browser_type, options, executable, is_content_shell)</dt></dl> +<dl><dt><a name="PossibleDesktopBrowser-__init__"><strong>__init__</strong></a>(self, browser_type, options, executable, flash_path, is_content_shell)</dt></dl> <dl><dt><a name="PossibleDesktopBrowser-__repr__"><strong>__repr__</strong></a>(self)</dt></dl> diff --git a/tools/telemetry/telemetry/core/chrome/desktop_browser_backend.py b/tools/telemetry/telemetry/core/chrome/desktop_browser_backend.py index bfb19f9..06334b6 100644 --- a/tools/telemetry/telemetry/core/chrome/desktop_browser_backend.py +++ b/tools/telemetry/telemetry/core/chrome/desktop_browser_backend.py @@ -15,7 +15,7 @@ class DesktopBrowserBackend(browser_backend.BrowserBackend): """The backend for controlling a locally-executed browser instance, on Linux, Mac or Windows. """ - def __init__(self, options, executable, is_content_shell, + def __init__(self, options, executable, flash_path, is_content_shell, delete_profile_dir_after_run=True): super(DesktopBrowserBackend, self).__init__( is_content_shell=is_content_shell, @@ -31,6 +31,14 @@ class DesktopBrowserBackend(browser_backend.BrowserBackend): if not self._executable: raise Exception('Cannot create browser, no executable found!') + self._flash_path = None + if flash_path: + if os.path.exists(flash_path): + self._flash_path = flash_path + else: + logging.warning('Could not find flash at %s. Running without flash.' % + flash_path) + if len(options.extensions_to_load) > 0 and is_content_shell: raise browser_backend.ExtensionsNotSupportedException( 'Content shell does not support extensions.') @@ -70,6 +78,8 @@ class DesktopBrowserBackend(browser_backend.BrowserBackend): args.append('--remote-debugging-port=%i' % self._port) if not self.is_content_shell: args.append('--window-size=1280,1024') + if self._flash_path: + args.append('--ppapi-flash-path=%s' % self._flash_path) if self._supports_net_benchmarking: args.append('--enable-net-benchmarking') else: diff --git a/tools/telemetry/telemetry/core/chrome/desktop_browser_finder.py b/tools/telemetry/telemetry/core/chrome/desktop_browser_finder.py index 6fe2f89..9560326 100644 --- a/tools/telemetry/telemetry/core/chrome/desktop_browser_finder.py +++ b/tools/telemetry/telemetry/core/chrome/desktop_browser_finder.py @@ -28,9 +28,11 @@ ALL_BROWSER_TYPES = ','.join([ class PossibleDesktopBrowser(possible_browser.PossibleBrowser): """A desktop browser that can be controlled.""" - def __init__(self, browser_type, options, executable, is_content_shell): + def __init__(self, browser_type, options, executable, flash_path, + is_content_shell): super(PossibleDesktopBrowser, self).__init__(browser_type, options) self._local_executable = executable + self._flash_path = flash_path self._is_content_shell = is_content_shell def __repr__(self): @@ -40,7 +42,8 @@ class PossibleDesktopBrowser(possible_browser.PossibleBrowser): # Returns a touple of the form: (browser, backend) def _CreateBrowserInternal(self, delete_profile_dir_after_run): backend = desktop_browser_backend.DesktopBrowserBackend( - self._options, self._local_executable, self._is_content_shell, + self._options, self._local_executable, self._flash_path, + self._is_content_shell, delete_profile_dir_after_run=delete_profile_dir_after_run) if sys.platform.startswith('linux'): p = linux_platform_backend.LinuxPlatformBackend() @@ -115,12 +118,17 @@ def FindAllAvailableBrowsers(options): if sys.platform == 'darwin': chromium_app_name = 'Chromium.app/Contents/MacOS/Chromium' content_shell_app_name = 'Content Shell.app/Contents/MacOS/Content Shell' + # TODO(tonyg): Implement this on mac. + flash_path = None elif sys.platform.startswith('linux'): chromium_app_name = 'chrome' content_shell_app_name = 'content_shell' + flash_path = '/opt/google/chrome/PepperFlash/libpepflashplayer.so' elif sys.platform.startswith('win'): chromium_app_name = 'chrome.exe' content_shell_app_name = 'content_shell.exe' + # TODO(tonyg): Implement this on win. + flash_path = None else: raise Exception('Platform not recognized') @@ -134,7 +142,7 @@ def FindAllAvailableBrowsers(options): app = os.path.join(chrome_root, build_dir, type_dir, app_name) if os.path.exists(app): browsers.append(PossibleDesktopBrowser(browser_type, options, - app, content_shell)) + app, flash_path, content_shell)) return True return False @@ -151,11 +159,11 @@ def FindAllAvailableBrowsers(options): mac_system = '/Applications/Google Chrome.app/Contents/MacOS/Google Chrome' if os.path.exists(mac_canary): browsers.append(PossibleDesktopBrowser('canary', options, - mac_canary, False)) + mac_canary, None, False)) if os.path.exists(mac_system): browsers.append(PossibleDesktopBrowser('system', options, - mac_system, False)) + mac_system, None, False)) # Linux specific options. if sys.platform.startswith('linux'): @@ -168,8 +176,8 @@ def FindAllAvailableBrowsers(options): except OSError: pass if found: - browsers.append( - PossibleDesktopBrowser('system', options, 'google-chrome', False)) + browsers.append(PossibleDesktopBrowser('system', options, + 'google-chrome', None, False)) # Win32-specific options. if sys.platform.startswith('win'): |