summaryrefslogtreecommitdiffstats
path: root/toolkit/components/extensions/test/xpcshell/test_ext_trustworthy_origin.js
blob: f509ae17491b233e70a10ae49b0637bcfea76652 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
"use strict";

/**
 * This test is asserting that moz-extension: URLs are recognized as trustworthy local origins
 */

add_task(
  function test_isOriginPotentiallyTrustworthnsIContentSecurityManagery() {
    let uri = NetUtil.newURI("moz-extension://foobar/something.html");
    let principal = Services.scriptSecurityManager.createContentPrincipal(
      uri,
      {}
    );
    Assert.equal(
      principal.isOriginPotentiallyTrustworthy,
      true,
      "it is potentially trustworthy"
    );
  }
);