Bug 913510 - Remove vestigial capability.principal prefs usage. r=bholley
authorMasatoshi Kimura <VYV03354@nifty.ne.jp>
Sat, 07 Sep 2013 18:49:03 +0900
changeset 146061 b143f103d54ef43d45e3bca3ee9a157d4a72f38c
parent 146060 4551a70c2fcfc5772302e2b68428fb1974eda648
child 146062 de8f83fde39482118e4e9b5249d7d1fd36b1d793
push id1
push userroot
push dateMon, 20 Oct 2014 17:29:22 +0000
reviewersbholley
bugs913510
milestone26.0a1
Bug 913510 - Remove vestigial capability.principal prefs usage. r=bholley
js/src/tests/user.js
layout/tools/reftest/remotereftest.py
layout/tools/reftest/runreftestb2g.py
testing/mozbase/mozprofile/mozprofile/permissions.py
testing/mozbase/mozprofile/tests/permissions.py
--- a/js/src/tests/user.js
+++ b/js/src/tests/user.js
@@ -1,17 +1,13 @@
 user_pref("app.update.enabled", false);
 user_pref("browser.dom.window.dump.enabled", true);
 user_pref("browser.sessionstore.resume_from_crash", false);
 user_pref("browser.shell.checkDefaultBrowser", false);
 user_pref("browser.xul.error_pages.enabled", true);
-user_pref("capability.principal.codebase.p0.granted", "UniversalXPConnect");
-user_pref("capability.principal.codebase.p0.id", "file://");
-user_pref("capability.principal.codebase.p1.granted", "UniversalXPConnect");
-user_pref("capability.principal.codebase.p1.id", "http://localhost:4444");
 user_pref("security.fileuri.strict_origin_policy", false);
 user_pref("dom.allow_scripts_to_close_windows", true);
 user_pref("dom.disable_open_during_load", false);
 user_pref("dom.max_script_run_time", 0);
 user_pref("hangmonitor.timeout", 0);
 user_pref("dom.max_chrome_script_run_time", 0);
 user_pref("javascript.allow.mailnews", true);
 user_pref("javascript.options.showInConsole", true);
--- a/layout/tools/reftest/remotereftest.py
+++ b/layout/tools/reftest/remotereftest.py
@@ -364,21 +364,16 @@ class RemoteReftest(RefTest):
         prefs["extensions.getAddons.maxResults"] = 0
         prefs["extensions.getAddons.get.url"] = "http://127.0.0.1:8888/extensions-dummy/repositoryGetURL"
         prefs["extensions.getAddons.getWithPerformance.url"] = "http://127.0.0.1:8888/extensions-dummy/repositoryGetWithPerformanceURL"
         prefs["extensions.getAddons.search.browseURL"] = "http://127.0.0.1:8888/extensions-dummy/repositoryBrowseURL"
         prefs["extensions.getAddons.search.url"] = "http://127.0.0.1:8888/extensions-dummy/repositorySearchURL"
         # Make sure that opening the plugins check page won't hit the network
         prefs["plugins.update.url"] = "http://127.0.0.1:8888/plugins-dummy/updateCheckURL"
 
-        # Workaround for jsreftests.
-        if options.enablePrivilege:
-            prefs["capability.principal.codebase.p2.granted"] = "UniversalXPConnect"
-            prefs["capability.principal.codebase.p2.id"] = "http://%s:%s" % (options.remoteWebServer, options.httpPort)
-
         # Set the extra prefs.
         profile.set_preferences(prefs)
 
         try:
             self._devicemanager.pushDir(profileDir, options.remoteProfile)
         except devicemanager.DMError:
             print "Automation Error: Failed to copy profiledir to device"
             raise
