test_process_directives.js 857 B

1234567891011121314151617181920212223242526
  1. var Ci = Components.interfaces;
  2. var Cc = Components.classes;
  3. Components.utils.import("resource:///modules/Services.jsm");
  4. function run_test()
  5. {
  6. Components.manager.autoRegister(do_get_file("data/process_directive.manifest"));
  7. let isChild = Services.appinfo.processType == Services.appinfo.PROCESS_TYPE_CONTENT;
  8. if (isChild) {
  9. do_check_false("@mozilla.org/xpcom/tests/MainProcessDirectiveTest;1" in Cc);
  10. } else {
  11. let svc = Cc["@mozilla.org/xpcom/tests/MainProcessDirectiveTest;1"].createInstance(Ci.nsISupportsString);
  12. do_check_eq(svc.data, "main process");
  13. }
  14. if (!isChild) {
  15. do_check_false("@mozilla.org/xpcom/tests/ChildProcessDirectiveTest;1" in Cc);
  16. } else {
  17. let svc = Cc["@mozilla.org/xpcom/tests/ChildProcessDirectiveTest;1"].createInstance(Ci.nsISupportsString);
  18. do_check_eq(svc.data, "child process");
  19. }
  20. }