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

Unified Diff: chrome/test/ui/ui_layout_test.cc

Issue 8641002: Add chrome::DIR_LAYOUT_TESTS to PathService::Get (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Define chrome::DIR_LAYOUT_TESTS Created 9 years, 1 month 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 | « chrome/common/chrome_paths.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/ui/ui_layout_test.cc
diff --git a/chrome/test/ui/ui_layout_test.cc b/chrome/test/ui/ui_layout_test.cc
index 6c0c8c7667d22c9df1718ec0caf53db8fb2abd0c..349c2ff7db9e1c65244219100f64fad54961008a 100644
--- a/chrome/test/ui/ui_layout_test.cc
+++ b/chrome/test/ui/ui_layout_test.cc
@@ -45,35 +45,11 @@ UILayoutTest::~UILayoutTest() {
}
}
-// Gets layout tests root. For the current git workflow, this is
-// third_party/WebKit/LayoutTests
-// On svn workflow (including build machines) and older git workflow, this is
-// chrome/test/data/layout_tests/LayoutTests
-// This function probes for the first and then fallbacks to the second.
-static FilePath GetLayoutTestRoot() {
- FilePath src_root;
- PathService::Get(base::DIR_SOURCE_ROOT, &src_root);
-
- FilePath webkit_layout_tests = src_root;
- webkit_layout_tests = webkit_layout_tests.AppendASCII("third_party");
- webkit_layout_tests = webkit_layout_tests.AppendASCII("WebKit");
- webkit_layout_tests = webkit_layout_tests.AppendASCII("LayoutTests");
- if (file_util::DirectoryExists(webkit_layout_tests))
- return webkit_layout_tests;
-
- FilePath chrome_layout_tests = src_root;
- chrome_layout_tests = chrome_layout_tests.AppendASCII("chrome");
- chrome_layout_tests = chrome_layout_tests.AppendASCII("test");
- chrome_layout_tests = chrome_layout_tests.AppendASCII("data");
- chrome_layout_tests = chrome_layout_tests.AppendASCII("layout_tests");
- chrome_layout_tests = chrome_layout_tests.AppendASCII("LayoutTests");
- return chrome_layout_tests;
-}
-
void UILayoutTest::InitializeForLayoutTest(const FilePath& test_parent_dir,
const FilePath& test_case_dir,
int port) {
- FilePath src_dir = GetLayoutTestRoot();
+ FilePath src_dir;
+ ASSERT_TRUE(PathService::Get(chrome::DIR_LAYOUT_TESTS, &src_dir));
layout_test_dir_ = src_dir.Append(test_parent_dir);
layout_test_dir_ = layout_test_dir_.Append(test_case_dir);
ASSERT_TRUE(file_util::DirectoryExists(layout_test_dir_));
@@ -155,7 +131,8 @@ void UILayoutTest::InitializeForLayoutTest(const FilePath& test_parent_dir,
void UILayoutTest::AddResourceForLayoutTest(const FilePath& parent_dir,
const FilePath& resource_name) {
- FilePath source = GetLayoutTestRoot();
+ FilePath source;
+ ASSERT_TRUE(PathService::Get(chrome::DIR_LAYOUT_TESTS, &source));
source = source.Append(parent_dir);
source = source.Append(resource_name);
« no previous file with comments | « chrome/common/chrome_paths.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698