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. |