Bug 1931425 - Limit how often moz-label's #setStyles runs r=reusable-components-revie...
[gecko.git] / netwerk / test / unit / test_bug580508.js
bloba17f59b33454d5d6baf1a6f8c32fe42c487dc935
1 "use strict";
3 var ioService = Services.io;
4 var resProt = ioService
5 .getProtocolHandler("resource")
6 .QueryInterface(Ci.nsIResProtocolHandler);
8 function run_test() {
9 // Define a resource:// alias that points to another resource:// URI.
10 let greModulesURI = ioService.newURI("resource://gre/modules/");
11 resProt.setSubstitution("my-gre-modules", greModulesURI);
13 // When we ask for the alias, we should not get the resource://
14 // URI that we registered it for but the original file URI.
15 let greFileSpec = ioService.newURI(
16 "modules/",
17 null,
18 resProt.getSubstitution("gre")
19 ).spec;
20 let aliasURI = resProt.getSubstitution("my-gre-modules");
21 Assert.equal(aliasURI.spec, greFileSpec);
23 // Resolving URIs using the original resource path and the alias
24 // should yield the same result.
25 let greNetUtilURI = ioService.newURI("resource://gre/modules/NetUtil.jsm");
26 let myNetUtilURI = ioService.newURI("resource://my-gre-modules/NetUtil.jsm");
27 Assert.equal(
28 resProt.resolveURI(greNetUtilURI),
29 resProt.resolveURI(myNetUtilURI)