remove redundant jsm imports from browser chrome tests
authorDão Gottwald <dao@mozilla.com>
Fri, 10 Jun 2011 11:58:45 +0200
changeset 70894 91dd5412cd4f999e8d470cdb47d0e781f3b780af
parent 70893 dc8d154f37103dac9a0e4a55699813292e8c4fe2
child 70895 6c24a513319a1343ffa6782c1542160b6658ddc9
push id3
push usergsharp@mozilla.com
push dateMon, 13 Jun 2011 17:29:15 +0000
treeherderfx-team@479e2681c25f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
milestone7.0a1
remove redundant jsm imports from browser chrome tests
browser/base/content/test/browser_tabMatchesInAwesomebar.js
browser/components/places/tests/browser/browser_markPageAsFollowedLink.js
browser/components/preferences/tests/browser_permissions.js
modules/libpr0n/test/browser/head.js
toolkit/components/console/hudservice/tests/browser/head.js
toolkit/components/places/tests/browser/browser_bug399606.js
toolkit/components/places/tests/browser/browser_settitle.js
toolkit/components/places/tests/browser/browser_visituri.js
toolkit/components/places/tests/browser/browser_visituri_nohistory.js
toolkit/components/places/tests/browser/browser_visituri_privatebrowsing.js
toolkit/mozapps/extensions/test/browser/browser_bug523784.js
toolkit/mozapps/extensions/test/browser/head.js
toolkit/mozapps/extensions/test/xpinstall/head.js
--- a/browser/base/content/test/browser_tabMatchesInAwesomebar.js
+++ b/browser/base/content/test/browser_tabMatchesInAwesomebar.js
@@ -31,18 +31,16 @@
  * use your version of this file under the terms of the MPL, indicate your
  * decision by deleting the provisions above and replace them with the notice
  * and other provisions required by the GPL or the LGPL. If you do not delete
  * 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 ***** */
 
-Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
-
 const TEST_URL_BASES = [
   "http://example.org/browser/browser/base/content/test/dummy_page.html#tabmatch",
   "http://example.org/browser/browser/base/content/test/moz.png#tabmatch"
 ];
 
 var gPrivateBrowsing = Cc["@mozilla.org/privatebrowsing;1"].
                          getService(Ci.nsIPrivateBrowsingService);
 var gController = Cc["@mozilla.org/autocomplete/controller;1"].
--- a/browser/components/places/tests/browser/browser_markPageAsFollowedLink.js
+++ b/browser/components/places/tests/browser/browser_markPageAsFollowedLink.js
@@ -6,18 +6,16 @@
  * Tests that visits across frames are correctly represented in the database.
  */
 
 const BASE_URL = "http://mochi.test:8888/browser/browser/components/places/tests/browser";
 const PAGE_URL = BASE_URL + "/framedPage.html";
 const LEFT_URL = BASE_URL + "/frameLeft.html";
 const RIGHT_URL = BASE_URL + "/frameRight.html";
 
-Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
-
 let gTabLoaded = false;
 let gLeftFrameVisited = false;
 
 let observer = {
   observe: function(aSubject, aTopic, aData)
   {
     let url = aSubject.QueryInterface(Ci.nsIURI).spec;
     if (url == LEFT_URL ) {
--- a/browser/components/preferences/tests/browser_permissions.js
+++ b/browser/components/preferences/tests/browser_permissions.js
@@ -1,12 +1,11 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
-Components.utils.import("resource://gre/modules/Services.jsm");
 Components.utils.import("resource://gre/modules/PlacesUtils.jsm");
 Components.utils.import("resource://gre/modules/NetUtil.jsm");
 
 const ABOUT_PERMISSIONS_SPEC = "about:permissions";
 
 const TEST_URI_1 = NetUtil.newURI("http://mozilla.com/");
 const TEST_URI_2 = NetUtil.newURI("http://mozilla.org/");
 
--- a/modules/libpr0n/test/browser/head.js
+++ b/modules/libpr0n/test/browser/head.js
@@ -1,21 +1,15 @@
-const Cc = Components.classes;
-const Ci = Components.interfaces;
-const Cu = Components.utils;
-
 const RELATIVE_DIR = "modules/libpr0n/test/browser/";
 const TESTROOT = "http://example.com/browser/" + RELATIVE_DIR;
 const TESTROOT2 = "http://example.org/browser/" + RELATIVE_DIR;
 
 var chrome_root = getRootDirectory(gTestPath);
 const CHROMEROOT = chrome_root;
 
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-
 function getImageLoading(doc, id) {
   var htmlImg = doc.getElementById(id);
   return htmlImg.QueryInterface(Ci.nsIImageLoadingContent);
 }
 
 // Tries to get the Moz debug image, imgIContainerDebug. Only works
 // in a debug build. If we succeed, we call func().
 function actOnMozImage(doc, id, func) {
--- a/toolkit/components/console/hudservice/tests/browser/head.js
+++ b/toolkit/components/console/hudservice/tests/browser/head.js
@@ -31,23 +31,17 @@
  * use your version of this file under the terms of the MPL, indicate your
  * decision by deleting the provisions above and replace them with the notice
  * and other provisions required by the GPL or the LGPL. If you do not delete
  * 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 ***** */
 
-const Cc = Components.classes;
-const Ci = Components.interfaces;
-const Cu = Components.utils;
-
 Cu.import("resource://gre/modules/HUDService.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
 
 function log(aMsg)
 {
   dump("*** WebConsoleTest: " + aMsg + "\n");
 }
 
 function pprint(aObj)
 {
--- a/toolkit/components/places/tests/browser/browser_bug399606.js
+++ b/toolkit/components/places/tests/browser/browser_bug399606.js
@@ -31,18 +31,16 @@
  * use your version of this file under the terms of the MPL, indicate your
  * decision by deleting the provisions above and replace them with the notice
  * and other provisions required by the GPL or the LGPL. If you do not delete
  * 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 ***** */
 
-Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
-
 gBrowser.selectedTab = gBrowser.addTab();
 
 function test() {
   waitForExplicitFinish();
 
   var URIs = [
     "http://example.com/tests/toolkit/components/places/tests/browser/399606-window.location.href.html",
     "http://example.com/tests/toolkit/components/places/tests/browser/399606-history.go-0.html",
--- a/toolkit/components/places/tests/browser/browser_settitle.js
+++ b/toolkit/components/places/tests/browser/browser_settitle.js
@@ -1,15 +1,13 @@
 /**
  * Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
-Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
-
 gBrowser.selectedTab = gBrowser.addTab();
 
 function finishAndCleanUp()
 {
   gBrowser.removeCurrentTab();
   waitForClearHistory(finish);
 }
 
--- a/toolkit/components/places/tests/browser/browser_visituri.js
+++ b/toolkit/components/places/tests/browser/browser_visituri.js
@@ -1,15 +1,13 @@
 /**
  * Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
-Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
-
 gBrowser.selectedTab = gBrowser.addTab();
 
 function finishAndCleanUp()
 {
   gBrowser.removeCurrentTab();
   waitForClearHistory(finish);
 }
 
--- a/toolkit/components/places/tests/browser/browser_visituri_nohistory.js
+++ b/toolkit/components/places/tests/browser/browser_visituri_nohistory.js
@@ -1,16 +1,13 @@
 /**
  * Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
-Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
-Components.utils.import("resource://gre/modules/Services.jsm");
-
 const INITIAL_URL = "http://example.com/tests/toolkit/components/places/tests/browser/begin.html";
 const FINAL_URL = "http://example.com/tests/toolkit/components/places/tests/browser/final.html";
 
 let gTab = gBrowser.selectedTab = gBrowser.addTab();
 
 /**
  * One-time observer callback.
  */
--- a/toolkit/components/places/tests/browser/browser_visituri_privatebrowsing.js
+++ b/toolkit/components/places/tests/browser/browser_visituri_privatebrowsing.js
@@ -1,16 +1,13 @@
 /**
  * Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
-Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
-Components.utils.import("resource://gre/modules/Services.jsm");
-
 const INITIAL_URL = "http://example.com/tests/toolkit/components/places/tests/browser/begin.html";
 const FINAL_URL = "http://example.com/tests/toolkit/components/places/tests/browser/final.html";
 
 let gTab;
 
 /**
  * One-time observer callback.
  */
--- a/toolkit/mozapps/extensions/test/browser/browser_bug523784.js
+++ b/toolkit/mozapps/extensions/test/browser/browser_bug523784.js
@@ -1,15 +1,13 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 const URI_BLOCKLIST_DIALOG = "chrome://mozapps/content/extensions/blocklist.xul";
 
-Components.utils.import("resource://gre/modules/Services.jsm");
-
 // This tests that the blocklist dialog still affects soft-blocked add-ons
 // if the user clicks the "Restart Later" button. It also ensures that the
 // "Cancel" button is correctly renamed (to "Restart Later").
 let args = {
   restart: false,
   list: [{
     name: "Bug 523784 softblocked addon",
     version: "1",
--- a/toolkit/mozapps/extensions/test/browser/head.js
+++ b/toolkit/mozapps/extensions/test/browser/head.js
@@ -1,14 +1,13 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
 Components.utils.import("resource://gre/modules/AddonManager.jsm");
-Components.utils.import("resource://gre/modules/Services.jsm");
 Components.utils.import("resource://gre/modules/NetUtil.jsm");
 
 var pathParts = gTestPath.split("/");
 // Drop the test filename
 pathParts.splice(pathParts.length - 1);
 
 var gTestInWindow = /-window$/.test(pathParts[pathParts.length - 1]);
 
--- a/toolkit/mozapps/extensions/test/xpinstall/head.js
+++ b/toolkit/mozapps/extensions/test/xpinstall/head.js
@@ -22,17 +22,16 @@ function extractChromeRoot(path) {
   if (jar) {
     var tmpdir = extractJarToTmp(jar);
     return "file://" + tmpdir.path + "/";
   }
   return chromeRootPath;
 }
 
 Components.utils.import("resource://gre/modules/AddonManager.jsm");
-Components.utils.import("resource://gre/modules/Services.jsm");
 
 /**
  * This is a test harness designed to handle responding to UI during the process
  * of installing an XPI. A test can set callbacks to hear about specific parts
  * of the sequence.
  * Before use setup must be called and finish must be called afterwards.
  */
 var Harness = {