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

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: Comments added to extension_set.csv and small style fixes. 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..ea349d10194747647c258c5f07cc54ae7d59866e 100644
--- a/tools/perf/profile_creators/profile_extender.py
+++ b/tools/perf/profile_creators/profile_extender.py
@@ -58,6 +58,18 @@ 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
+
robliao 2015/07/21 19:49:52 Style: In Python classes, defs get one space. Yeah
sydli 2015/07/21 20:33:04 Done.
+
def SetUpBrowser(self):
"""Finds and starts the browser.
@@ -70,6 +82,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"])

Powered by Google App Engine
This is Rietveld 408576698