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