Create gpu_tests version of GetChromiumSrcDir.
In preperation for removing GetChromiumSrcDir from Telemetry, move all
usage in gpu_tests to a local version of the function.
BUG=511332
Review URL: https://codereview.chromium.org/1375303002
Cr-Commit-Position: refs/heads/master@{#351695}
diff --git a/content/test/gpu/gpu_tests/context_lost.py b/content/test/gpu/gpu_tests/context_lost.py
index ce7861a5..80002b0 100644
--- a/content/test/gpu/gpu_tests/context_lost.py
+++ b/content/test/gpu/gpu_tests/context_lost.py
@@ -6,6 +6,7 @@
import context_lost_expectations
import gpu_test_base
+import path_util
from telemetry.core import exceptions
from telemetry.core import util
@@ -13,7 +14,7 @@
from telemetry.story import story_set as story_set_module
data_path = os.path.join(
- util.GetChromiumSrcDir(), 'content', 'test', 'data', 'gpu')
+ path_util.GetChromiumSrcDir(), 'content', 'test', 'data', 'gpu')
wait_timeout = 60 # seconds
diff --git a/content/test/gpu/gpu_tests/exception_formatter.py b/content/test/gpu/gpu_tests/exception_formatter.py
index 912c006..78cbc46 100644
--- a/content/test/gpu/gpu_tests/exception_formatter.py
+++ b/content/test/gpu/gpu_tests/exception_formatter.py
@@ -9,8 +9,9 @@
import sys
import traceback
+import path_util
+
from telemetry.core import exceptions
-from telemetry.core import util
def PrintFormattedException(exception_class=None, exception=None, tb=None,
@@ -55,7 +56,7 @@
print >> sys.stderr
# Format the traceback.
- base_dir = os.path.abspath(util.GetChromiumSrcDir())
+ base_dir = os.path.abspath(path_util.GetChromiumSrcDir())
print >> sys.stderr, 'Traceback (most recent call last):'
for filename, line, function, text in processed_tb:
filename = os.path.abspath(filename)
diff --git a/content/test/gpu/gpu_tests/maps.py b/content/test/gpu/gpu_tests/maps.py
index 939fc575..9109170 100644
--- a/content/test/gpu/gpu_tests/maps.py
+++ b/content/test/gpu/gpu_tests/maps.py
@@ -13,6 +13,7 @@
import cloud_storage_test_base
import gpu_test_base
import maps_expectations
+import path_util
from telemetry.core import util
from telemetry.page import page_test
@@ -100,7 +101,7 @@
def CreateStorySet(self, options):
story_set_path = os.path.join(
- util.GetChromiumSrcDir(), 'content', 'test', 'gpu', 'page_sets')
+ path_util.GetChromiumSrcDir(), 'content', 'test', 'gpu', 'page_sets')
ps = story_set_module.StorySet(
archive_data_file='data/maps.json',
base_dir=story_set_path,
diff --git a/content/test/gpu/gpu_tests/path_util.py b/content/test/gpu/gpu_tests/path_util.py
new file mode 100644
index 0000000..34790ce
--- /dev/null
+++ b/content/test/gpu/gpu_tests/path_util.py
@@ -0,0 +1,10 @@
+# Copyright (c) 2015 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
+
+
+def GetChromiumSrcDir():
+ return os.path.abspath(os.path.join(
+ os.path.dirname(__file__), os.pardir, os.pardir, os.pardir, os.pardir))
diff --git a/content/test/gpu/gpu_tests/screenshot_sync.py b/content/test/gpu/gpu_tests/screenshot_sync.py
index 867d7213..e6984b9 100644
--- a/content/test/gpu/gpu_tests/screenshot_sync.py
+++ b/content/test/gpu/gpu_tests/screenshot_sync.py
@@ -5,16 +5,16 @@
import random
import gpu_test_base
+import path_util
import screenshot_sync_expectations as expectations
from telemetry import benchmark
-from telemetry.core import util
from telemetry.page import page_test
from telemetry.story import story_set as story_set_module
from telemetry.util import image_util
data_path = os.path.join(
- util.GetChromiumSrcDir(), 'content', 'test', 'data', 'gpu')
+ path_util.GetChromiumSrcDir(), 'content', 'test', 'data', 'gpu')
class ScreenshotSyncValidator(gpu_test_base.ValidatorBase):
def CustomizeBrowserOptions(self, options):
diff --git a/content/test/gpu/gpu_tests/webgl_conformance.py b/content/test/gpu/gpu_tests/webgl_conformance.py
index 0f72e60..4c3c9ab 100644
--- a/content/test/gpu/gpu_tests/webgl_conformance.py
+++ b/content/test/gpu/gpu_tests/webgl_conformance.py
@@ -7,9 +7,9 @@
import sys
import gpu_test_base
+import path_util
import webgl_conformance_expectations
-from telemetry.core import util
from telemetry.internal.browser import browser_finder
from telemetry.page import page_test
from telemetry.page import shared_page_state
@@ -17,7 +17,7 @@
conformance_path = os.path.join(
- util.GetChromiumSrcDir(),
+ path_util.GetChromiumSrcDir(),
'third_party', 'webgl', 'src', 'sdk', 'tests')
conformance_harness_script = r"""
diff --git a/content/test/gpu/gpu_tests/webgl_conformance_expectations_unittest.py b/content/test/gpu/gpu_tests/webgl_conformance_expectations_unittest.py
index 2501aac2..e562fb1 100644
--- a/content/test/gpu/gpu_tests/webgl_conformance_expectations_unittest.py
+++ b/content/test/gpu/gpu_tests/webgl_conformance_expectations_unittest.py
@@ -4,11 +4,11 @@
import os
import unittest
-from telemetry.core import util
from telemetry.testing import fakes
import fake_win_amd_gpu_info
import gpu_test_base
+import path_util
import webgl_conformance_expectations
class FakeWindowsPlatform(fakes.FakePlatform):
@@ -50,7 +50,7 @@
expectations = webgl_conformance_expectations.\
WebGLConformanceExpectations(
os.path.join(
- util.GetChromiumSrcDir(),
+ path_util.GetChromiumSrcDir(),
'third_party', 'webgl', 'src', 'sdk', 'tests'))
page = FakePage(
'conformance/glsl/constructors/glsl-construct-vec-mat-index.html',