diff options
author | abarth@chromium.org <abarth@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-11-22 07:30:55 +0000 |
---|---|---|
committer | abarth@chromium.org <abarth@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-11-22 07:30:55 +0000 |
commit | 467834b30f40d1aff0031fbb7660fb211c8112e4 (patch) | |
tree | 8e1f09b420bfda00a238ed6613642ac656720d2e /gin/shell | |
parent | 3ac7e07966540fe5b41bcc60ef14ff6b18fe6057 (diff) | |
download | chromium_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/shell')
-rw-r--r-- | gin/shell/gin_main.cc | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/gin/shell/gin_main.cc b/gin/shell/gin_main.cc index e1d95bb..4e18d71 100644 --- a/gin/shell/gin_main.cc +++ b/gin/shell/gin_main.cc @@ -31,15 +31,15 @@ void Run(base::WeakPtr<Runner> runner, const std::string& source) { runner->Run(source); } -base::FilePath GetModuleBase() { - base::FilePath module_base; - CHECK(file_util::GetCurrentDirectory(&module_base)); +std::vector<base::FilePath> GetModuleSearchPaths() { + std::vector<base::FilePath> module_base(1); + CHECK(file_util::GetCurrentDirectory(&module_base[0])); return module_base; } class ShellRunnerDelegate : public ModuleRunnerDelegate { public: - ShellRunnerDelegate() : ModuleRunnerDelegate(GetModuleBase()) { + ShellRunnerDelegate() : ModuleRunnerDelegate(GetModuleSearchPaths()) { AddBuiltinModule(Console::kModuleName, Console::GetTemplate); } |