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

Unified Diff: tools/telemetry/telemetry/core/platform/__init__.py

Issue 21406004: [telemetry] Refactoring of telemetry for the webdriver backend to land in. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase. Created 7 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/telemetry/telemetry/core/platform/__init__.py
diff --git a/tools/telemetry/telemetry/core/platform/__init__.py b/tools/telemetry/telemetry/core/platform/__init__.py
index 5b88286cfa81acd5a52e23f59b31964540f4b090..372915956c50fb2fb32e7ee08c97c55b0a03d805 100644
--- a/tools/telemetry/telemetry/core/platform/__init__.py
+++ b/tools/telemetry/telemetry/core/platform/__init__.py
@@ -2,6 +2,12 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
+import sys
+
+from telemetry.core.platform import linux_platform_backend
+from telemetry.core.platform import mac_platform_backend
+from telemetry.core.platform import win_platform_backend
+
class Platform(object):
"""The platform that the target browser is running on.
@@ -104,3 +110,14 @@ class Platform(object):
This function does not require root or administrator access."""
return self._platform_backend.FlushSystemCacheForDirectory(
directory, ignoring=ignoring)
+
+
+def CreatePlatformBackendForCurrentOS():
+ if sys.platform.startswith('linux'):
+ return linux_platform_backend.LinuxPlatformBackend()
+ elif sys.platform == 'darwin':
+ return mac_platform_backend.MacPlatformBackend()
+ elif sys.platform == 'win32':
+ return win_platform_backend.WinPlatformBackend()
+ else:
+ raise NotImplementedError()
« no previous file with comments | « tools/telemetry/telemetry/core/chrome/desktop_browser_finder.py ('k') | tools/telemetry/telemetry/core/wpr_server.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698