more random browser chrome test cleanup (no bug)

This commit is contained in:
Dão Gottwald 2011-06-11 16:54:23 +02:00
parent 3b7e75b4ce
commit 9e3c046bbe
13 changed files with 9 additions and 100 deletions

View File

@ -38,9 +38,6 @@
*
* ***** END LICENSE BLOCK ***** */
const Ci = Components.interfaces;
const Cc = Components.classes;
const kTestString = " hello hello \n world\nworld ";
var gTests = [
@ -87,8 +84,7 @@ function test_paste(aCurrentTest) {
var inputListener = {
test: aCurrentTest,
handleEvent: function(event) {
var element = event.target;
element.removeEventListener("input", this, false);
element.removeEventListener(event.type, this, false);
is(element.value, this.test.expected, this.test.desc);

View File

@ -2,10 +2,6 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
const Cc = Components.classes;
const Ci = Components.interfaces;
const Cu = Components.utils;
Cu.import("resource://gre/modules/NetUtil.jsm");
Cu.import("resource://gre/modules/FileUtils.jsm");

View File

@ -52,16 +52,6 @@ waitForExplicitFinish();
const TEST_IDENTIFIER = "ui-perf-test";
const TEST_SUITE = "places";
const Cc = Components.classes;
const Ci = Components.interfaces;
const Cr = Components.results;
var wm = Cc["@mozilla.org/appshell/window-mediator;1"].
getService(Ci.nsIWindowMediator);
var win = wm.getMostRecentWindow("navigator:browser");
var ios = Cc["@mozilla.org/network/io-service;1"].
getService(Ci.nsIIOService);
var hs = Cc["@mozilla.org/browser/nav-history-service;1"].
getService(Ci.nsINavHistoryService);
var bs = Cc["@mozilla.org/browser/nav-bookmarks-service;1"].
@ -112,7 +102,7 @@ ptests.push({
visit_date_microsec -= 86400 * 1000 * 1000; // remove a day
var spec = "http://example.com/" + visit_date_microsec;
for (var j = 0; j < visits_per_day; j++) {
var uri = ios.newURI(spec + j, null, null);
var uri = Services.io.newURI(spec + j, null, null);
add_visit(uri, visit_date_microsec);
}
}
@ -132,7 +122,7 @@ ptests.push({
visit_date_microsec -= 86400 * 1000 * 1000; // remove a day
var spec = "http://example.com/" + visit_date_microsec;
for (var j = 0; j < visits_per_day; j++) {
var uri = ios.newURI(spec + j, null, null);
var uri = Services.io.newURI(spec + j, null, null);
if (bookmark_counter < bookmarks_per_day) {
add_bookmark(uri);
bookmark_counter++;

View File

@ -47,16 +47,6 @@ waitForExplicitFinish();
const TEST_IDENTIFIER = "ui-perf-test";
const TEST_SUITE = "places";
const Cc = Components.classes;
const Ci = Components.interfaces;
const Cr = Components.results;
var wm = Cc["@mozilla.org/appshell/window-mediator;1"].
getService(Ci.nsIWindowMediator);
var win = wm.getMostRecentWindow("navigator:browser");
var ios = Cc["@mozilla.org/network/io-service;1"].
getService(Ci.nsIIOService);
var hs = Cc["@mozilla.org/browser/nav-history-service;1"].
getService(Ci.nsINavHistoryService);
var bs = Cc["@mozilla.org/browser/nav-bookmarks-service;1"].

View File

@ -44,16 +44,6 @@ Tests the performance of opening the history menu.
const TEST_IDENTIFIER = "ui-perf-test";
const TEST_SUITE = "places";
const Cc = Components.classes;
const Ci = Components.interfaces;
const Cr = Components.results;
var wm = Cc["@mozilla.org/appshell/window-mediator;1"].
getService(Ci.nsIWindowMediator);
var win = wm.getMostRecentWindow("navigator:browser");
var ios = Cc["@mozilla.org/network/io-service;1"].
getService(Ci.nsIIOService);
var hs = Cc["@mozilla.org/browser/nav-history-service;1"].
getService(Ci.nsINavHistoryService);
var bs = Cc["@mozilla.org/browser/nav-bookmarks-service;1"].

View File

@ -47,15 +47,6 @@ waitForExplicitFinish();
const TEST_IDENTIFIER = "ui-perf-test";
const TEST_SUITE = "places";
const Cc = Components.classes;
const Ci = Components.interfaces;
const Cr = Components.results;
var wm = Cc["@mozilla.org/appshell/window-mediator;1"].
getService(Ci.nsIWindowMediator);
var win = wm.getMostRecentWindow("navigator:browser");
var ios = Cc["@mozilla.org/network/io-service;1"].
getService(Ci.nsIIOService);
var hs = Cc["@mozilla.org/browser/nav-history-service;1"].
getService(Ci.nsINavHistoryService);
var bs = Cc["@mozilla.org/browser/nav-bookmarks-service;1"].

View File

@ -47,15 +47,6 @@ waitForExplicitFinish();
const TEST_IDENTIFIER = "ui-perf-test";
const TEST_SUITE = "places";
const Cc = Components.classes;
const Ci = Components.interfaces;
const Cr = Components.results;
var wm = Cc["@mozilla.org/appshell/window-mediator;1"].
getService(Ci.nsIWindowMediator);
var win = wm.getMostRecentWindow("navigator:browser");
var ios = Cc["@mozilla.org/network/io-service;1"].
getService(Ci.nsIIOService);
var hs = Cc["@mozilla.org/browser/nav-history-service;1"].
getService(Ci.nsINavHistoryService);
var bs = Cc["@mozilla.org/browser/nav-bookmarks-service;1"].

View File

@ -47,15 +47,6 @@ waitForExplicitFinish();
const TEST_IDENTIFIER = "ui-perf-test";
const TEST_SUITE = "places";
const Cc = Components.classes;
const Ci = Components.interfaces;
const Cr = Components.results;
var wm = Cc["@mozilla.org/appshell/window-mediator;1"].
getService(Ci.nsIWindowMediator);
var win = wm.getMostRecentWindow("navigator:browser");
var ios = Cc["@mozilla.org/network/io-service;1"].
getService(Ci.nsIIOService);
var hs = Cc["@mozilla.org/browser/nav-history-service;1"].
getService(Ci.nsINavHistoryService);
var bs = Cc["@mozilla.org/browser/nav-bookmarks-service;1"].

View File

@ -46,24 +46,12 @@ waitForExplicitFinish();
const TEST_IDENTIFIER = "ui-perf-test";
const TEST_SUITE = "places";
const Cc = Components.classes;
const Ci = Components.interfaces;
const Cr = Components.results;
var wm = Cc["@mozilla.org/appshell/window-mediator;1"].
getService(Ci.nsIWindowMediator);
var win = wm.getMostRecentWindow("navigator:browser");
var ios = Cc["@mozilla.org/network/io-service;1"].
getService(Ci.nsIIOService);
var hs = Cc["@mozilla.org/browser/nav-history-service;1"].
getService(Ci.nsINavHistoryService);
var bs = Cc["@mozilla.org/browser/nav-bookmarks-service;1"].
getService(Ci.nsINavBookmarksService);
var prefs = Cc["@mozilla.org/preferences-service;1"].
getService(Ci.nsIPrefBranch);
var maxResults = prefs.getIntPref("browser.urlbar.maxRichResults");
var maxResults = Services.prefs.getIntPref("browser.urlbar.maxRichResults");
var onSearchComplete = gURLBar.onSearchComplete;
function add_visit(aURI, aDate) {

View File

@ -2,8 +2,6 @@
// Globals
var testPath = "http://mochi.test:8888/browser/docshell/test/navigation/";
var Ci = Components.interfaces;
var Cc = Components.classes;
var ctx = {};
// Helper function to check if a window is active
@ -214,9 +212,8 @@ function step7() {
function allDone() {
// Close the tabs we made
gBrowser.removeCurrentTab();
gBrowser.tabContainer.advanceSelectedTab(1, true);
gBrowser.removeCurrentTab();
gBrowser.removeTab(ctx.tab1);
gBrowser.removeTab(ctx.tab2);
// Tell the framework we're done
finish();

View File

@ -34,9 +34,6 @@
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
let Cc = Components.classes;
let Ci = Components.interfaces;
let Cr = Components.results;
function test_visibility_open()

View File

@ -2,7 +2,6 @@
* http://creativecommons.org/publicdomain/zero/1.0/
*/
Components.utils.import("resource://gre/modules/AddonManager.jsm");
Components.utils.import("resource://gre/modules/NetUtil.jsm");
var pathParts = gTestPath.split("/");

View File

@ -26,8 +26,6 @@ function extractChromeRoot(path) {
return chromeRootPath;
}
Components.utils.import("resource://gre/modules/AddonManager.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
@ -362,12 +360,7 @@ var Harness = {
}
},
QueryInterface: function(iid) {
if (iid.equals(Components.interfaces.nsIObserver) ||
iid.equals(Components.interfaces.nsIWindowMediatorListener) ||
iid.equals(Components.interfaces.nsISupports))
return this;
throw Components.results.NS_ERROR_NO_INTERFACE;
}
QueryInterface: XPCOMUtils.generateQI([Ci.nsIObserver,
Ci.nsIWindowMediatorListener,
Ci.nsISupports])
}