--- a/layout/tools/reftest/runreftestb2g.py
+++ b/layout/tools/reftest/runreftestb2g.py
@@ -416,21 +416,16 @@ class B2GReftest(RefTest):
         prefs["font.size.inflation.minTwips"] = 0
         prefs["reftest.browser.iframe.enabled"] = False
         prefs["reftest.remote"] = True
         prefs["reftest.uri"] = "%s" % reftestlist
         # Set a future policy version to avoid the telemetry prompt.
         prefs["toolkit.telemetry.prompted"] = 999
         prefs["toolkit.telemetry.notifiedOptOut"] = 999
 
-        # Workaround for jsreftests.
-        if getattr(options, 'enablePrivilege', False):
-            prefs["capability.principal.codebase.p2.granted"] = "UniversalXPConnect"
-            prefs["capability.principal.codebase.p2.id"] = "http://%s:%s" % (options.remoteWebServer, options.httpPort)
-
         # Set the extra prefs.
         profile.set_preferences(prefs)
 
         # Copy the profile to the device.
         self._devicemanager.removeDir(self.remoteProfile)
         try:
             self._devicemanager.pushDir(profileDir, self.remoteProfile)
         except DMError:
--- a/testing/mozbase/mozprofile/mozprofile/permissions.py
+++ b/testing/mozbase/mozprofile/mozprofile/permissions.py
@@ -270,25 +270,17 @@ class Permissions(object):
         cursor.close()
 
     def network_prefs(self, proxy=None):
         """
         take known locations and generate preferences to handle permissions and proxy
         returns a tuple of prefs, user_prefs
         """
 
-        # Grant God-power to all the privileged servers on which tests run.
         prefs = []
-        privileged = [i for i in self._locations if "privileged" in i.options]
-        for (i, l) in itertools.izip(itertools.count(1), privileged):
-            prefs.append(("capability.principal.codebase.p%s.granted" % i, "UniversalXPConnect"))
-
-            prefs.append(("capability.principal.codebase.p%s.id" % i, "%s://%s:%s" %
-                        (l.scheme, l.host, l.port)))
-            prefs.append(("capability.principal.codebase.p%s.subjectName" % i, ""))
 
         if proxy:
             user_prefs = self.pac_prefs(proxy)
         else:
             user_prefs = []
 
         return prefs, user_prefs
 
--- a/testing/mozbase/mozprofile/tests/permissions.py
+++ b/testing/mozbase/mozprofile/tests/permissions.py
@@ -114,29 +114,17 @@ http://127.0.0.1:8888           privileg
         self.assertEqual(len(entries), 0)
 
     def test_nw_prefs(self):
         perms = Permissions(self.profile_dir, self.locations_file.name)
 
         prefs, user_prefs = perms.network_prefs(False)
 
         self.assertEqual(len(user_prefs), 0)
-        self.assertEqual(len(prefs), 6)
-
-        self.assertEqual(prefs[0], ('capability.principal.codebase.p1.granted',
-                                    'UniversalXPConnect'))
-        self.assertEqual(prefs[1], ('capability.principal.codebase.p1.id',
-                                    'http://mochi.test:8888'))
-        self.assertEqual(prefs[2], ('capability.principal.codebase.p1.subjectName', ''))
-
-        self.assertEqual(prefs[3], ('capability.principal.codebase.p2.granted',
-                                    'UniversalXPConnect'))
-        self.assertEqual(prefs[4], ('capability.principal.codebase.p2.id',
-                                    'http://127.0.0.1:8888'))
-        self.assertEqual(prefs[5], ('capability.principal.codebase.p2.subjectName', ''))
+        self.assertEqual(len(prefs), 0)
 
         prefs, user_prefs = perms.network_prefs(True)
         self.assertEqual(len(user_prefs), 2)
         self.assertEqual(user_prefs[0], ('network.proxy.type', 2))
         self.assertEqual(user_prefs[1][0], 'network.proxy.autoconfig_url')
 
         origins_decl = "var origins = ['http://mochi.test:8888', 'http://127.0.0.1:80', 'http://127.0.0.1:8888'];"
         self.assertTrue(origins_decl in user_prefs[1][1])