diff --git a/js/src/xpconnect/shell/xpcshell.cpp b/js/src/xpconnect/shell/xpcshell.cpp index 4ec95ce0ef9..aba7d758e4c 100644 --- a/js/src/xpconnect/shell/xpcshell.cpp +++ b/js/src/xpconnect/shell/xpcshell.cpp @@ -1141,7 +1141,7 @@ static int usage(void) { fprintf(gErrFile, "%s\n", JS_GetImplementationVersion()); - fprintf(gErrFile, "usage: xpcshell [-g gredir] [-PsSwWxCij] [-v version] [-f scriptfile] [-e script] [scriptfile] [scriptarg...]\n"); + fprintf(gErrFile, "usage: xpcshell [-g gredir] [-r manifest]... [-PsSwWxCij] [-v version] [-f scriptfile] [-e script] [scriptfile] [scriptarg...]\n"); return 2; } @@ -1819,6 +1819,22 @@ main(int argc, char **argv) argv += 2; } + while (argc > 1 && !strcmp(argv[1], "-r")) { + if (argc < 3) + return usage(); + + nsCOMPtr lf; + rv = XRE_GetFileFromPath(argv[2], getter_AddRefs(lf)); + if (NS_FAILED(rv)) { + printf("Couldn't get manifest file.\n"); + return 1; + } + XRE_AddManifestLocation(NS_COMPONENT_LOCATION, lf); + + argc -= 2; + argv += 2; + } + { nsCOMPtr servMan; rv = NS_InitXPCOM2(getter_AddRefs(servMan), appDir, &dirprovider); diff --git a/testing/xpcshell/runxpcshelltests.py b/testing/xpcshell/runxpcshelltests.py index 94646a9cb7f..0de66b7f3a8 100644 --- a/testing/xpcshell/runxpcshelltests.py +++ b/testing/xpcshell/runxpcshelltests.py @@ -139,6 +139,9 @@ class XPCShellTests(object): self.httpdJSPath = os.path.join(os.path.dirname(self.xpcshell), 'components', 'httpd.js') self.httpdJSPath = replaceBackSlashes(self.httpdJSPath) + self.httpdManifest = os.path.join(os.path.dirname(self.xpcshell), 'components', 'httpd.manifest') + self.httpdManifest = replaceBackSlashes(self.httpdManifest) + if self.xrePath is None: self.xrePath = os.path.dirname(self.xpcshell) else: @@ -204,7 +207,7 @@ class XPCShellTests(object): """ # - NOTE: if you rename/add any of the constants set here, update # do_load_child_test_harness() in head.js - self.xpcsCmd = [self.xpcshell, '-g', self.xrePath, '-j', '-s'] + \ + self.xpcsCmd = [self.xpcshell, '-g', self.xrePath, '-r', self.httpdManifest, '-j', '-s'] + \ ['-e', 'const _HTTPD_JS_PATH = "%s";' % self.httpdJSPath, '-e', 'const _HEAD_JS_PATH = "%s";' % self.headJSPath, '-f', os.path.join(self.testharnessdir, 'head.js')]