head_xpcom.js 689 B

12345678910111213141516171819202122
  1. function get_test_program(prog)
  2. {
  3. var progPath = do_get_cwd();
  4. progPath.append(prog);
  5. progPath.leafName = progPath.leafName + mozinfo.bin_suffix;
  6. return progPath;
  7. }
  8. function set_process_running_environment()
  9. {
  10. var envSvc = Components.classes["@mozilla.org/process/environment;1"].
  11. getService(Components.interfaces.nsIEnvironment);
  12. var dirSvc = Components.classes["@mozilla.org/file/directory_service;1"].
  13. getService(Components.interfaces.nsIProperties);
  14. var greBinDir = dirSvc.get("GreBinD", Components.interfaces.nsIFile);
  15. envSvc.set("DYLD_LIBRARY_PATH", greBinDir.path);
  16. // For Linux
  17. envSvc.set("LD_LIBRARY_PATH", greBinDir.path);
  18. //XXX: handle windows
  19. }