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

Unified Diff: chrome/browser/ui/webui/web_ui_browsertest.cc

Issue 8333013: Allow generator javascript test files to go anywhere in the source tree (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address Nits. Created 9 years, 2 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 | « chrome/browser/ui/webui/web_ui_browsertest.h ('k') | chrome/chrome_tests.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/web_ui_browsertest.cc
diff --git a/chrome/browser/ui/webui/web_ui_browsertest.cc b/chrome/browser/ui/webui/web_ui_browsertest.cc
index e0a058bc5939db2728eeb7bcfaec0a993f9e4573..2c84f2dfa98dfe206026b2aad3bd794d18c79af9 100644
--- a/chrome/browser/ui/webui/web_ui_browsertest.cc
+++ b/chrome/browser/ui/webui/web_ui_browsertest.cc
@@ -251,6 +251,8 @@ void WebUIBrowserTest::SetUpInProcessBrowserTestFixture() {
ASSERT_TRUE(PathService::Get(chrome::DIR_TEST_DATA, &test_data_directory_));
test_data_directory_ = test_data_directory_.Append(kWebUITestFolder);
+ ASSERT_TRUE(PathService::Get(chrome::DIR_GEN_TEST_DATA,
+ &gen_test_data_directory_));
// TODO(dtseng): should this be part of every BrowserTest or just WebUI test.
FilePath resources_pack_path;
@@ -307,9 +309,15 @@ void WebUIBrowserTest::BuildJavascriptLibraries(string16* content) {
&library_content))
<< user_libraries_iterator->value();
} else {
- ASSERT_TRUE(file_util::ReadFileToString(
- test_data_directory_.Append(*user_libraries_iterator),
- &library_content)) << user_libraries_iterator->value();
+ bool ok = file_util::ReadFileToString(
+ gen_test_data_directory_.Append(*user_libraries_iterator),
+ &library_content);
+ if (!ok) {
+ ok = file_util::ReadFileToString(
+ test_data_directory_.Append(*user_libraries_iterator),
+ &library_content);
+ }
+ ASSERT_TRUE(ok) << user_libraries_iterator->value();
}
utf8_content.append(library_content);
utf8_content.append(";\n");
« no previous file with comments | « chrome/browser/ui/webui/web_ui_browsertest.h ('k') | chrome/chrome_tests.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698