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 0f40c014336a75d72fcf2760b64953ac0fcd53e7..9f4e369da710f3a03e0dfc9948fa2a2c0de272f5 100644 |
--- a/chrome/browser/ui/webui/web_ui_browsertest.cc |
+++ b/chrome/browser/ui/webui/web_ui_browsertest.cc |
@@ -46,7 +46,11 @@ using content::WebUIMessageHandler; |
namespace { |
+const FilePath::CharType kMockJSPath[] = |
Sheridan Rawlins
2012/12/18 01:43:35
Any reason we can't keep these alphabetical?
aboxhall
2012/12/18 19:21:35
Nope. Done.
|
+ FILE_PATH_LITERAL("chrome/third_party/mock4js/mock4js.js"); |
const FilePath::CharType kMockJS[] = FILE_PATH_LITERAL("mock4js.js"); |
+const FilePath::CharType kA11yAuditLibraryJSPath[] = FILE_PATH_LITERAL( |
+ "third_party/accessibility-developer-tools/gen/axs_testing.js"); |
const FilePath::CharType kWebUILibraryJS[] = FILE_PATH_LITERAL("test_api.js"); |
const FilePath::CharType kWebUITestFolder[] = FILE_PATH_LITERAL("webui"); |
base::LazyInstance<std::vector<std::string> > error_messages_ = |
@@ -75,6 +79,13 @@ void WebUIBrowserTest::AddLibrary(const FilePath& library_path) { |
user_libraries_.push_back(library_path); |
} |
+void WebUIBrowserTest::AddLibraryFromPath(const FilePath path) { |
Sheridan Rawlins
2012/12/18 01:43:35
const FilePath& path
aboxhall
2012/12/18 19:21:35
Done.
|
+ FilePath filePath; |
+ ASSERT_TRUE(PathService::Get(base::DIR_SOURCE_ROOT, &filePath)); |
+ filePath = filePath.Append(path); |
+ AddLibrary(filePath); |
+} |
+ |
bool WebUIBrowserTest::RunJavascriptFunction(const std::string& function_name) { |
ConstValueVector empty_args; |
return RunJavascriptFunction(function_name, empty_args); |
@@ -330,14 +341,9 @@ void WebUIBrowserTest::SetUpInProcessBrowserTestFixture() { |
ResourceBundle::GetSharedInstance().AddDataPackFromPath( |
resources_pack_path, ui::SCALE_FACTOR_NONE); |
- FilePath mockPath; |
- ASSERT_TRUE(PathService::Get(base::DIR_SOURCE_ROOT, &mockPath)); |
- mockPath = mockPath.AppendASCII("chrome"); |
- mockPath = mockPath.AppendASCII("third_party"); |
- mockPath = mockPath.AppendASCII("mock4js"); |
- mockPath = mockPath.Append(kMockJS); |
- AddLibrary(mockPath); |
+ AddLibraryFromPath(FilePath(kMockJSPath)); |
AddLibrary(FilePath(kWebUILibraryJS)); |
+ AddLibraryFromPath(FilePath(kA11yAuditLibraryJSPath)); |
} |
void WebUIBrowserTest::TearDownInProcessBrowserTestFixture() { |