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

Unified Diff: tools/telemetry/telemetry/core/browser_finder.py

Issue 124733002: [Telemetry] Support downloading profiles from cloud storage (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Whitespace fixes Created 6 years, 11 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/telemetry/telemetry/core/browser_finder.py
diff --git a/tools/telemetry/telemetry/core/browser_finder.py b/tools/telemetry/telemetry/core/browser_finder.py
index 66bf22e5e291d2e8d382487faec0b67c10218242..3c94c0f4fc7dc28417ed52876b2daca3770ba360 100644
--- a/tools/telemetry/telemetry/core/browser_finder.py
+++ b/tools/telemetry/telemetry/core/browser_finder.py
@@ -6,6 +6,7 @@
import logging
import operator
+import sys
from telemetry.core.backends.webdriver import webdriver_desktop_browser_finder
from telemetry.core.backends.chrome import android_browser_finder
@@ -30,6 +31,25 @@ class BrowserTypeRequiredException(Exception):
class BrowserFinderException(Exception):
pass
+def TargetBrowserOS(options):
jeremy 2014/01/06 06:57:07 Guessing that we want a more robust version of thi
aberent 2014/01/06 10:44:52 How difficult would it be to create the robust ver
jeremy 2014/01/06 11:23:58 Yes, was mainly looking for feedback before I make
+ """ Return the OS of the target that the browser will run on.
+
+ TODO(jeremy):
+ This function is meant to run before FindBrowser() which performs the final
+ resolution of target OS. Under certain circumstances e.g. browser_type=any
+ the value returned by this function may be incorrect.
+
+ Returns:
+ String indicating target OS.
+ """
+ browser_type = options.browser_type
+ if browser_type and browser_type.startswith('cros'):
+ return 'cros'
+ elif browser_type and browser_type.startswith('android'):
+ return 'android'
+
+ return sys.platform.lower()
+
def FindBrowser(options):
"""Finds the best PossibleBrowser object given a BrowserOptions object.

Powered by Google App Engine
This is Rietveld 408576698