Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(9)

Unified Diff: tools/perf/profile_creators/profile_extender.py

Issue 1240703003: Extension profile generator + benchmark for startup with profile. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removed redundant code in extensions_profile_extender.py Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: tools/perf/profile_creators/profile_extender.py
diff --git a/tools/perf/profile_creators/profile_extender.py b/tools/perf/profile_creators/profile_extender.py
index 22ace38fbe5ad168be2f39b89fd5555c551b1a3e..95b9fb0f55b337bed3254787ec3c7bdc21bd31d2 100644
--- a/tools/perf/profile_creators/profile_extender.py
+++ b/tools/perf/profile_creators/profile_extender.py
@@ -58,6 +58,17 @@ class ProfileExtender(object):
def browser(self):
return self._browser
+ def EnabledOSList(self):
+ """Returns a list of OSes that this extender can run on.
+
+ Can be overridden by subclasses.
+
+ Returns:
+ List of OS ('win', 'mac', or 'linux') that this extender can run on.
+ None if this extender can run on all platforms.
+ """
+ return None
+
def SetUpBrowser(self):
"""Finds and starts the browser.
@@ -70,6 +81,13 @@ class ProfileExtender(object):
"""
possible_browser = self._GetPossibleBrowser(self.finder_options)
+ os_name = possible_browser.platform.GetOSName()
+ enabled_os_list = self.EnabledOSList()
+ if enabled_os_list is not None and os_name not in enabled_os_list:
+ raise NotImplementedError(
+ 'This profile extender on %s is not yet supported'
+ % os_name)
+
assert possible_browser.supports_tab_control
assert (platform.GetHostPlatform().GetOSName() in
["win", "mac", "linux"])
« no previous file with comments | « tools/perf/profile_creators/extension_set.csv ('k') | tools/perf/profile_creators/update_remote_extensions.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698