summaryrefslogtreecommitdiffstats
path: root/xpcom/tests/unit/test_process_directives.js
blob: b1975a43dac0b589e6d771b64d24539ec26edc92 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
function categoryExists(category, entry) {
  try {
    Services.catMan.getCategoryEntry(category, entry);
    return true;
  } catch (e) {
    return false;
  }
}

function run_test() {
  Components.manager.autoRegister(
    do_get_file("data/process_directive.manifest")
  );

  let isChild =
    Services.appinfo.processType == Services.appinfo.PROCESS_TYPE_CONTENT;

  Assert.equal(categoryExists("directives-test", "main-process"), !isChild);
  Assert.equal(categoryExists("directives-test", "content-process"), isChild);
}