From 467834b30f40d1aff0031fbb7660fb211c8112e4 Mon Sep 17 00:00:00 2001 From: "abarth@chromium.org" Date: Fri, 22 Nov 2013 07:30:55 +0000 Subject: 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 --- gin/shell/gin_main.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'gin/shell') 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, const std::string& source) { runner->Run(source); } -base::FilePath GetModuleBase() { - base::FilePath module_base; - CHECK(file_util::GetCurrentDirectory(&module_base)); +std::vector GetModuleSearchPaths() { + std::vector 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); } -- cgit v1.1