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

Unified Diff: tools/telemetry/telemetry/test.py

Issue 19597010: [telemetry] Define benchmark page sets in relation to base directory. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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
« no previous file with comments | « no previous file | tools/telemetry/telemetry/test_runner.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/telemetry/telemetry/test.py
diff --git a/tools/telemetry/telemetry/test.py b/tools/telemetry/telemetry/test.py
index 9e064868a34a5872529c22b16ad38b609bccc4e8..aea190c84b54fcf8888b50ce5b80487375a0e4af 100644
--- a/tools/telemetry/telemetry/test.py
+++ b/tools/telemetry/telemetry/test.py
@@ -1,12 +1,23 @@
# Copyright (c) 2013 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 os
+import sys
+
from telemetry.page import page_runner
from telemetry.page import page_set
from telemetry.page import test_expectations
from telemetry.page import page_test
+def GetBaseDir():
+ main_module = sys.modules['__main__']
+ if hasattr(main_module, '__file__'):
+ return os.path.dirname(main_module.__file__)
+ else:
+ return os.getcwd()
+
+
class Test(object):
"""Base class for a Telemetry test or benchmark.
@@ -38,7 +49,7 @@ class Test(object):
page_set attribute. Override to generate a custom page set.
"""
assert hasattr(self, 'page_set'), 'This test has no "page_set" attribute.'
- return page_set.PageSet.FromFile(self.page_set)
+ return page_set.PageSet.FromFile(os.path.join(GetBaseDir(), self.page_set))
def CreateExpectations(self, ps): # pylint: disable=W0613
"""Get the expectations this test will run with.
« no previous file with comments | « no previous file | tools/telemetry/telemetry/test_runner.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698