зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1315951 - Fix no-unused-vars issues in toolkit/components (except places). r=mossop
MozReview-Commit-ID: 8svkCKZHxsq --HG-- extra : rebase_source : 01552e8214f02490aad3cf704757f52a9c3b3959
This commit is contained in:
Родитель
257c1b72db
Коммит
7d81bfea9f
|
@ -154,7 +154,11 @@ module.exports = {
|
|||
"no-unreachable": "error",
|
||||
|
||||
// No declaring variables that are never used
|
||||
// "no-unused-vars": ["error", {"vars": "all", "args": "none"}],
|
||||
// "no-unused-vars": ["error", {
|
||||
// "vars": "local",
|
||||
// "varsIgnorePattern": "^Cc|Ci|Cu|Cr|EXPORTED_SYMBOLS",
|
||||
// "args": "none",
|
||||
// }],
|
||||
|
||||
// No using variables before defined
|
||||
// "no-use-before-define": ["error", "nofunc"],
|
||||
|
|
|
@ -0,0 +1,11 @@
|
|||
"use strict";
|
||||
|
||||
module.exports = {
|
||||
"rules": {
|
||||
"no-unused-vars": ["error", {
|
||||
"vars": "local",
|
||||
"varsIgnorePattern": "^Cc|Ci|Cu|Cr|EXPORTED_SYMBOLS",
|
||||
"args": "none",
|
||||
}]
|
||||
}
|
||||
};
|
|
@ -1227,7 +1227,7 @@ function fillInTree(aRoot)
|
|||
} else {
|
||||
delete aT._kids;
|
||||
}
|
||||
aT._amount = kid._amount;
|
||||
aT._amount = kidBytes;
|
||||
aT._description = kid._description;
|
||||
if (kid._nMerged !== undefined) {
|
||||
aT._nMerged = kid._nMerged
|
||||
|
|
|
@ -569,7 +569,7 @@ var View = {
|
|||
}
|
||||
|
||||
// Grab everything from the DOM before cleaning up
|
||||
let eltContainer = this._setupStructure(id);
|
||||
this._setupStructure(id);
|
||||
|
||||
// An array of `cachedElements` that need to be added
|
||||
let toAdd = [];
|
||||
|
@ -649,7 +649,6 @@ var View = {
|
|||
cachedElements.eltRoot.setAttribute("impact", Math.round(impact));
|
||||
}
|
||||
|
||||
let result = delta.diff.jank.totalCPUTime/delta.diff.deltaT;
|
||||
cachedElements.eltCPU.textContent = `CPU usage: ${Math.ceil(delta.diff.jank.totalCPUTime/delta.diff.deltaT/10)}% (total ${delta.diff.jank.totalUserTime}ms).`;
|
||||
cachedElements.eltSystem.textContent = `System usage: ${Math.ceil(delta.diff.jank.totalSystemTime/delta.diff.deltaT/10)}% (total ${delta.diff.jank.totalSystemTime}ms).`;
|
||||
cachedElements.eltCPOW.textContent = `Blocking process calls: ${Math.ceil(delta.diff.cpow.totalCPOWTime/delta.diff.deltaT/10)}% (total ${delta.diff.cpow.totalCPOWTime}ms).`;
|
||||
|
|
|
@ -68,7 +68,6 @@ function frameScript() {
|
|||
try {
|
||||
let reFullname = /Full name: (.+)/;
|
||||
let reFps = /Impact on framerate: (\d+)\/10( \((\d+) alerts\))?/;
|
||||
let reCpu = /CPU usage: (\d+)%/
|
||||
let reCpow = /Blocking process calls: (\d+)%( \((\d+) alerts\))?/;
|
||||
|
||||
let getContentOfSelector = function(eltContainer, selector, re) {
|
||||
|
|
|
@ -163,7 +163,7 @@ PropertyOp.prototype.addObject = function(database, obj)
|
|||
|
||||
PropertyOp.prototype.makeCacheEntry = function(item, cache)
|
||||
{
|
||||
let [index, obj, has, propValue] = item;
|
||||
let [, obj, , propValue] = item;
|
||||
|
||||
let desc = { configurable: false, enumerable: true, writable: false, value: propValue };
|
||||
|
||||
|
@ -201,7 +201,7 @@ MethodOp.prototype.addObject = function(database, obj)
|
|||
|
||||
MethodOp.prototype.makeCacheEntry = function(item, cache)
|
||||
{
|
||||
let [index, obj, result] = item;
|
||||
let [, obj, result] = item;
|
||||
|
||||
if (!cache.has(obj)) {
|
||||
cache.set(obj, new Map());
|
||||
|
@ -256,7 +256,7 @@ CollectionOp.prototype.addObject = function(database, obj)
|
|||
|
||||
CollectionOp.prototype.makeCacheEntry = function(item, cache)
|
||||
{
|
||||
let [index, obj, ...elements] = item;
|
||||
let [, obj, ...elements] = item;
|
||||
|
||||
if (!cache.has(obj)) {
|
||||
cache.set(obj, new Map());
|
||||
|
|
|
@ -113,7 +113,6 @@ AddonInterpositionService.prototype = {
|
|||
return Cu.getCrossProcessWrapperTag(target);
|
||||
}
|
||||
|
||||
const XUL_NS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
|
||||
if (target instanceof Ci.nsIDOMXULElement) {
|
||||
if (target.localName == "browser" && target.isRemoteBrowser) {
|
||||
return "RemoteBrowserElement";
|
||||
|
|
|
@ -98,7 +98,6 @@ add_task(function* test_require_interaction() {
|
|||
|
||||
var actualSequence = [];
|
||||
|
||||
var sequenceIdx = 0;
|
||||
function createAlertListener(name, showCallback, finishCallback) {
|
||||
return (subject, topic, data) => {
|
||||
if (topic == "alertshow") {
|
||||
|
|
|
@ -51,7 +51,7 @@ add_task(function* testContext() {
|
|||
inUserData.data = 123;
|
||||
|
||||
var alert = makeAlert(null, imageServerURL + "?f=image.png");
|
||||
var [ready, request, userData] = yield promiseImage(alert, 0, inUserData);
|
||||
var [ready, , userData] = yield promiseImage(alert, 0, inUserData);
|
||||
ok(ready, "Should load requested image");
|
||||
is(userData.QueryInterface(Ci.nsISupportsPRInt64).data, 123,
|
||||
"Should pass user data for loaded image");
|
||||
|
|
|
@ -525,7 +525,6 @@ Spinner.prototype = {
|
|||
observe: function() {
|
||||
let topic = this._topic;
|
||||
debug(`Starting phase ${ topic }`);
|
||||
let barrier = this._barrier;
|
||||
Services.obs.removeObserver(this, topic);
|
||||
|
||||
let satisfied = false; // |true| once we have satisfied all conditions
|
||||
|
|
|
@ -35,7 +35,6 @@ function run_test() {
|
|||
* An immediate search should be executed synchronously.
|
||||
*/
|
||||
add_test(function test_immediate_search() {
|
||||
let immediateResults = ["mozillaTest"];
|
||||
let inputStr = "moz";
|
||||
|
||||
let immediateSearch = new AutoCompleteImmediateSearch(
|
||||
|
@ -79,7 +78,6 @@ add_test(function test_immediate_search() {
|
|||
* An immediate search should be executed before any delayed search.
|
||||
*/
|
||||
add_test(function test_immediate_search_notimeout() {
|
||||
let immediateResults = ["mozillaTest"];
|
||||
let inputStr = "moz";
|
||||
|
||||
let immediateSearch = new AutoCompleteImmediateSearch(
|
||||
|
@ -124,7 +122,6 @@ add_test(function test_immediate_search_notimeout() {
|
|||
* A delayed search should be executed synchronously with a zero timeout.
|
||||
*/
|
||||
add_test(function test_delayed_search_notimeout() {
|
||||
let immediateResults = ["mozillaTest"];
|
||||
let inputStr = "moz";
|
||||
|
||||
let delayedSearch = new AutoCompleteDelayedSearch(
|
||||
|
|
|
@ -243,7 +243,6 @@ function run_test() {
|
|||
var input = new AutoCompleteInput([search1.name,
|
||||
search2.name]);
|
||||
var numSearchesStarted = 0;
|
||||
var previousResult = null;
|
||||
|
||||
input.onSearchBegin = function() {
|
||||
numSearchesStarted++;
|
||||
|
@ -279,4 +278,3 @@ function run_test() {
|
|||
|
||||
controller.startSearch("test");
|
||||
}
|
||||
|
||||
|
|
|
@ -59,7 +59,6 @@ function onload()
|
|||
if ("arguments" in window && window.arguments.length >= 1 && window.arguments[0]) {
|
||||
try {
|
||||
params = window.arguments[0].QueryInterface(nsIDialogParamBlock);
|
||||
var objects = params.objects;
|
||||
var cookie = params.objects.queryElementAt(0, nsICookie);
|
||||
var cookiesFromHost = params.GetInt(nsICookieAcceptDialog.COOKIESFROMHOST);
|
||||
|
||||
|
|
|
@ -1043,7 +1043,7 @@ CrashStore.prototype = Object.freeze({
|
|||
*/
|
||||
get crashes() {
|
||||
let crashes = [];
|
||||
for (let [id, crash] of this._data.crashes) {
|
||||
for (let [, crash] of this._data.crashes) {
|
||||
crashes.push(new CrashRecord(crash));
|
||||
}
|
||||
|
||||
|
|
|
@ -62,7 +62,7 @@ CrashService.prototype = Object.freeze({
|
|||
switch (topic) {
|
||||
case "profile-after-change":
|
||||
// Side-effect is the singleton is instantiated.
|
||||
let m = Services.crashmanager;
|
||||
Services.crashmanager;
|
||||
break;
|
||||
}
|
||||
},
|
||||
|
|
|
@ -113,7 +113,7 @@ function test_null_dispose()
|
|||
|
||||
exception = false;
|
||||
try {
|
||||
let v = ctypes.CDataFinalizer(acquire(0), null_dispose);
|
||||
ctypes.CDataFinalizer(acquire(0), null_dispose);
|
||||
} catch (x) {
|
||||
exception = true;
|
||||
}
|
||||
|
|
|
@ -1437,7 +1437,6 @@ function run_StructType_tests() {
|
|||
do_check_eq(g_t.array().name, name + "[]");
|
||||
do_check_eq(g_t.array(5).name, name + "[5]");
|
||||
|
||||
let h_t = ctypes.StructType("h_t", [{ a: ctypes.int32_t }, { b: ctypes.int16_t }]);
|
||||
let s_t = new ctypes.StructType("s_t", [{ a: ctypes.int32_t }, { b: g_t }, { c: ctypes.int8_t }]);
|
||||
|
||||
let fields = [{ a: ctypes.int32_t }, { b: ctypes.int8_t }, { c: g_t }, { d: ctypes.int8_t }];
|
||||
|
@ -1845,7 +1844,6 @@ function run_FunctionType_tests() {
|
|||
}, Error);
|
||||
|
||||
let g_t = ctypes.StructType("g_t", [{ a: ctypes.int32_t }, { b: ctypes.double }]);
|
||||
let g = g_t(1, 2);
|
||||
|
||||
let f_t = ctypes.FunctionType(ctypes.default_abi, g_t);
|
||||
let name = "g_t()";
|
||||
|
@ -2172,7 +2170,6 @@ function run_cast_tests() {
|
|||
// Test casting between special types.
|
||||
let g_t = ctypes.StructType("g_t", [{ a: ctypes.int32_t }, { b: ctypes.double }]);
|
||||
let a_t = ctypes.ArrayType(g_t, 4);
|
||||
let p_t = ctypes.PointerType(g_t);
|
||||
let f_t = ctypes.FunctionType(ctypes.default_abi, ctypes.void_t).ptr;
|
||||
|
||||
let a = a_t();
|
||||
|
@ -2184,7 +2181,6 @@ function run_cast_tests() {
|
|||
let a2 = ctypes.cast(g, g_t.array(1));
|
||||
do_check_eq(ptrValue(a2.address()), ptrValue(g.address()));
|
||||
do_check_eq(a2[0].a, g.a);
|
||||
let a3 = ctypes.cast(g, g_t.array(0));
|
||||
|
||||
let p = g.address();
|
||||
let ip = ctypes.cast(p, ctypes.int32_t.ptr);
|
||||
|
@ -2215,7 +2211,7 @@ function run_void_tests(library) {
|
|||
// Win32 (it's all the same on Win64 though).
|
||||
if (ctypes.voidptr_t.size == 4) {
|
||||
do_check_throws(function() {
|
||||
let test_winapi_t = library.declare("test_void_t_stdcall", ctypes.winapi_abi, ctypes.void_t);
|
||||
library.declare("test_void_t_stdcall", ctypes.winapi_abi, ctypes.void_t);
|
||||
}, Error);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -187,8 +187,6 @@ add_test(function test_local_list() {
|
|||
return response;
|
||||
}
|
||||
gHttpServ.registerPathHandler("/downloads", function(request, response) {
|
||||
let buf = NetUtil.readInputStreamToString(request.bodyInputStream,
|
||||
request.bodyInputStream.available());
|
||||
let blob = processUpdateRequest();
|
||||
response.setHeader("Content-Type",
|
||||
"application/vnd.google.safebrowsing-update", false);
|
||||
|
|
|
@ -162,8 +162,6 @@ function processUpdateRequest() {
|
|||
function waitForUpdates() {
|
||||
let deferred = Promise.defer();
|
||||
gHttpServer.registerPathHandler("/downloads", function(request, response) {
|
||||
let buf = NetUtil.readInputStreamToString(request.bodyInputStream,
|
||||
request.bodyInputStream.available());
|
||||
let blob = processUpdateRequest();
|
||||
response.setHeader("Content-Type",
|
||||
"application/vnd.google.safebrowsing-update", false);
|
||||
|
|
|
@ -262,8 +262,6 @@ function processUpdateRequest() {
|
|||
function waitForUpdates() {
|
||||
let deferred = Promise.defer();
|
||||
gHttpServer.registerPathHandler("/downloads", function(request, response) {
|
||||
let buf = NetUtil.readInputStreamToString(request.bodyInputStream,
|
||||
request.bodyInputStream.available());
|
||||
let blob = processUpdateRequest();
|
||||
response.setHeader("Content-Type",
|
||||
"application/vnd.google.safebrowsing-update", false);
|
||||
|
|
|
@ -970,8 +970,6 @@ ExtensionHandler.prototype = {
|
|||
},
|
||||
startElement: function EH_startElement(uri, localName, qName, attrs) {
|
||||
++this._depth;
|
||||
var prefix = gNamespaces[uri] ? gNamespaces[uri] + ":" : "";
|
||||
var key = prefix + localName;
|
||||
|
||||
if (this._depth == 1) {
|
||||
this._uri = uri;
|
||||
|
@ -1498,7 +1496,7 @@ FeedProcessor.prototype = {
|
|||
// attributes and child elements.
|
||||
_processComplexElement:
|
||||
function FP__processComplexElement(elementInfo, attributes) {
|
||||
var obj, key, prefix;
|
||||
var obj;
|
||||
|
||||
// If the container is an entry/item, it'll need to have its
|
||||
// more esoteric properties put in the 'fields' property bag.
|
||||
|
|
|
@ -661,9 +661,7 @@ function newDir() {
|
|||
|
||||
var parent = file.parent;
|
||||
if (!(parent.exists() && parent.isDirectory() && parent.isWritable())) {
|
||||
var oldParent = parent;
|
||||
while (!parent.exists()) {
|
||||
oldParent = parent;
|
||||
parent = parent.parent;
|
||||
}
|
||||
if (parent.isFile()) {
|
||||
|
|
|
@ -270,17 +270,6 @@ nsFilePicker.prototype = {
|
|||
}
|
||||
}
|
||||
|
||||
var parentWin = null;
|
||||
try {
|
||||
parentWin = parent.QueryInterface(nsIInterfaceRequestor)
|
||||
.getInterface(nsIWebNavigation)
|
||||
.QueryInterface(nsIDocShellTreeItem)
|
||||
.treeOwner
|
||||
.QueryInterface(nsIInterfaceRequestor)
|
||||
.getInterface(nsIBaseWindow);
|
||||
} catch (ex) {
|
||||
dump("file picker couldn't get base window\n"+ex+"\n");
|
||||
}
|
||||
try {
|
||||
parent.openDialog("chrome://global/content/filepicker.xul",
|
||||
"",
|
||||
|
@ -328,4 +317,3 @@ function srGetStrBundle(path)
|
|||
}
|
||||
return strBundle;
|
||||
}
|
||||
|
||||
|
|
|
@ -180,7 +180,6 @@ var listener = {
|
|||
},
|
||||
|
||||
receiveMessage(message) {
|
||||
let data = message.data;
|
||||
switch (message.name) {
|
||||
case "gfxSanity:ContentLoaded":
|
||||
this.runSanityTest();
|
||||
|
@ -244,7 +243,6 @@ SanityTest.prototype = {
|
|||
shouldRunTest: function() {
|
||||
// Only test gfx features if firefox has updated, or if the user has a new
|
||||
// gpu or drivers.
|
||||
var appInfo = Cc["@mozilla.org/xre/app-info;1"].getService(Ci.nsIXULAppInfo);
|
||||
var buildId = Services.appinfo.platformBuildID;
|
||||
var gfxinfo = Cc["@mozilla.org/gfx/info;1"].getService(Ci.nsIGfxInfo);
|
||||
|
||||
|
|
|
@ -2380,11 +2380,11 @@ add_task(function* test_platform_integration()
|
|||
let download;
|
||||
if (gUseLegacySaver) {
|
||||
download = yield promiseStartLegacyDownload(httpUrl("source.txt"),
|
||||
{ targetFile: targetFile });
|
||||
{ isPrivate, targetFile });
|
||||
}
|
||||
else {
|
||||
download = yield Downloads.createDownload({
|
||||
source: httpUrl("source.txt"),
|
||||
source: { url: httpUrl("source.txt"), isPrivate },
|
||||
target: targetFile,
|
||||
});
|
||||
download.start().catch(() => {});
|
||||
|
|
|
@ -820,11 +820,6 @@ add_task(function test_common_initialize()
|
|||
},
|
||||
}));
|
||||
|
||||
// Get a reference to nsIComponentRegistrar, and ensure that is is freed
|
||||
// before the XPCOM shutdown.
|
||||
let registrar = Components.manager.QueryInterface(Ci.nsIComponentRegistrar);
|
||||
do_register_cleanup(() => registrar = null);
|
||||
|
||||
// Make sure that downloads started using nsIExternalHelperAppService are
|
||||
// saved to disk without asking for a destination interactively.
|
||||
let mock = {
|
||||
|
|
|
@ -408,7 +408,7 @@ add_task(function* test_exit_private_browsing()
|
|||
let download1 = yield promiseNewDownload(httpUrl("source.txt"));
|
||||
let download2 = yield promiseNewDownload(httpUrl("interruptible.txt"));
|
||||
let promiseAttempt1 = download1.start();
|
||||
let promiseAttempt2 = download2.start();
|
||||
download2.start();
|
||||
|
||||
// Add downloads to list.
|
||||
yield privateList.add(download1);
|
||||
|
|
|
@ -111,7 +111,7 @@ add_task(function* test_save_reload()
|
|||
*/
|
||||
add_task(function* test_save_empty()
|
||||
{
|
||||
let [list, store] = yield promiseNewListAndStore();
|
||||
let [, store] = yield promiseNewListAndStore();
|
||||
|
||||
let createdFile = yield OS.File.open(store.path, { create: true });
|
||||
yield createdFile.close();
|
||||
|
|
|
@ -56,7 +56,7 @@ var listener = {
|
|||
var bis = Components.classes["@mozilla.org/binaryinputstream;1"]
|
||||
.createInstance(Components.interfaces.nsIBinaryInputStream);
|
||||
bis.setInputStream(stream);
|
||||
var array = bis.readByteArray(bis.available());
|
||||
bis.readByteArray(bis.available());
|
||||
} catch (ex) {
|
||||
do_throw("Error in onDataAvailable: " + ex);
|
||||
}
|
||||
|
@ -88,7 +88,6 @@ function runNext() {
|
|||
}
|
||||
|
||||
function getFileContents(aFile) {
|
||||
const PR_RDONLY = 0x01;
|
||||
var fileStream = Cc["@mozilla.org/network/file-input-stream;1"]
|
||||
.createInstance(Ci.nsIFileInputStream);
|
||||
fileStream.init(aFile, 1, -1, null);
|
||||
|
|
|
@ -41,15 +41,6 @@ add_task(function* init() {
|
|||
addon.uninstall()
|
||||
});
|
||||
|
||||
|
||||
let freezeThreshold = Preferences.get("browser.addon-watch.freeze-threshold-micros", /* 5 seconds */ 5000000);
|
||||
let jankThreshold = Preferences.get("browser.addon-watch.jank-threshold-micros", /* 256 ms == 8 frames*/ 256000);
|
||||
let occurrencesBetweenAlerts = Preferences.get("browser.addon-watch.occurrences-between-alerts", 3);
|
||||
let delayBetweenAlerts = Preferences.get("browser.addon-watch.delay-between-alerts-ms", 6 * 3600 * 1000 /* 6h */);
|
||||
let delayBetweenFreezeAlerts = Preferences.get("browser.addon-watch.delay-between-freeze-alerts-ms", 2 * 60 * 1000 /* 2 min */);
|
||||
let prescriptionDelay = Preferences.get("browser.addon-watch.prescription-delay", 5 * 60 * 1000 /* 5 minutes */);
|
||||
let highestNumberOfAddonsToReport = Preferences.get("browser.addon-watch.max-simultaneous-reports", 1);
|
||||
|
||||
Preferences.set("browser.addon-watch.warmup-ms", 0);
|
||||
Preferences.set("browser.addon-watch.freeze-threshold-micros", 0);
|
||||
Preferences.set("browser.addon-watch.jank-threshold-micros", 0);
|
||||
|
|
|
@ -27,9 +27,6 @@ function frameScript() {
|
|||
const { utils: Cu, classes: Cc, interfaces: Ci } = Components;
|
||||
Cu.import("resource://gre/modules/PerformanceStats.jsm");
|
||||
Cu.import("resource://gre/modules/Services.jsm");
|
||||
let performanceStatsService =
|
||||
Cc["@mozilla.org/toolkit/performance-stats-service;1"].
|
||||
getService(Ci.nsIPerformanceStatsService);
|
||||
|
||||
// Make sure that the stopwatch is now active.
|
||||
let monitor = PerformanceStats.getMonitor(["jank", "cpow", "ticks", "compartments"]);
|
||||
|
|
|
@ -135,8 +135,6 @@ function createPaperArrayFromDefaults()
|
|||
var paperWidths = [ 8.5, 8.5, 7.25, 148.0, 210.0, 287.0, 420.0, 594.0, 841.0];
|
||||
var paperHeights = [11.0, 14.0, 10.50, 210.0, 297.0, 420.0, 594.0, 841.0, 1189.0];
|
||||
var paperInches = [true, true, true, false, false, false, false, false, false];
|
||||
// this is deprecated
|
||||
var paperEnums = [0, 1, 2, 3, 4, 5, 6, 7, 8];
|
||||
|
||||
gPaperArray = new Array();
|
||||
|
||||
|
|
|
@ -305,14 +305,12 @@ this.BasePromiseWorker.prototype = {
|
|||
this.log("Message posted");
|
||||
|
||||
let reply;
|
||||
let isError = false;
|
||||
try {
|
||||
this.log("Expecting reply");
|
||||
reply = yield deferred.promise;
|
||||
} catch (error) {
|
||||
this.log("Got error", error);
|
||||
reply = error;
|
||||
isError = true;
|
||||
|
||||
if (error instanceof WorkerError) {
|
||||
// We know how to deserialize most well-known errors
|
||||
|
|
|
@ -56,7 +56,6 @@ function dialogOnLoad() {
|
|||
}
|
||||
|
||||
function dialogOK() {
|
||||
let selected = listBox.selectedIndex;
|
||||
gArgs.setProperty("selected", listBox.selectedIndex);
|
||||
gArgs.setProperty("ok", true);
|
||||
return true;
|
||||
|
|
|
@ -300,7 +300,6 @@
|
|||
event.stopPropagation();
|
||||
if (action == "default") {
|
||||
let bnum = this.args.defaultButtonNum || 0;
|
||||
let button = this.ui["button" + bnum];
|
||||
this.onButtonClick(bnum);
|
||||
} else { // action == "cancel"
|
||||
this.onButtonClick(1); // Cancel button
|
||||
|
|
|
@ -782,7 +782,6 @@ this.FormHistory = {
|
|||
|
||||
let handlers = {
|
||||
handleResult : function(aResultSet) {
|
||||
let formHistoryFields = dbSchema.tables.moz_formhistory;
|
||||
for (let row = aResultSet.getNextRow(); row; row = aResultSet.getNextRow()) {
|
||||
let result = {};
|
||||
for (let field of aSelectTerms) {
|
||||
|
|
|
@ -303,7 +303,7 @@ FormHistory.prototype = {
|
|||
|
||||
entryExists : function entryExists(name, value) {
|
||||
this.log("entryExists for " + name + "=" + value);
|
||||
let [id, guid] = this.getExistingEntryID(name, value);
|
||||
let [id] = this.getExistingEntryID(name, value);
|
||||
this.log("entryExists: id=" + id);
|
||||
return (id != -1);
|
||||
},
|
||||
|
|
|
@ -74,7 +74,7 @@ function checkSelectedIndexAfterResponseTime(expectedIndex) {
|
|||
|
||||
function doKeyUnprivileged(key) {
|
||||
let keyName = "DOM_VK_" + key.toUpperCase();
|
||||
let keycode, charcode, alwaysVal;
|
||||
let keycode, charcode;
|
||||
|
||||
if (key.length == 1) {
|
||||
keycode = 0;
|
||||
|
|
|
@ -54,8 +54,6 @@ var testnum = 0;
|
|||
var testdesc = "Setup of test form history entries";
|
||||
|
||||
var entry1 = ["entry1", "value1"];
|
||||
var entry2 = ["entry2", "value2"];
|
||||
|
||||
|
||||
/* ========== 1 ========== */
|
||||
testnum = 1;
|
||||
|
|
|
@ -59,8 +59,6 @@ function dumpn(text)
|
|||
*/
|
||||
function configureToLoadJarEngines()
|
||||
{
|
||||
let defaultBranch = Services.prefs.getDefaultBranch(null);
|
||||
|
||||
let url = "chrome://testsearchplugin/locale/searchplugins/";
|
||||
let resProt = Services.io.getProtocolHandler("resource")
|
||||
.QueryInterface(Ci.nsIResProtocolHandler);
|
||||
|
|
|
@ -31,7 +31,7 @@ add_test(function test_identifier() {
|
|||
let engineTemplateFile = do_get_file("data/engine.xml");
|
||||
engineTemplateFile.copyTo(engineFile.parent, "test-search-engine.xml");
|
||||
|
||||
let search = Services.search.init(function initComplete(aResult) {
|
||||
Services.search.init(function initComplete(aResult) {
|
||||
do_print("init'd search service");
|
||||
do_check_true(Components.isSuccessCode(aResult));
|
||||
|
||||
|
|
|
@ -58,7 +58,6 @@ function run_test() {
|
|||
uri: "resource://search-plugins/list.json",
|
||||
loadUsingSystemPrincipal: true
|
||||
});
|
||||
let visibleDefaultEngines = [];
|
||||
let sis = Cc["@mozilla.org/scriptableinputstream;1"].
|
||||
createInstance(Ci.nsIScriptableInputStream);
|
||||
sis.init(chan.open2());
|
||||
|
@ -83,7 +82,7 @@ add_test(function prepare_test_data() {
|
|||
add_test(function test_cached_engine_properties() {
|
||||
do_print("init search service");
|
||||
|
||||
let search = Services.search.init(function initComplete(aResult) {
|
||||
Services.search.init(function initComplete(aResult) {
|
||||
do_print("init'd search service");
|
||||
do_check_true(Components.isSuccessCode(aResult));
|
||||
|
||||
|
|
|
@ -55,7 +55,7 @@ add_task(function* test_simple() {
|
|||
|
||||
// fetching the engines forces a sync init, and should have caused us to
|
||||
// check the timezone.
|
||||
let engines = Services.search.getEngines();
|
||||
Services.search.getEngines();
|
||||
ok(Services.search.isInitialized);
|
||||
|
||||
// a little wait to check we didn't do the xhr thang.
|
||||
|
|
|
@ -15,7 +15,7 @@ function run_test() {
|
|||
|
||||
add_task(function* test_sync_metadata_migration() {
|
||||
do_check_false(Services.search.isInitialized);
|
||||
let engines = Services.search.getEngines();
|
||||
Services.search.getEngines();
|
||||
do_check_true(Services.search.isInitialized);
|
||||
yield promiseAfterCache();
|
||||
|
||||
|
|
|
@ -85,7 +85,7 @@ add_task(function*() {
|
|||
}
|
||||
|
||||
// Run test in child, don't wait for it to finish.
|
||||
let childPromise = run_test_in_child("test_ChildHistograms.js");
|
||||
run_test_in_child("test_ChildHistograms.js");
|
||||
yield do_await_remote_message(MESSAGE_CHILD_TEST_DONE);
|
||||
|
||||
yield ContentTaskUtils.waitForCondition(() => {
|
||||
|
|
|
@ -106,7 +106,6 @@ add_task(function* test_archivedPings() {
|
|||
}
|
||||
|
||||
// Check loading the archived pings.
|
||||
let ids = PINGS.map(p => p.id);
|
||||
let checkLoadingPings = Task.async(function*() {
|
||||
for (let data of PINGS) {
|
||||
let ping = yield TelemetryArchive.promiseArchivedPingById(data.id);
|
||||
|
@ -263,7 +262,7 @@ add_task(function* test_archiveCleanup() {
|
|||
Telemetry.getHistogramById("TELEMETRY_ARCHIVE_OLDEST_DIRECTORY_AGE").clear();
|
||||
|
||||
// Move the current date 60 days ahead of the first ping.
|
||||
let now = fakeNow(futureDate(firstDate, 60 * MILLISECONDS_PER_DAY));
|
||||
fakeNow(futureDate(firstDate, 60 * MILLISECONDS_PER_DAY));
|
||||
// Reset TelemetryArchive and TelemetryController to start the startup cleanup.
|
||||
yield TelemetryController.testReset();
|
||||
// Wait for the cleanup to finish.
|
||||
|
|
|
@ -287,9 +287,6 @@ add_task(function* test_pingHasEnvironmentAndClientId() {
|
|||
});
|
||||
|
||||
add_task(function* test_archivePings() {
|
||||
const ARCHIVE_PATH =
|
||||
OS.Path.join(OS.Constants.Path.profileDir, "datareporting", "archived");
|
||||
|
||||
let now = new Date(2009, 10, 18, 12, 0, 0);
|
||||
fakeNow(now);
|
||||
|
||||
|
|
|
@ -944,7 +944,6 @@ add_task(function* test_addonsWatch_InterestingChange() {
|
|||
// We only expect a single notification for each install, uninstall, enable, disable.
|
||||
const EXPECTED_NOTIFICATIONS = 4;
|
||||
|
||||
let deferred = PromiseUtils.defer();
|
||||
let receivedNotifications = 0;
|
||||
|
||||
let registerCheckpointPromise = (aExpected) => {
|
||||
|
@ -1266,7 +1265,6 @@ add_task(function* test_collectionWithbrokenAddonData() {
|
|||
AddonManager.SIGNEDSTATE_NOT_REQUIRED,
|
||||
};
|
||||
|
||||
let deferred = PromiseUtils.defer();
|
||||
let receivedNotifications = 0;
|
||||
|
||||
let registerCheckpointPromise = (aExpected) => {
|
||||
|
|
|
@ -192,7 +192,7 @@ add_task(function* test_userNotifiedOfCurrentPolicy() {
|
|||
"The default state of the date should have a time of 0 and it should therefore fail");
|
||||
|
||||
// Showing the notification bar should make the user notified.
|
||||
let now = fakeNow(2012, 11, 11);
|
||||
fakeNow(2012, 11, 11);
|
||||
TelemetryReportingPolicy.testInfobarShown();
|
||||
Assert.ok(TelemetryReportingPolicy.testIsUserNotified(),
|
||||
"Using the proper API causes user notification to report as true.");
|
||||
|
|
|
@ -177,7 +177,7 @@ add_task(function* test_sendPendingPings() {
|
|||
});
|
||||
|
||||
add_task(function* test_sendDateHeader() {
|
||||
let now = fakeNow(new Date(Date.UTC(2011, 1, 1, 11, 0, 0)));
|
||||
fakeNow(new Date(Date.UTC(2011, 1, 1, 11, 0, 0)));
|
||||
yield TelemetrySend.reset();
|
||||
|
||||
let pingId = yield TelemetryController.submitExternalPing("test-send-date-header", {});
|
||||
|
|
|
@ -178,7 +178,7 @@ add_task(function* setupEnvironment() {
|
|||
*/
|
||||
add_task(function* test_recent_pings_sent() {
|
||||
let pingTypes = [{ num: RECENT_PINGS }];
|
||||
let recentPings = yield createSavedPings(pingTypes);
|
||||
yield createSavedPings(pingTypes);
|
||||
|
||||
yield TelemetryController.testReset();
|
||||
yield TelemetrySend.testWaitOnOutgoingPings();
|
||||
|
|
|
@ -1104,9 +1104,6 @@ add_task(function* test_environmentChange() {
|
|||
return;
|
||||
}
|
||||
|
||||
let timerCallback = null;
|
||||
let timerDelay = null;
|
||||
|
||||
yield TelemetryStorage.testClearPendingPings();
|
||||
PingServer.clearRequests();
|
||||
|
||||
|
@ -1245,8 +1242,8 @@ add_task(function* test_savedSessionData() {
|
|||
|
||||
// Watch a test preference, trigger and environment change and wait for it to propagate.
|
||||
// _watchPreferences triggers a subsession notification
|
||||
let now = fakeNow(new Date(2050, 1, 1, 12, 0, 0));
|
||||
gMonotonicNow = fakeMonotonicNow(gMonotonicNow + 10 * MILLISECONDS_PER_MINUTE);
|
||||
fakeNow(new Date(2050, 1, 1, 12, 0, 0));
|
||||
TelemetryEnvironment.testWatchPreferences(PREFS_TO_WATCH);
|
||||
let changePromise = new Promise(resolve =>
|
||||
TelemetryEnvironment.registerChangeListener("test_fake_change", resolve));
|
||||
|
@ -1468,7 +1465,7 @@ add_task(function* test_abortedSession_Shutdown() {
|
|||
"Telemetry must create the aborted session directory when starting.");
|
||||
|
||||
// Fake now again so that the scheduled aborted-session save takes place.
|
||||
now = fakeNow(futureDate(now, ABORTED_SESSION_UPDATE_INTERVAL_MS));
|
||||
fakeNow(futureDate(now, ABORTED_SESSION_UPDATE_INTERVAL_MS));
|
||||
// The first aborted session checkpoint must take place right after the initialisation.
|
||||
Assert.ok(!!schedulerTickCallback);
|
||||
// Execute one scheduler tick.
|
||||
|
@ -1619,7 +1616,7 @@ add_task(function* test_schedulerEnvironmentReschedules() {
|
|||
TelemetryEnvironment.testWatchPreferences(PREFS_TO_WATCH);
|
||||
|
||||
// Set the current time at midnight.
|
||||
let future = fakeNow(futureDate(nowDate, MS_IN_ONE_DAY));
|
||||
fakeNow(futureDate(nowDate, MS_IN_ONE_DAY));
|
||||
gMonotonicNow = fakeMonotonicNow(gMonotonicNow + 10 * MILLISECONDS_PER_MINUTE);
|
||||
|
||||
// Trigger the environment change.
|
||||
|
@ -1906,7 +1903,7 @@ add_task(function* test_changeThrottling() {
|
|||
Assert.equal(getSubsessionCount(), 1);
|
||||
|
||||
// We should get a change notification after the 5min throttling interval.
|
||||
now = fakeNow(futureDate(now, 5 * MILLISECONDS_PER_MINUTE + 1));
|
||||
fakeNow(futureDate(now, 5 * MILLISECONDS_PER_MINUTE + 1));
|
||||
gMonotonicNow = fakeMonotonicNow(gMonotonicNow + 5 * MILLISECONDS_PER_MINUTE + 1);
|
||||
Preferences.set(PREF_TEST, 2);
|
||||
Assert.equal(getSubsessionCount(), 2);
|
||||
|
|
|
@ -145,10 +145,8 @@ add_task(function* test_boolean_histogram() {
|
|||
var r = h.snapshot().ranges;
|
||||
// boolean histograms ignore numeric parameters
|
||||
do_check_eq(uneval(r), uneval([0, 1, 2]))
|
||||
var sum = 0
|
||||
for (var i=0;i<r.length;i++) {
|
||||
var v = r[i];
|
||||
sum += v;
|
||||
h.add(v);
|
||||
}
|
||||
h.add(true);
|
||||
|
|
|
@ -852,7 +852,6 @@ var PageThumbsExpiration = {
|
|||
},
|
||||
|
||||
expireThumbnails: function Expiration_expireThumbnails(aURLsToKeep) {
|
||||
let path = this.path;
|
||||
let keep = aURLsToKeep.map(url => PageThumbsStorage.getLeafNameForURL(url));
|
||||
let msg = [
|
||||
PageThumbsStorage.path,
|
||||
|
|
|
@ -22,14 +22,10 @@ XPCOMUtils.defineLazyServiceGetter(this, "gDirSvc",
|
|||
* directory and should just apply to Linux.
|
||||
*/
|
||||
function* runTests() {
|
||||
let dirSvc = Cc["@mozilla.org/file/directory_service;1"]
|
||||
.getService(Ci.nsIProperties);
|
||||
|
||||
// Prepare a local profile directory.
|
||||
let localProfile = FileUtils.getDir("ProfD", ["local-test"], true);
|
||||
changeLocation("ProfLD", localProfile);
|
||||
|
||||
let local = FileUtils.getDir("ProfLD", [THUMBNAIL_DIRECTORY], true);
|
||||
let roaming = FileUtils.getDir("ProfD", [THUMBNAIL_DIRECTORY], true);
|
||||
|
||||
// Set up some data in the roaming profile.
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
function check(aBrowser, aElementName, aBarred, aType) {
|
||||
return ContentTask.spawn(aBrowser, [aElementName, aBarred, aType], function*([aElementName, aBarred, aType]) {
|
||||
let doc = content.document;
|
||||
let e = content.document.createElement(aElementName);
|
||||
let contentElement = content.document.getElementById('content');
|
||||
contentElement.appendChild(e);
|
||||
|
@ -39,7 +38,6 @@ function check(aBrowser, aElementName, aBarred, aType) {
|
|||
|
||||
function todo_check(aBrowser, aElementName, aBarred) {
|
||||
return ContentTask.spawn(aBrowser, [aElementName, aBarred], function*([aElementName, aBarred]) {
|
||||
let doc = content.document;
|
||||
let e = content.document.createElement(aElementName);
|
||||
let contentElement = content.document.getElementById('content');
|
||||
contentElement.appendChild(e);
|
||||
|
@ -87,4 +85,3 @@ add_task(function*() {
|
|||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
|
|
@ -237,8 +237,8 @@ var ViewSourceContent = {
|
|||
|
||||
let utils = requestor.getInterface(Ci.nsIDOMWindowUtils);
|
||||
let doc = contentWindow.document;
|
||||
let forcedCharSet = utils.docCharsetIsForced ? doc.characterSet
|
||||
: null;
|
||||
forcedCharSet = utils.docCharsetIsForced ? doc.characterSet
|
||||
: null;
|
||||
}
|
||||
|
||||
this.loadSource(URL, pageDescriptor, lineNumber, forcedCharSet);
|
||||
|
@ -289,7 +289,6 @@ var ViewSourceContent = {
|
|||
*/
|
||||
loadSource(URL, pageDescriptor, lineNumber, forcedCharSet) {
|
||||
const viewSrcURL = "view-source:" + URL;
|
||||
let loadFromURL = false;
|
||||
|
||||
if (forcedCharSet) {
|
||||
docShell.charset = forcedCharSet;
|
||||
|
|
|
@ -127,7 +127,6 @@ var gViewSourceUtils = {
|
|||
message.data.baseURI);
|
||||
}
|
||||
else {
|
||||
let docUrl = null;
|
||||
window.openDialog("chrome://global/content/viewPartialSource.xul",
|
||||
"_blank", "all,dialog=no",
|
||||
{
|
||||
|
|
|
@ -19,7 +19,6 @@ add_task(function*() {
|
|||
|
||||
var checkViewSource = Task.async(function* (aWindow) {
|
||||
is(aWindow.gBrowser.contentDocument.body.textContent, content, "Correct content loaded");
|
||||
let selection = aWindow.gBrowser.contentWindow.getSelection();
|
||||
let statusPanel = aWindow.document.getElementById("statusbar-line-col");
|
||||
is(statusPanel.getAttribute("label"), "", "Correct status bar text");
|
||||
|
||||
|
|
|
@ -121,8 +121,6 @@
|
|||
}
|
||||
modules.set(path, module);
|
||||
|
||||
let name = ":" + path;
|
||||
let objectURL;
|
||||
try {
|
||||
// Load source of module, synchronously
|
||||
let xhr = new XMLHttpRequest();
|
||||
|
|
Загрузка…
Ссылка в новой задаче