Upstream version 7.36.149.0
[platform/framework/web/crosswalk.git] / src / mojo / common / test / test_utils_win.cc
index 97ec466..aaabc01 100644 (file)
@@ -6,6 +6,9 @@
 
 #include <windows.h>
 
+#include "base/base_paths.h"
+#include "base/path_service.h"
+#include "base/strings/string_util.h"
 #include "mojo/embedder/platform_handle.h"
 
 namespace mojo {
@@ -76,5 +79,13 @@ bool NonBlockingRead(const embedder::PlatformHandle& handle,
   return true;
 }
 
+base::FilePath GetFilePathForJSResource(const std::string& path) {
+  std::string binding_path = "gen/" + path + ".js";
+  base::ReplaceChars(binding_path, "//", "\\", &binding_path);
+  base::FilePath exe_dir;
+  PathService::Get(base::DIR_EXE, &exe_dir);
+  return exe_dir.AppendASCII(binding_path);
+}
+
 }  // namespace test
 }  // namespace mojo