summaryrefslogtreecommitdiffstats
path: root/gin/test
diff options
context:
space:
mode:
authorabarth@chromium.org <abarth@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-11-22 07:30:55 +0000
committerabarth@chromium.org <abarth@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-11-22 07:30:55 +0000
commit467834b30f40d1aff0031fbb7660fb211c8112e4 (patch)
tree8e1f09b420bfda00a238ed6613642ac656720d2e /gin/test
parent3ac7e07966540fe5b41bcc60ef14ff6b18fe6057 (diff)
downloadchromium_src-467834b30f40d1aff0031fbb7660fb211c8112e4.zip
chromium_src-467834b30f40d1aff0031fbb7660fb211c8112e4.tar.gz
chromium_src-467834b30f40d1aff0031fbb7660fb211c8112e4.tar.bz2
Teach mojo_js_bindings_unittests to load generated JS files
This CL generalizes gin::FileModuleProvider to be able to load modules from several places in the file system. I've then made use of this facility in mojo_js_bindings_unittests to load generated JavaScript modules created by mojom_js_generator.py, similar to how C++ files can #include from the generated mojom directory. I've deleted sample_service.js now that we can load it from the generated directory. BUG=317398 Review URL: https://codereview.chromium.org/81673002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@236711 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'gin/test')
-rw-r--r--gin/test/file_runner.cc12
1 files changed, 7 insertions, 5 deletions
diff --git a/gin/test/file_runner.cc b/gin/test/file_runner.cc
index e26d1d1..ff5ac5d 100644
--- a/gin/test/file_runner.cc
+++ b/gin/test/file_runner.cc
@@ -19,16 +19,18 @@ namespace gin {
namespace {
-base::FilePath GetModuleBase() {
- base::FilePath path;
- PathService::Get(base::DIR_SOURCE_ROOT, &path);
- return path;
+std::vector<base::FilePath> GetModuleSearchPaths() {
+ std::vector<base::FilePath> search_paths(2);
+ PathService::Get(base::DIR_SOURCE_ROOT, &search_paths[0]);
+ PathService::Get(base::DIR_EXE, &search_paths[1]);
+ search_paths[1] = search_paths[1].AppendASCII("gen");
+ return search_paths;
}
} // namespace
FileRunnerDelegate::FileRunnerDelegate()
- : ModuleRunnerDelegate(GetModuleBase()) {
+ : ModuleRunnerDelegate(GetModuleSearchPaths()) {
AddBuiltinModule(Console::kModuleName, Console::GetTemplate);
AddBuiltinModule(GTest::kModuleName, GTest::GetTemplate);
}