Bug 468700 - Having "Ask me Everytime" enabled for Cookies during Private Browsing is unusable (test fix); r,sr=bzbarsky
authorEhsan Akhgari <ehsan.akhgari@gmail.com>
Thu, 22 Jan 2009 11:35:30 +0330
changeset 24045 0dec4e077be27ec575b4fa1f509ddbd05fd200fe
parent 24044 c341651522b0976437cd8c9088996bb5b17e56f2
child 24046 ed4a08325d3cd0d55556186e1bae27b91a6de99a
push id4868
push userehsan.akhgari@gmail.com
push dateThu, 22 Jan 2009 08:06:06 +0000
treeherdermozilla-central@0dec4e077be2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbzbarsky
bugs468700
milestone1.9.2a1pre
Bug 468700 - Having "Ask me Everytime" enabled for Cookies during Private Browsing is unusable (test fix); r,sr=bzbarsky
extensions/cookie/test/unit/test_bug468700.js
--- a/extensions/cookie/test/unit/test_bug468700.js
+++ b/extensions/cookie/test/unit/test_bug468700.js
@@ -3,17 +3,20 @@ const Ci = Components.interfaces;
 
 function run_test() {
   do_load_module("/extensions/cookie/test/unit/cookieprompt.js");
 
   var cs = Cc["@mozilla.org/cookieService;1"].getService(Ci.nsICookieService);
   var cm = Cc["@mozilla.org/cookiemanager;1"].getService(Ci.nsICookieManager2);
   var ios = Cc["@mozilla.org/network/io-service;1"].getService(Ci.nsIIOService);
   var prefs = Cc["@mozilla.org/preferences-service;1"].getService(Ci.nsIPrefBranch);
-  var pb = Cc["@mozilla.org/privatebrowsing;1"].getService(Ci.nsIPrivateBrowsingService);
+  var pb = null;
+  try {
+    pb = Cc["@mozilla.org/privatebrowsing;1"].getService(Ci.nsIPrivateBrowsingService);
+  } catch (e) {}
 
   var spec = "http://foo.bar/baz";
   var uri = ios.newURI(spec, null, null);
 
   // accept all cookies
   prefs.setIntPref("network.cookie.lifetimePolicy", 0);
   // add a test cookie
   cs.setCookieString(uri, null, "foo=bar", null);