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

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

Issue 180873008: Add support for python pageset (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove attributes from page constructor Created 6 years, 9 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/util.py
diff --git a/tools/telemetry/telemetry/core/util.py b/tools/telemetry/telemetry/core/util.py
index 55a286327fb6eb6e4e46c2439d62fbe5daea3dc4..e44bd26ffb04226f1024088308388f5d47f96aa1 100644
--- a/tools/telemetry/telemetry/core/util.py
+++ b/tools/telemetry/telemetry/core/util.py
@@ -1,6 +1,7 @@
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
+import imp
import inspect
import logging
import os
@@ -39,6 +40,14 @@ def AddDirToPythonPath(*path_parts):
if os.path.isdir(path) and path not in sys.path:
sys.path.append(path)
+_counter = [0]
+def _GetUniqueModuleName():
+ _counter[0] += 1
+ return "page_set_module_" + str(_counter[0])
+
+def GetPythonPageSetModule(file_path):
+ return imp.load_source(_GetUniqueModuleName(), file_path)
+
def WaitFor(condition, timeout):
"""Waits for up to |timeout| secs for the function |condition| to return True.
« no previous file with comments | « tools/telemetry/telemetry/core/discover_unittest.py ('k') | tools/telemetry/telemetry/page/actions/action_runner.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698