[Pkg-mozext-commits] [requestpolicy] 14/257: [ref] rewrite head_loadrp a bit

David Prévot taffit at moszumanska.debian.org
Thu Jan 28 03:19:51 UTC 2016


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository requestpolicy.

commit fac05134a99db7b184ba1e1c81d32a170dfcfa39
Author: Martin Kimmerle <dev at 256k.de>
Date:   Mon Aug 3 12:05:14 2015 +0200

    [ref] rewrite head_loadrp a bit
---
 tests/xpcshell/head_loadrp.js | 27 +++++++++++++++++++--------
 1 file changed, 19 insertions(+), 8 deletions(-)

diff --git a/tests/xpcshell/head_loadrp.js b/tests/xpcshell/head_loadrp.js
index b078aa1..7eda2b2 100644
--- a/tests/xpcshell/head_loadrp.js
+++ b/tests/xpcshell/head_loadrp.js
@@ -12,25 +12,36 @@ Cu.import("resource://gre/modules/Services.jsm");
 // Initialize profile.
 // This will create a Directory Service Provider for the
 // profile directory. See `head.js` in mozilla-central.
-{
-  let gProfD = do_get_profile();
-}
+// The return value is the profile directory, and can be
+// simply ignored.
+do_get_profile();
 
-// Register RequestPolicy's Chrome Manifest.
-{
-  let cwd = Services.dirsvc.get("CurWorkD", Ci.nsIFile);
 
-  let manifestFile = cwd.parent.parent.clone();
+
+function getRPChromeManifest() {
+  var cwd = Services.dirsvc.get("CurWorkD", Ci.nsIFile);
+
+  var manifestFile = cwd.parent.parent.clone();
   manifestFile.appendRelativePath("build/unit-testing/chrome.manifest");
+  return manifestFile;
+}
 
+function registerRPChromeManifest() {
   Components.manager.QueryInterface(Ci.nsIComponentRegistrar)
-                    .autoRegister(manifestFile);
+                    .autoRegister(getRPChromeManifest());
 }
 
+// Register RequestPolicy's Chrome Manifest.
+registerRPChromeManifest();
+
+
+
 // Load default preferences
 Services.scriptloader.loadSubScript("chrome://rpcontinued/content/" +
                                     "main/default-pref-handler.js", {});
 
+
+
 // Setup the Logger module
 {
   let tmpScope = {};

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mozext/requestpolicy.git



More information about the Pkg-mozext-commits mailing list