Bug 632893 - Remove useless Cc/Ci/Cr/Cu/Components.*/Services.jsm from Firefox tests; (Dv1) /components/privatebrowsing/test/*.
authorSerge Gautherie <sgautherie.bz@free.fr>
Thu, 24 Feb 2011 09:08:56 +0100
changeset 63039 881f4ab63c318439f1e53364aee82e497709904a
parent 63038 b608e4660fdbd230f0126e409939de815b23e8a5
child 63040 0c182eff35de43c9c87752845d28058fa8c067bd
push id1
push userroot
push dateTue, 10 Dec 2013 15:46:25 +0000
bugs632893
milestone2.0b13pre
Bug 632893 - Remove useless Cc/Ci/Cr/Cu/Components.*/Services.jsm from Firefox tests; (Dv1) /components/privatebrowsing/test/*. r=ehsan (a=test-only).
browser/components/privatebrowsing/test/browser/browser_privatebrowsing_cookieacceptdialog.js
browser/components/privatebrowsing/test/unit/do_test_placesTitleNoUpdate.js
browser/components/privatebrowsing/test/unit/do_test_removeDataFromDomain.js
browser/components/privatebrowsing/test/unit/test_openLocationLastURL.js
--- a/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_cookieacceptdialog.js
+++ b/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_cookieacceptdialog.js
@@ -87,23 +87,23 @@ function test() {
       isSecure: false,
       expires: time,
       status: 0,
       policy: 0,
       isSession: false,
       expiry: time,
       isHttpOnly: true,
       QueryInterface: function(iid) {
-        const validIIDs = [Components.interfaces.nsISupports,
-                           Components.interfaces.nsICookie,
-                           Components.interfaces.nsICookie2];
+        const validIIDs = [Ci.nsISupports,
+                           Ci.nsICookie,
+                           Ci.nsICookie2];
         for (var i = 0; i < validIIDs.length; ++i)
           if (iid == validIIDs[i])
             return this;
-        throw Components.results.NS_ERROR_NO_INTERFACE;
+        throw Cr.NS_ERROR_NO_INTERFACE;
       }
     };
     cp.cookieDialog(window, cookie, "mozilla.org", 10, false, remember);
   }
 
   checkRememberOption(false, function() {
     pb.privateBrowsingEnabled = true;
     checkRememberOption(true, function() {
--- a/browser/components/privatebrowsing/test/unit/do_test_placesTitleNoUpdate.js
+++ b/browser/components/privatebrowsing/test/unit/do_test_placesTitleNoUpdate.js
@@ -32,18 +32,18 @@
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 // Test to make sure that the visited page titles do not get updated inside the
 // private browsing mode.
 
-Components.utils.import("resource://gre/modules/Services.jsm");
-Components.utils.import("resource://gre/modules/PlacesUtils.jsm");
+Cu.import("resource://gre/modules/Services.jsm");
+Cu.import("resource://gre/modules/PlacesUtils.jsm");
 
 function do_test()
 {
   let pb = Cc[PRIVATEBROWSING_CONTRACT_ID].
            getService(Ci.nsIPrivateBrowsingService);
 
   const TEST_URI = uri("http://mozilla.com/privatebrowsing");
   const TITLE_1 = "Title 1";
--- a/browser/components/privatebrowsing/test/unit/do_test_removeDataFromDomain.js
+++ b/browser/components/privatebrowsing/test/unit/do_test_removeDataFromDomain.js
@@ -571,21 +571,21 @@ function test_cache_cleared()
   pb.removeDataFromDomain("mozilla.org");
   do_test_pending();
 }
 
 function test_storage_cleared()
 {
   function getStorageForURI(aURI)
   {
-    let principal = Components.classes["@mozilla.org/scriptsecuritymanager;1"].
-                    getService(Components.interfaces.nsIScriptSecurityManager).
+    let principal = Cc["@mozilla.org/scriptsecuritymanager;1"].
+                    getService(Ci.nsIScriptSecurityManager).
                     getCodebasePrincipal(aURI);
-    let dsm = Components.classes["@mozilla.org/dom/storagemanager;1"].
-              getService(Components.interfaces.nsIDOMStorageManager);
+    let dsm = Cc["@mozilla.org/dom/storagemanager;1"].
+              getService(Ci.nsIDOMStorageManager);
     return dsm.getLocalStorageForPrincipal(principal, "");
   }
 
   let s = [
     getStorageForURI(uri("http://mozilla.org")),
     getStorageForURI(uri("http://my.mozilla.org")),
     getStorageForURI(uri("http://ilovemozilla.org")),
   ];
--- a/browser/components/privatebrowsing/test/unit/test_openLocationLastURL.js
+++ b/browser/components/privatebrowsing/test/unit/test_openLocationLastURL.js
@@ -33,19 +33,16 @@
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 // Test the correct behavior of the openLocationLastURL.jsm JS module.
 
 function run_test_on_service()
 {
-  let Cc = Components.classes;
-  let Ci = Components.interfaces;
-  let Cu = Components.utils;
   Cu.import("resource:///modules/openLocationLastURL.jsm");
 
   function clearHistory() {
     // simulate clearing the private data
     Cc["@mozilla.org/observer-service;1"].
     getService(Ci.nsIObserverService).
     notifyObservers(null, "browser:purge-session-history", "");
   }