| |
1 <!DOCTYPE html> |
| |
2 <!-- |
| |
3 Any copyright is dedicated to the Public Domain. |
| |
4 http://creativecommons.org/publicdomain/zero/1.0/ |
| |
5 --> |
| |
6 |
| |
7 <html> |
| |
8 |
| |
9 <head> |
| |
10 <meta charset="utf8"> |
| |
11 <title></title> |
| |
12 |
| |
13 <script type="application/javascript" |
| |
14 src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script> |
| |
15 <link rel="stylesheet" type="text/css" |
| |
16 href="chrome://mochikit/content/tests/SimpleTest/test.css"> |
| |
17 </head> |
| |
18 |
| |
19 <body> |
| |
20 |
| |
21 <script type="application/javascript;version=1.8"> |
| |
22 const { classes: Cc, interfaces: Ci, utils: Cu } = Components; |
| |
23 |
| |
24 const { Services } = Cu.import("resource://gre/modules/Services.jsm", {}); |
| |
25 |
| |
26 const SRCDIR_PREF = "devtools.loader.srcdir"; |
| |
27 let srcDir = Cc["@mozilla.org/file/directory_service;1"] |
| |
28 .getService(Components.interfaces.nsIProperties) |
| |
29 .get("CurWorkD", Components.interfaces.nsIFile).path; |
| |
30 |
| |
31 let srcDirStr = Cc["@mozilla.org/supports-string;1"] |
| |
32 .createInstance(Ci.nsISupportsString); |
| |
33 srcDirStr.data = srcDir; |
| |
34 Services.prefs.setComplexValue(SRCDIR_PREF, Ci.nsISupportsString, |
| |
35 srcDirStr); |
| |
36 |
| |
37 const { BuiltinProvider, SrcdirProvider } = |
| |
38 Cu.import("resource://gre/modules/devtools/Loader.jsm", {}); |
| |
39 |
| |
40 let builtin = new BuiltinProvider(); |
| |
41 builtin.load(); |
| |
42 let srcdir = new SrcdirProvider(); |
| |
43 srcdir.load(); |
| |
44 |
| |
45 is(builtin.loader.mapping.length, |
| |
46 srcdir.loader.mapping.length + 1, |
| |
47 "The built-in loader should have only one more mapping for testing."); |
| |
48 |
| |
49 Services.prefs.clearUserPref(SRCDIR_PREF); |
| |
50 </script> |
| |
51 </body> |
| |
52 </html> |