--- a/browser/components/extensions/test/xpcshell/test_ext_bookmarks.js
+++ b/browser/components/extensions/test/xpcshell/test_ext_bookmarks.js
@@ -101,25 +101,25 @@ function backgroundScript() {
browser.bookmarks.onMoved.addListener((id, info) => {
collectedEvents.push({event: "onMoved", id, info});
});
browser.bookmarks.onRemoved.addListener((id, info) => {
collectedEvents.push({event: "onRemoved", id, info});
});
- browser.bookmarks.get(["not-a-bookmark-guid"]).then(expectedError, error => {
+ browser.bookmarks.get(["not-a-bookmark-guid"]).then(expectedError, invalidGuidError => {
browser.test.assertTrue(
- error.message.includes("Invalid value for property 'guid': not-a-bookmark-guid"),
+ invalidGuidError.message.includes("Invalid value for property 'guid': not-a-bookmark-guid"),
"Expected error thrown when trying to get a bookmark using an invalid guid"
);
- return browser.bookmarks.get([nonExistentId]).then(expectedError, error => {
+ return browser.bookmarks.get([nonExistentId]).then(expectedError, nonExistentIdError => {
browser.test.assertTrue(
- error.message.includes("Bookmark not found"),
+ nonExistentIdError.message.includes("Bookmark not found"),
"Expected error thrown when trying to get a bookmark using a non-existent Id"
);
});
}).then(() => {
return browser.bookmarks.search({});
}).then(results => {
initialBookmarkCount = results.length;
return browser.bookmarks.create({title: "test bookmark", url: "http://example.org"});
@@ -176,17 +176,17 @@ function backgroundScript() {
browser.test.assertTrue(
error.message.includes("Invalid bookmark:"),
"Expected error thrown when trying update with an invalid url"
);
return browser.bookmarks.getTree();
});
}).then(results => {
browser.test.assertEq(1, results.length, "getTree returns one result");
- let bookmark = results[0].children.find(bookmark => bookmark.id == unsortedId);
+ let bookmark = results[0].children.find(bookmarkItem => bookmarkItem.id == unsortedId);
browser.test.assertEq(
"Other Bookmarks",
bookmark.title,
"Folder returned from getTree has the expected title"
);
return browser.bookmarks.create({parentId: "invalid"}).then(expectedError, error => {
browser.test.assertTrue(
@@ -244,36 +244,36 @@ function backgroundScript() {
}
}
let folderResult = results[2];
createdFolderId = folderResult.id;
return Promise.all([
browser.bookmarks.create({title: "Mozilla", url: "http://allizom.org/", parentId: createdFolderId}),
browser.bookmarks.create({title: "Mozilla Corporation", url: "http://allizom.com/", parentId: createdFolderId}),
browser.bookmarks.create({title: "Firefox", url: "http://allizom.org/firefox/", parentId: createdFolderId}),
- ]).then(results => {
+ ]).then(newBookmarks => {
browser.test.assertEq(3, collectedEvents.length, "3 expected events received");
- checkOnCreated(results[2].id, createdFolderId, 0, "Firefox", "http://allizom.org/firefox/", results[2].dateAdded);
- checkOnCreated(results[1].id, createdFolderId, 0, "Mozilla Corporation", "http://allizom.com/", results[1].dateAdded);
- checkOnCreated(results[0].id, createdFolderId, 0, "Mozilla", "http://allizom.org/", results[0].dateAdded);
+ checkOnCreated(newBookmarks[2].id, createdFolderId, 0, "Firefox", "http://allizom.org/firefox/", newBookmarks[2].dateAdded);
+ checkOnCreated(newBookmarks[1].id, createdFolderId, 0, "Mozilla Corporation", "http://allizom.com/", newBookmarks[1].dateAdded);
+ checkOnCreated(newBookmarks[0].id, createdFolderId, 0, "Mozilla", "http://allizom.org/", newBookmarks[0].dateAdded);
return browser.bookmarks.create({
title: "About Mozilla",
url: "http://allizom.org/about/",
parentId: createdFolderId,
index: 1,
});
}).then(result => {
browser.test.assertEq(1, collectedEvents.length, "1 expected events received");
checkOnCreated(result.id, createdFolderId, 1, "About Mozilla", "http://allizom.org/about/", result.dateAdded);
// returns all items on empty object
return browser.bookmarks.search({});
- }).then(results => {
- browser.test.assertTrue(results.length >= 9, "At least as many bookmarks as added were returned by search({})");
+ }).then(bookmarksSearchResults => {
+ browser.test.assertTrue(bookmarksSearchResults.length >= 9, "At least as many bookmarks as added were returned by search({})");
return Promise.resolve().then(() => {
return browser.bookmarks.remove(createdFolderId);
}).then(expectedError, error => {
browser.test.assertTrue(
error.message.includes("Cannot remove a non-empty folder"),
"Expected error thrown when trying to remove a non-empty folder"
);
@@ -520,20 +520,20 @@ function backgroundScript() {
let startBookmarkCount = results.length;
return browser.bookmarks.search({title: "Mozilla Folder"}).then(result => {
return browser.bookmarks.removeTree(result[0].id);
}).then(() => {
browser.test.assertEq(1, collectedEvents.length, "1 expected events received");
checkOnRemoved(createdFolderId, bookmarkGuids.unfiledGuid, 1);
- return browser.bookmarks.search({}).then(results => {
+ return browser.bookmarks.search({}).then(searchResults => {
browser.test.assertEq(
startBookmarkCount - 4,
- results.length,
+ searchResults.length,
"Expected number of results returned after removeTree");
});
});
}).then(() => {
return browser.bookmarks.create({title: "Empty Folder"});
}).then(result => {
let emptyFolderId = result.id;
--- a/browser/components/extensions/test/xpcshell/test_ext_history.js
+++ b/browser/components/extensions/test/xpcshell/test_ext_history.js
@@ -58,19 +58,19 @@ add_task(function* test_delete() {
yield extension.startup();
yield extension.awaitMessage("ready");
yield PlacesTestUtils.clearHistory();
let historyClearedCount;
let visits = [];
let visitDate = new Date(1999, 9, 9, 9, 9).getTime();
- function pushVisit(visits) {
+ function pushVisit(subvisits) {
visitDate += 1000;
- visits.push({date: new Date(visitDate)});
+ subvisits.push({date: new Date(visitDate)});
}
// Add 5 visits for one uri and 3 visits for 3 others
for (let i = 0; i < 4; ++i) {
let visit = {
url: `${BASE_URL}${i}`,
title: "visit " + i,
visits: [],
@@ -161,29 +161,29 @@ add_task(function* test_search() {
url: MOZILLA_VISIT_URL,
title: `test visit for ${MOZILLA_VISIT_URL}`,
visits: [
{date: new Date(Number(REFERENCE_DATE) - 3000)},
],
},
];
- function background(REFERENCE_DATE) {
+ function background(BGSCRIPT_REFERENCE_DATE) {
const futureTime = Date.now() + 24 * 60 * 60 * 1000;
browser.test.onMessage.addListener(msg => {
browser.history.search({text: ""}).then(results => {
browser.test.sendMessage("empty-search", results);
return browser.history.search({text: "mozilla.com"});
}).then(results => {
browser.test.sendMessage("text-search", results);
return browser.history.search({text: "example.com", maxResults: 1});
}).then(results => {
browser.test.sendMessage("max-results-search", results);
- return browser.history.search({text: "", startTime: REFERENCE_DATE - 2000, endTime: REFERENCE_DATE - 1000});
+ return browser.history.search({text: "", startTime: BGSCRIPT_REFERENCE_DATE - 2000, endTime: BGSCRIPT_REFERENCE_DATE - 1000});
}).then(results => {
browser.test.sendMessage("date-range-search", results);
return browser.history.search({text: "", startTime: futureTime});
}).then(results => {
browser.test.assertEq(0, results.length, "no results returned for late start time");
return browser.history.search({text: "", endTime: 0});
}).then(results => {
browser.test.assertEq(0, results.length, "no results returned for early end time");
--- a/browser/components/extensions/test/xpcshell/test_ext_manifest_permissions.js
+++ b/browser/components/extensions/test/xpcshell/test_ext_manifest_permissions.js
@@ -1,19 +1,19 @@
/* -*- Mode: indent-tabs-mode: nil; js-indent-level: 2 -*- */
/* vim: set sts=2 sw=2 et tw=80: */
"use strict";
/* globals chrome */
function* testPermission(options) {
- function background(options) {
+ function background(bgOptions) {
browser.test.sendMessage("typeof-namespace", {
- browser: typeof browser[options.namespace],
- chrome: typeof chrome[options.namespace],
+ browser: typeof browser[bgOptions.namespace],
+ chrome: typeof chrome[bgOptions.namespace],
});
}
let extensionDetails = {
background: `(${background})(${JSON.stringify(options)})`,
};
let extension = ExtensionTestUtils.loadExtension(extensionDetails);
--- a/browser/components/places/tests/unit/test_PUIU_makeTransaction.js
+++ b/browser/components/places/tests/unit/test_PUIU_makeTransaction.js
@@ -28,28 +28,28 @@ function waitForBookmarkNotification(aNo
index: aIndex,
type: aItemType,
url: aURI ? aURI.spec : null,
title: aTitle });
},
onItemRemoved: function onItemRemoved() {
return this.validate(arguments.callee.name, arguments);
},
- onItemChanged: function onItemChanged(aItemId, aProperty, aIsAnno,
- aNewValue, aLastModified, aItemType)
+ onItemChanged: function onItemChanged(id, property, aIsAnno,
+ aNewValue, aLastModified, type)
{
return this.validate(arguments.callee.name,
- { id: aItemId,
+ { id,
get index() {
return PlacesUtils.bookmarks.getItemIndex(this.id);
},
- type: aItemType,
- property: aProperty,
+ type,
+ property,
get url() {
- return aItemType == PlacesUtils.bookmarks.TYPE_BOOKMARK ?
+ return type == PlacesUtils.bookmarks.TYPE_BOOKMARK ?
PlacesUtils.bookmarks.getBookmarkURI(this.id).spec :
null;
},
get title() {
return PlacesUtils.bookmarks.getItemTitle(this.id);
},
});
},
@@ -116,51 +116,51 @@ add_test(function test_text_paste()
);
PlacesUtils.transactionManager.doTransaction(txn);
});
add_test(function test_container()
{
const TEST_TITLE = "Places folder"
- waitForBookmarkNotification("onItemChanged", function(aData)
+ waitForBookmarkNotification("onItemChanged", function(aChangedData)
{
- do_check_eq(aData.title, TEST_TITLE);
- do_check_eq(aData.type, PlacesUtils.bookmarks.TYPE_FOLDER);
- do_check_eq(aData.index, 1);
+ do_check_eq(aChangedData.title, TEST_TITLE);
+ do_check_eq(aChangedData.type, PlacesUtils.bookmarks.TYPE_FOLDER);
+ do_check_eq(aChangedData.index, 1);
- waitForBookmarkNotification("onItemAdded", function(aData)
+ waitForBookmarkNotification("onItemAdded", function(aAddedData)
{
- do_check_eq(aData.title, TEST_TITLE);
- do_check_eq(aData.type, PlacesUtils.bookmarks.TYPE_FOLDER);
- do_check_eq(aData.index, 2);
- let id = aData.id;
+ do_check_eq(aAddedData.title, TEST_TITLE);
+ do_check_eq(aAddedData.type, PlacesUtils.bookmarks.TYPE_FOLDER);
+ do_check_eq(aAddedData.index, 2);
+ let id = aAddedData.id;
- waitForBookmarkNotification("onItemMoved", function(aData)
+ waitForBookmarkNotification("onItemMoved", function(aMovedData)
{
- do_check_eq(aData.id, id);
- do_check_eq(aData.type, PlacesUtils.bookmarks.TYPE_FOLDER);
- do_check_eq(aData.index, 1);
+ do_check_eq(aMovedData.id, id);
+ do_check_eq(aMovedData.type, PlacesUtils.bookmarks.TYPE_FOLDER);
+ do_check_eq(aMovedData.index, 1);
run_next_test();
});
let txn = PlacesUIUtils.makeTransaction(
- wrapNodeByIdAndParent(aData.id, PlacesUtils.unfiledBookmarksFolderId),
+ wrapNodeByIdAndParent(aAddedData.id, PlacesUtils.unfiledBookmarksFolderId),
0, // Unused for real nodes.
PlacesUtils.unfiledBookmarksFolderId,
1, // Move to position 1.
false
);
PlacesUtils.transactionManager.doTransaction(txn);
});
try {
let txn = PlacesUIUtils.makeTransaction(
- wrapNodeByIdAndParent(aData.id, PlacesUtils.unfiledBookmarksFolderId),
+ wrapNodeByIdAndParent(aChangedData.id, PlacesUtils.unfiledBookmarksFolderId),
0, // Unused for real nodes.
PlacesUtils.unfiledBookmarksFolderId,
PlacesUtils.bookmarks.DEFAULT_INDEX,
true
);
PlacesUtils.transactionManager.doTransaction(txn);
} catch (ex) {
do_throw(ex);
@@ -176,49 +176,49 @@ add_test(function test_container()
PlacesUtils.annotations.setItemAnnotation(id, "random-anno",
"random-value", 0,
PlacesUtils.annotations.EXPIRE_NEVER);
});
add_test(function test_separator()
{
- waitForBookmarkNotification("onItemChanged", function(aData)
+ waitForBookmarkNotification("onItemChanged", function(aChangedData)
{
- do_check_eq(aData.type, PlacesUtils.bookmarks.TYPE_SEPARATOR);
- do_check_eq(aData.index, 3);
+ do_check_eq(aChangedData.type, PlacesUtils.bookmarks.TYPE_SEPARATOR);
+ do_check_eq(aChangedData.index, 3);
- waitForBookmarkNotification("onItemAdded", function(aData)
+ waitForBookmarkNotification("onItemAdded", function(aAddedData)
{
- do_check_eq(aData.type, PlacesUtils.bookmarks.TYPE_SEPARATOR);
- do_check_eq(aData.index, 4);
- let id = aData.id;
+ do_check_eq(aAddedData.type, PlacesUtils.bookmarks.TYPE_SEPARATOR);
+ do_check_eq(aAddedData.index, 4);
+ let id = aAddedData.id;
- waitForBookmarkNotification("onItemMoved", function(aData)
+ waitForBookmarkNotification("onItemMoved", function(aMovedData)
{
- do_check_eq(aData.id, id);
- do_check_eq(aData.type, PlacesUtils.bookmarks.TYPE_SEPARATOR);
- do_check_eq(aData.index, 1);
+ do_check_eq(aMovedData.id, id);
+ do_check_eq(aMovedData.type, PlacesUtils.bookmarks.TYPE_SEPARATOR);
+ do_check_eq(aMovedData.index, 1);
run_next_test();
});
let txn = PlacesUIUtils.makeTransaction(
- wrapNodeByIdAndParent(aData.id, PlacesUtils.unfiledBookmarksFolderId),
+ wrapNodeByIdAndParent(aAddedData.id, PlacesUtils.unfiledBookmarksFolderId),
0, // Unused for real nodes.
PlacesUtils.unfiledBookmarksFolderId,
1, // Move to position 1.
false
);
PlacesUtils.transactionManager.doTransaction(txn);
});
try {
let txn = PlacesUIUtils.makeTransaction(
- wrapNodeByIdAndParent(aData.id, PlacesUtils.unfiledBookmarksFolderId),
+ wrapNodeByIdAndParent(aChangedData.id, PlacesUtils.unfiledBookmarksFolderId),
0, // Unused for real nodes.
PlacesUtils.unfiledBookmarksFolderId,
PlacesUtils.bookmarks.DEFAULT_INDEX,
true
);
PlacesUtils.transactionManager.doTransaction(txn);
} catch (ex) {
do_throw(ex);
@@ -232,53 +232,53 @@ add_test(function test_separator()
PlacesUtils.annotations.EXPIRE_NEVER);
});
add_test(function test_bookmark()
{
const TEST_URL = "http://places.moz.org/"
const TEST_TITLE = "Places bookmark"
- waitForBookmarkNotification("onItemChanged", function(aData)
+ waitForBookmarkNotification("onItemChanged", function(aChangedData)
{
- do_check_eq(aData.title, TEST_TITLE);
- do_check_eq(aData.url, TEST_URL);
- do_check_eq(aData.type, PlacesUtils.bookmarks.TYPE_BOOKMARK);
- do_check_eq(aData.index, 5);
+ do_check_eq(aChangedData.title, TEST_TITLE);
+ do_check_eq(aChangedData.url, TEST_URL);
+ do_check_eq(aChangedData.type, PlacesUtils.bookmarks.TYPE_BOOKMARK);
+ do_check_eq(aChangedData.index, 5);
- waitForBookmarkNotification("onItemAdded", function(aData)
+ waitForBookmarkNotification("onItemAdded", function(aAddedData)
{
- do_check_eq(aData.title, TEST_TITLE);
- do_check_eq(aData.url, TEST_URL);
- do_check_eq(aData.type, PlacesUtils.bookmarks.TYPE_BOOKMARK);
- do_check_eq(aData.index, 6);
- let id = aData.id;
+ do_check_eq(aAddedData.title, TEST_TITLE);
+ do_check_eq(aAddedData.url, TEST_URL);
+ do_check_eq(aAddedData.type, PlacesUtils.bookmarks.TYPE_BOOKMARK);
+ do_check_eq(aAddedData.index, 6);
+ let id = aAddedData.id;
- waitForBookmarkNotification("onItemMoved", function(aData)
+ waitForBookmarkNotification("onItemMoved", function(aMovedData)
{
- do_check_eq(aData.id, id);
- do_check_eq(aData.type, PlacesUtils.bookmarks.TYPE_BOOKMARK);
- do_check_eq(aData.index, 1);
+ do_check_eq(aMovedData.id, id);
+ do_check_eq(aMovedData.type, PlacesUtils.bookmarks.TYPE_BOOKMARK);
+ do_check_eq(aMovedData.index, 1);
run_next_test();
});
let txn = PlacesUIUtils.makeTransaction(
- wrapNodeByIdAndParent(aData.id, PlacesUtils.unfiledBookmarksFolderId),
+ wrapNodeByIdAndParent(aAddedData.id, PlacesUtils.unfiledBookmarksFolderId),
0, // Unused for real nodes.
PlacesUtils.unfiledBookmarksFolderId,
1, // Move to position 1.
false
);
PlacesUtils.transactionManager.doTransaction(txn);
});
try {
let txn = PlacesUIUtils.makeTransaction(
- wrapNodeByIdAndParent(aData.id, PlacesUtils.unfiledBookmarksFolderId),
+ wrapNodeByIdAndParent(aChangedData.id, PlacesUtils.unfiledBookmarksFolderId),
0, // Unused for real nodes.
PlacesUtils.unfiledBookmarksFolderId,
PlacesUtils.bookmarks.DEFAULT_INDEX,
true
);
PlacesUtils.transactionManager.doTransaction(txn);
} catch (ex) {
do_throw(ex);
@@ -297,34 +297,34 @@ add_test(function test_bookmark()
PlacesUtils.annotations.EXPIRE_NEVER);
});
add_test(function test_visit()
{
const TEST_URL = "http://places.moz.org/"
const TEST_TITLE = "Places bookmark"
- waitForBookmarkNotification("onItemAdded", function(aData)
+ waitForBookmarkNotification("onItemAdded", function(aAddedData)
{
- do_check_eq(aData.title, TEST_TITLE);
- do_check_eq(aData.url, TEST_URL);
- do_check_eq(aData.type, PlacesUtils.bookmarks.TYPE_BOOKMARK);
- do_check_eq(aData.index, 7);
+ do_check_eq(aAddedData.title, TEST_TITLE);
+ do_check_eq(aAddedData.url, TEST_URL);
+ do_check_eq(aAddedData.type, PlacesUtils.bookmarks.TYPE_BOOKMARK);
+ do_check_eq(aAddedData.index, 7);
- waitForBookmarkNotification("onItemAdded", function(aData)
+ waitForBookmarkNotification("onItemAdded", function(aAddedData2)
{
- do_check_eq(aData.title, TEST_TITLE);
- do_check_eq(aData.url, TEST_URL);
- do_check_eq(aData.type, PlacesUtils.bookmarks.TYPE_BOOKMARK);
- do_check_eq(aData.index, 8);
+ do_check_eq(aAddedData2.title, TEST_TITLE);
+ do_check_eq(aAddedData2.url, TEST_URL);
+ do_check_eq(aAddedData2.type, PlacesUtils.bookmarks.TYPE_BOOKMARK);
+ do_check_eq(aAddedData2.index, 8);
run_next_test();
});
try {
- let node = wrapNodeByIdAndParent(aData.id, PlacesUtils.unfiledBookmarksFolderId);
+ let node = wrapNodeByIdAndParent(aAddedData.id, PlacesUtils.unfiledBookmarksFolderId);
// Simulate a not-bookmarked node, will copy it to a new bookmark.
node.id = -1;
let txn = PlacesUIUtils.makeTransaction(
node,
0, // Unused for real nodes.
PlacesUtils.unfiledBookmarksFolderId,
PlacesUtils.bookmarks.DEFAULT_INDEX,
true
--- a/browser/experiments/test/xpcshell/test_previous_provider.js
+++ b/browser/experiments/test/xpcshell/test_previous_provider.js
@@ -44,19 +44,19 @@ add_task(function* test_provider_basic()
let provider = new Experiments.PreviousExperimentProvider(e);
e._setPreviousExperimentsProvider(provider);
let deferred = Promise.defer();
provider.getAddonsByTypes(["experiment"], (addons) => {
deferred.resolve(addons);
});
- let addons = yield deferred.promise;
- Assert.ok(Array.isArray(addons), "getAddonsByTypes returns an Array.");
- Assert.equal(addons.length, 0, "No previous add-ons returned.");
+ let experimentAddons = yield deferred.promise;
+ Assert.ok(Array.isArray(experimentAddons), "getAddonsByTypes returns an Array.");
+ Assert.equal(experimentAddons.length, 0, "No previous add-ons returned.");
gManifestObject = {
version: 1,
experiments: [
{
id: EXPERIMENT1_ID,
xpiURL: gDataRoot + EXPERIMENT1_XPI_NAME,
xpiHash: EXPERIMENT1_XPI_SHA1,
@@ -70,18 +70,18 @@ add_task(function* test_provider_basic()
};
yield e.updateManifest();
deferred = Promise.defer();
provider.getAddonsByTypes(["experiment"], (addons) => {
deferred.resolve(addons);
});
- addons = yield deferred.promise;
- Assert.equal(addons.length, 0, "Still no previous experiment.");
+ experimentAddons = yield deferred.promise;
+ Assert.equal(experimentAddons.length, 0, "Still no previous experiment.");
let experiments = yield e.getExperiments();
Assert.equal(experiments.length, 1, "1 experiment present.");
Assert.ok(experiments[0].active, "It is active.");
// Deactivate it.
defineNow(e._policy, new Date(gManifestObject.experiments[0].endTime * 1000 + 1000));
yield e.updateManifest();
@@ -89,19 +89,19 @@ add_task(function* test_provider_basic()
experiments = yield e.getExperiments();
Assert.equal(experiments.length, 1, "1 experiment present.");
Assert.equal(experiments[0].active, false, "It isn't active.");
deferred = Promise.defer();
provider.getAddonsByTypes(["experiment"], (addons) => {
deferred.resolve(addons);
});
- addons = yield deferred.promise;
- Assert.equal(addons.length, 1, "1 previous add-on known.");
- Assert.equal(addons[0].id, EXPERIMENT1_ID, "ID matches expected.");
+ experimentAddons = yield deferred.promise;
+ Assert.equal(experimentAddons.length, 1, "1 previous add-on known.");
+ Assert.equal(experimentAddons[0].id, EXPERIMENT1_ID, "ID matches expected.");
deferred = Promise.defer();
provider.getAddonByID(EXPERIMENT1_ID, (addon) => {
deferred.resolve(addon);
});
let addon = yield deferred.promise;
Assert.ok(addon, "We got an add-on from its ID.");
Assert.equal(addon.id, EXPERIMENT1_ID, "ID matches expected.");
@@ -110,20 +110,20 @@ add_task(function* test_provider_basic()
Assert.equal(addon.type, "experiment", "Add-on is an experiment.");
Assert.equal(addon.isActive, false, "Add-on is not active.");
Assert.equal(addon.permissions, 0, "Add-on has no permissions.");
deferred = Promise.defer();
AddonManager.getAddonsByTypes(["experiment"], (addons) => {
deferred.resolve(addons);
});
- addons = yield deferred.promise;
- Assert.equal(addons.length, 1, "Got 1 experiment from add-on manager.");
- Assert.equal(addons[0].id, EXPERIMENT1_ID, "ID matches expected.");
- Assert.ok(addons[0].appDisabled, "It is a previous experiment add-on.");
+ experimentAddons = yield deferred.promise;
+ Assert.equal(experimentAddons.length, 1, "Got 1 experiment from add-on manager.");
+ Assert.equal(experimentAddons[0].id, EXPERIMENT1_ID, "ID matches expected.");
+ Assert.ok(experimentAddons[0].appDisabled, "It is a previous experiment add-on.");
});
add_task(function* test_active_and_previous() {
// Building on the previous test, activate experiment 2.
let e = Experiments.instance();
let provider = new Experiments.PreviousExperimentProvider(e);
e._setPreviousExperimentsProvider(provider);
@@ -148,27 +148,27 @@ add_task(function* test_active_and_previ
let experiments = yield e.getExperiments();
Assert.equal(experiments.length, 2, "2 experiments known.");
let deferred = Promise.defer();
provider.getAddonsByTypes(["experiment"], (addons) => {
deferred.resolve(addons);
});
- let addons = yield deferred.promise;
- Assert.equal(addons.length, 1, "1 previous experiment.");
+ let experimentAddons = yield deferred.promise;
+ Assert.equal(experimentAddons.length, 1, "1 previous experiment.");
deferred = Promise.defer();
AddonManager.getAddonsByTypes(["experiment"], (addons) => {
deferred.resolve(addons);
});
- addons = yield deferred.promise;
- Assert.equal(addons.length, 2, "2 experiment add-ons known.");
+ experimentAddons = yield deferred.promise;
+ Assert.equal(experimentAddons.length, 2, "2 experiment add-ons known.");
- for (let addon of addons) {
+ for (let addon of experimentAddons) {
if (addon.id == EXPERIMENT1_ID) {
Assert.equal(addon.isActive, false, "Add-on is not active.");
Assert.ok(addon.appDisabled, "Should be a previous experiment.");
}
else if (addon.id == EXPERIMENT2_ID) {
Assert.ok(addon.isActive, "Add-on is active.");
Assert.ok(!addon.appDisabled, "Should not be a previous experiment.");
}
--- a/browser/modules/test/unit/social/head.js
+++ b/browser/modules/test/unit/social/head.js
@@ -59,22 +59,22 @@ function initApp() {
function setManifestPref(manifest) {
let string = Cc["@mozilla.org/supports-string;1"].
createInstance(Ci.nsISupportsString);
string.data = JSON.stringify(manifest);
Services.prefs.setComplexValue("social.manifest." + manifest.origin, Ci.nsISupportsString, string);
}
-function do_wait_observer(topic, cb) {
+function do_wait_observer(obsTopic, cb) {
function observer(subject, topic, data) {
Services.obs.removeObserver(observer, topic);
cb();
}
- Services.obs.addObserver(observer, topic, false);
+ Services.obs.addObserver(observer, obsTopic, false);
}
function do_add_providers(cb) {
// run only after social is already initialized
SocialService.addProvider(manifests[0], function() {
do_wait_observer("social:providers-changed", function() {
do_check_eq(Social.providers.length, 2, "2 providers installed");
do_execute_soon(cb);
--- a/browser/modules/test/xpcshell/test_DirectoryLinksProvider.js
+++ b/browser/modules/test/xpcshell/test_DirectoryLinksProvider.js
@@ -242,17 +242,17 @@ function run_test() {
});
}
function setTimeout(fun, timeout) {
let timer = Components.classes["@mozilla.org/timer;1"]
.createInstance(Components.interfaces.nsITimer);
var event = {
- notify: function (timer) {
+ notify: function () {
fun();
}
};
timer.initWithCallback(event, timeout,
Components.interfaces.nsITimer.TYPE_ONE_SHOT);
return timer;
}
@@ -1657,18 +1657,18 @@ add_task(function* test_inadjecentSites(
// loading inadjacent sites list function
function setInadjacentSites(sites) {
let badSiteB64 = [];
sites.forEach(site => {
badSiteB64.push(DirectoryLinksProvider._generateHash(site));
});
let theList = {"domains": badSiteB64};
- let dataURI = 'data:application/json,' + JSON.stringify(theList);
- DirectoryLinksProvider._inadjacentSitesUrl = dataURI;
+ let uri = 'data:application/json,' + JSON.stringify(theList);
+ DirectoryLinksProvider._inadjacentSitesUrl = uri;
return DirectoryLinksProvider._loadInadjacentSites();
}
// setup gLinks loader
let gLinks = NewTabUtils.links;
gLinks.addProvider(DirectoryLinksProvider);
function updateNewTabCache() {
--- a/security/manager/ssl/tests/unit/head_psm.js
+++ b/security/manager/ssl/tests/unit/head_psm.js
@@ -327,25 +327,25 @@ function add_tls_server_setup(serverBinN
* @param {String} aFirstPartyDomain
* The first party domain which will be used to double-key the OCSP cache.
*/
function add_connection_test(aHost, aExpectedResult,
aBeforeConnect, aWithSecurityInfo,
aAfterStreamOpen, aFirstPartyDomain) {
const REMOTE_PORT = 8443;
- function Connection(aHost) {
- this.host = aHost;
+ function Connection(host) {
+ this.host = host;
let threadManager = Cc["@mozilla.org/thread-manager;1"]
.getService(Ci.nsIThreadManager);
this.thread = threadManager.currentThread;
this.defer = Promise.defer();
let sts = Cc["@mozilla.org/network/socket-transport-service;1"]
.getService(Ci.nsISocketTransportService);
- this.transport = sts.createTransport(["ssl"], 1, aHost, REMOTE_PORT, null);
+ this.transport = sts.createTransport(["ssl"], 1, host, REMOTE_PORT, null);
// See bug 1129771 - attempting to connect to [::1] when the server is
// listening on 127.0.0.1 causes frequent failures on OS X 10.10.
this.transport.connectionFlags |= Ci.nsISocketTransport.DISABLE_IPV6;
this.transport.setEventSink(this, this.thread);
if (aFirstPartyDomain) {
this.transport.firstPartyDomain = aFirstPartyDomain;
}
this.inputStream = null;
@@ -395,21 +395,21 @@ function add_connection_test(aHost, aExp
go: function() {
this.outputStream = this.transport.openOutputStream(0, 0, 0)
.QueryInterface(Ci.nsIAsyncOutputStream);
return this.defer.promise;
}
};
- /* Returns a promise to connect to aHost that resolves to the result of that
+ /* Returns a promise to connect to host that resolves to the result of that
* connection */
- function connectTo(aHost) {
- Services.prefs.setCharPref("network.dns.localDomains", aHost);
- let connection = new Connection(aHost);
+ function connectTo(host) {
+ Services.prefs.setCharPref("network.dns.localDomains", host);
+ let connection = new Connection(host);
return connection.go();
}
add_test(function() {
if (aBeforeConnect) {
aBeforeConnect();
}
connectTo(aHost).then(function(conn) {
--- a/security/manager/ssl/tests/unit/test_cert_blocklist.js
+++ b/security/manager/ssl/tests/unit/test_cert_blocklist.js
@@ -24,42 +24,42 @@ updateAppInfo({
ID: id,
version: version,
platformVersion: platformVersion ? platformVersion : "1.0",
crashReporter: true,
});
// we need to ensure we setup revocation data before certDB, or we'll start with
// no revocation.txt in the profile
-var profile = do_get_profile();
+var gProfile = do_get_profile();
// Write out an empty blocklist.xml file to the profile to ensure nothing
// is blocklisted by default
-var blockFile = profile.clone();
+var blockFile = gProfile.clone();
blockFile.append("blocklist.xml");
var stream = Cc["@mozilla.org/network/file-output-stream;1"]
.createInstance(Ci.nsIFileOutputStream);
stream.init(blockFile,
FileUtils.MODE_WRONLY | FileUtils.MODE_CREATE | FileUtils.MODE_TRUNCATE,
FileUtils.PERMS_FILE, 0);
var data = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
"<blocklist xmlns=\"http://www.mozilla.org/2006/addons-blocklist\">\n" +
"</blocklist>\n";
stream.write(data, data.length);
stream.close();
const PREF_BLOCKLIST_UPDATE_ENABLED = "services.blocklist.update_enabled";
const PREF_ONECRL_VIA_AMO = "security.onecrl.via.amo";
-var revocations = profile.clone();
-revocations.append("revocations.txt");
-if (!revocations.exists()) {
+var gRevocations = gProfile.clone();
+gRevocations.append("revocations.txt");
+if (!gRevocations.exists()) {
let existing = do_get_file("test_onecrl/sample_revocations.txt", false);
- existing.copyTo(profile, "revocations.txt");
+ existing.copyTo(gProfile, "revocations.txt");
}
var certDB = Cc["@mozilla.org/security/x509certdb;1"]
.getService(Ci.nsIX509CertDB);
// set up a test server to serve the blocklist.xml
var testserver = new HttpServer();
@@ -314,22 +314,22 @@ function run_test() {
file = "bad_certs/default-ee.pem";
verify_cert(file, PRErrorCodeSuccess);
// Check a bad cert is still bad (unknown issuer)
file = "bad_certs/unknownissuer.pem";
verify_cert(file, SEC_ERROR_UNKNOWN_ISSUER);
// check that save with no further update is a no-op
- let lastModified = revocations.lastModifiedTime;
+ let lastModified = gRevocations.lastModifiedTime;
// add an already existing entry
certList.revokeCertByIssuerAndSerial("YW5vdGhlciBpbWFnaW5hcnkgaXNzdWVy",
"c2VyaWFsMi4=");
certList.saveEntries();
- let newModified = revocations.lastModifiedTime;
+ let newModified = gRevocations.lastModifiedTime;
equal(lastModified, newModified,
"saveEntries with no modifications should not update the backing file");
run_next_test();
});
// disable AMO cert blocklist - and check blocklist.xml changes do not
// affect the data stored.
--- a/security/manager/ssl/tests/unit/test_cert_keyUsage.js
+++ b/security/manager/ssl/tests/unit/test_cert_keyUsage.js
@@ -41,17 +41,17 @@ const expectedUsagesMap = {
"ee-keyCertSign-and-keyEncipherment-ca-no-keyUsage-extension": serverEEUsages,
"ee-keyCertSign-and-keyEncipherment-ca-missing-keyCertSign": [],
"ee-keyCertSign-and-keyEncipherment-ca-all-usages": serverEEUsages,
};
add_task(function* () {
for (let ca of caList) {
addCertFromFile(certdb, "test_cert_keyUsage/" + ca + ".pem", "CTu,CTu,CTu");
- let cert = constructCertFromFile("test_cert_keyUsage/" + ca + ".pem");
- yield asyncTestCertificateUsages(certdb, cert, expectedUsagesMap[ca]);
+ let caCert = constructCertFromFile("test_cert_keyUsage/" + ca + ".pem");
+ yield asyncTestCertificateUsages(certdb, caCert, expectedUsagesMap[ca]);
for (let ee of eeList) {
let eeFullName = ee + "-" + ca;
- let cert = constructCertFromFile("test_cert_keyUsage/" + eeFullName + ".pem");
- yield asyncTestCertificateUsages(certdb, cert, expectedUsagesMap[eeFullName]);
+ let eeCert = constructCertFromFile("test_cert_keyUsage/" + eeFullName + ".pem");
+ yield asyncTestCertificateUsages(certdb, eeCert, expectedUsagesMap[eeFullName]);
}
}
});
--- a/security/manager/ssl/tests/unit/test_weak_crypto.js
+++ b/security/manager/ssl/tests/unit/test_weak_crypto.js
@@ -64,18 +64,18 @@ function startServer(cert, rc4only) {
let expectedCipher = rc4only ? "TLS_ECDHE_ECDSA_WITH_RC4_128_SHA"
: "TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256";
equal(status.cipherName, expectedCipher,
"Using expected cipher");
equal(status.keyLength, 128, "Using 128-bit key");
equal(status.macLength, rc4only ? 160 : 128, "Using MAC of expected length");
input.asyncWait({
- onInputStreamReady: function(input) {
- NetUtil.asyncCopy(input, output);
+ onInputStreamReady: function(streamReadyInput) {
+ NetUtil.asyncCopy(streamReadyInput, output);
}
}, 0, 0, Services.tm.currentThread);
},
onStopListening: function() {}
};
tlsServer.setSessionCache(false);
tlsServer.setSessionTickets(false);
@@ -110,52 +110,54 @@ function startClient(port, expectedResul
}
let input;
let output;
let deferred = Promise.defer();
let handler = {
- onTransportStatus: function(transport, status) {
+ onTransportStatus: function(unused, status) {
if (status === Ci.nsISocketTransport.STATUS_CONNECTED_TO) {
output.asyncWait(handler, 0, 0, Services.tm.currentThread);
}
},
- onInputStreamReady: function(input) {
+ onInputStreamReady: function(streamReadyInput) {
try {
- let data = NetUtil.readInputStreamToString(input, input.available());
+ let data =
+ NetUtil.readInputStreamToString(streamReadyInput,
+ streamReadyInput.available());
equal(Cr.NS_OK, expectedResult, "Connection should succeed");
equal(data, "HELLO", "Echoed data received");
} catch (e) {
if (!((e.result == Cr.NS_ERROR_NET_RESET) && options.allowReset) &&
(e.result != expectedResult)) {
deferred.reject(e);
}
}
- input.close();
+ streamReadyInput.close();
output.close();
deferred.resolve();
},
- onOutputStreamReady: function(output) {
+ onOutputStreamReady: function(streamReadyOutput) {
try {
try {
- output.write("HELLO", 5);
+ streamReadyOutput.write("HELLO", 5);
} catch (e) {
if (e.result == Cr.NS_BASE_STREAM_WOULD_BLOCK) {
- output.asyncWait(handler, 0, 0, Services.tm.currentThread);
+ streamReadyOutput.asyncWait(handler, 0, 0, Services.tm.currentThread);
return;
}
if (e.result != Cr.NS_OK) {
ok((e.result === expectedResult) ||
(options.allowReset && (e.result === Cr.NS_ERROR_NET_RESET)),
"Actual and expected connection result should match");
- output.close();
+ streamReadyOutput.close();
deferred.resolve();
return;
}
}
do_print("Output to server written");
input = transport.openInputStream(0, 0, 0);
input.asyncWait(handler, 0, 0, Services.tm.currentThread);
} catch (e) {
--- a/testing/xpcshell/xpcshell.eslintrc.js
+++ b/testing/xpcshell/xpcshell.eslintrc.js
@@ -1,13 +1,14 @@
// Parent config file for all xpcshell files.
module.exports = {
rules: {
"mozilla/import-headjs-globals": "warn",
"mozilla/mark-test-function-used": "warn",
+ "no-shadow": "error",
},
// All globals made available in the test environment.
"globals": {
"add_task": false,
"add_test": false,
"Assert": false,
"deepEqual": false,
--- a/toolkit/components/asyncshutdown/tests/xpcshell/head.js
+++ b/toolkit/components/asyncshutdown/tests/xpcshell/head.js
@@ -57,28 +57,28 @@ function makeLock(kind) {
wait: function() {
return barrier.wait();
}
};
} else if (kind == "xpcom-barrier") {
let name = "test-xpcom-Barrier-" + ++makeLock.counter;
let barrier = asyncShutdownService.makeBarrier(name);
return {
- addBlocker: function(name, condition, state) {
+ addBlocker: function(blockerName, condition, state) {
if (condition == null) {
// Slight trick as `null` or `undefined` cannot be used as keys
// for `xpcomMap`. Note that this has no incidence on the result
// of the test as the XPCOM interface imposes that the condition
// is a method, so it cannot be `null`/`undefined`.
condition = "<this case can't happen with the xpcom interface>";
}
let blocker = makeLock.xpcomMap.get(condition);
if (!blocker) {
blocker = {
- name: name,
+ name: blockerName,
state: state,
blockShutdown: function(aBarrierClient) {
return Task.spawn(function*() {
try {
if (typeof condition == "function") {
yield Promise.resolve(condition());
} else {
yield Promise.resolve(condition);
--- a/toolkit/components/asyncshutdown/tests/xpcshell/test_AsyncShutdown.js
+++ b/toolkit/components/asyncshutdown/tests/xpcshell/test_AsyncShutdown.js
@@ -95,25 +95,25 @@ add_task(function* test_phase_removeBloc
do_print("Attempt to add then remove a blocker before wait()");
let lock = makeLock(kind);
let blocker = () => {
do_print("This promise will never be resolved");
return Promise.defer().promise;
};
lock.addBlocker("Wait forever", blocker);
- let do_remove_blocker = function(lock, blocker, shouldRemove) {
- do_print("Attempting to remove blocker " + blocker + ", expecting result " + shouldRemove);
+ let do_remove_blocker = function(aLock, aBlocker, aShouldRemove) {
+ do_print("Attempting to remove blocker " + aBlocker + ", expecting result " + aShouldRemove);
if (kind == "xpcom-barrier") {
// The xpcom variant always returns `undefined`, so we can't
// check its result.
- lock.removeBlocker(blocker);
+ aLock.removeBlocker(aBlocker);
return;
}
- do_check_eq(lock.removeBlocker(blocker), shouldRemove);
+ do_check_eq(aLock.removeBlocker(aBlocker), aShouldRemove);
};
do_remove_blocker(lock, blocker, true);
do_remove_blocker(lock, blocker, false);
do_print("Attempt to remove non-registered blockers before wait()");
do_remove_blocker(lock, "foo", false);
do_remove_blocker(lock, null, false);
do_print("Waiting (should lift immediately)");
yield lock.wait();
--- a/toolkit/components/contentprefs/tests/unit/test_contentPrefs.js
+++ b/toolkit/components/contentprefs/tests/unit/test_contentPrefs.js
@@ -192,43 +192,44 @@ function run_test() {
do_check_true(prefs.hasKey("test.getPrefs.b"));
do_check_eq(prefs.get("test.getPrefs.b"), 2);
do_check_true(prefs.hasKey("test.getPrefs.c"));
do_check_eq(prefs.get("test.getPrefs.c"), 3);
// Site-Specificity
- // These are all different sites, and setting a pref for one of them
- // shouldn't set it for the others.
- var uri1 = ContentPrefTest.getURI("http://www.domain1.com/");
- var uri2 = ContentPrefTest.getURI("http://foo.domain1.com/");
- var uri3 = ContentPrefTest.getURI("http://domain1.com/");
- var uri4 = ContentPrefTest.getURI("http://www.domain2.com/");
+ {
+ // These are all different sites, and setting a pref for one of them
+ // shouldn't set it for the others.
+ let uri1 = ContentPrefTest.getURI("http://www.domain1.com/");
+ let uri2 = ContentPrefTest.getURI("http://foo.domain1.com/");
+ let uri3 = ContentPrefTest.getURI("http://domain1.com/");
+ let uri4 = ContentPrefTest.getURI("http://www.domain2.com/");
- cps.setPref(uri1, "test.site-specificity.uri1", 5);
- do_check_false(cps.hasPref(uri2, "test.site-specificity.uri1"));
- do_check_false(cps.hasPref(uri3, "test.site-specificity.uri1"));
- do_check_false(cps.hasPref(uri4, "test.site-specificity.uri1"));
+ cps.setPref(uri1, "test.site-specificity.uri1", 5);
+ do_check_false(cps.hasPref(uri2, "test.site-specificity.uri1"));
+ do_check_false(cps.hasPref(uri3, "test.site-specificity.uri1"));
+ do_check_false(cps.hasPref(uri4, "test.site-specificity.uri1"));
- cps.setPref(uri2, "test.site-specificity.uri2", 5);
- do_check_false(cps.hasPref(uri1, "test.site-specificity.uri2"));
- do_check_false(cps.hasPref(uri3, "test.site-specificity.uri2"));
- do_check_false(cps.hasPref(uri4, "test.site-specificity.uri2"));
+ cps.setPref(uri2, "test.site-specificity.uri2", 5);
+ do_check_false(cps.hasPref(uri1, "test.site-specificity.uri2"));
+ do_check_false(cps.hasPref(uri3, "test.site-specificity.uri2"));
+ do_check_false(cps.hasPref(uri4, "test.site-specificity.uri2"));
- cps.setPref(uri3, "test.site-specificity.uri3", 5);
- do_check_false(cps.hasPref(uri1, "test.site-specificity.uri3"));
- do_check_false(cps.hasPref(uri2, "test.site-specificity.uri3"));
- do_check_false(cps.hasPref(uri4, "test.site-specificity.uri3"));
+ cps.setPref(uri3, "test.site-specificity.uri3", 5);
+ do_check_false(cps.hasPref(uri1, "test.site-specificity.uri3"));
+ do_check_false(cps.hasPref(uri2, "test.site-specificity.uri3"));
+ do_check_false(cps.hasPref(uri4, "test.site-specificity.uri3"));
- cps.setPref(uri4, "test.site-specificity.uri4", 5);
- do_check_false(cps.hasPref(uri1, "test.site-specificity.uri4"));
- do_check_false(cps.hasPref(uri2, "test.site-specificity.uri4"));
- do_check_false(cps.hasPref(uri3, "test.site-specificity.uri4"));
-
+ cps.setPref(uri4, "test.site-specificity.uri4", 5);
+ do_check_false(cps.hasPref(uri1, "test.site-specificity.uri4"));
+ do_check_false(cps.hasPref(uri2, "test.site-specificity.uri4"));
+ do_check_false(cps.hasPref(uri3, "test.site-specificity.uri4"));
+ }
// Observers
var specificObserver = {
interfaces: [Ci.nsIContentPrefObserver, Ci.nsISupports],
QueryInterface: function ContentPrefTest_QueryInterface(iid) {
if (!this.interfaces.some( function(v) { return iid.equals(v) } ))
--- a/toolkit/components/ctypes/tests/unit/test_jsctypes.js
+++ b/toolkit/components/ctypes/tests/unit/test_jsctypes.js
@@ -299,120 +299,120 @@ function run_Int64_tests() {
do_check_true(ctypes.Int64.hasOwnProperty("join"));
do_check_true(ctypes.Int64.prototype.hasOwnProperty("toString"));
do_check_true(ctypes.Int64.prototype.hasOwnProperty("toSource"));
// Check that the shared functions on ctypes.Int64.prototype throw.
do_check_throws(function() { ctypes.Int64.prototype.toString(); }, TypeError);
do_check_throws(function() { ctypes.Int64.prototype.toSource(); }, TypeError);
- let i = ctypes.Int64(0);
- do_check_true(i.__proto__ === ctypes.Int64.prototype);
- do_check_true(i instanceof ctypes.Int64);
+ let int64 = ctypes.Int64(0);
+ do_check_true(int64.__proto__ === ctypes.Int64.prototype);
+ do_check_true(int64 instanceof ctypes.Int64);
// Test Int64.toString([radix]).
- do_check_eq(i.toString(), "0");
+ do_check_eq(int64.toString(), "0");
for (let radix = 2; radix <= 36; ++radix)
- do_check_eq(i.toString(radix), "0");
- do_check_throws(function() { i.toString(0); }, RangeError);
- do_check_throws(function() { i.toString(1); }, RangeError);
- do_check_throws(function() { i.toString(37); }, RangeError);
- do_check_throws(function() { i.toString(10, 2); }, TypeError);
+ do_check_eq(int64.toString(radix), "0");
+ do_check_throws(function() { int64.toString(0); }, RangeError);
+ do_check_throws(function() { int64.toString(1); }, RangeError);
+ do_check_throws(function() { int64.toString(37); }, RangeError);
+ do_check_throws(function() { int64.toString(10, 2); }, TypeError);
// Test Int64.toSource().
- do_check_eq(i.toSource(), "ctypes.Int64(\"0\")");
- do_check_throws(function() { i.toSource(10); }, TypeError);
-
- i = ctypes.Int64("0x28590a1c921def71");
- do_check_eq(i.toString(), i.toString(10));
- do_check_eq(i.toString(10), "2907366152271163249");
- do_check_eq(i.toString(16), "28590a1c921def71");
- do_check_eq(i.toString(2), "10100001011001000010100001110010010010000111011110111101110001");
- do_check_eq(i.toSource(), "ctypes.Int64(\"" + i.toString(10) + "\")");
-
- i = ctypes.Int64("-0x28590a1c921def71");
- do_check_eq(i.toString(), i.toString(10));
- do_check_eq(i.toString(10), "-2907366152271163249");
- do_check_eq(i.toString(16), "-28590a1c921def71");
- do_check_eq(i.toString(2), "-10100001011001000010100001110010010010000111011110111101110001");
- do_check_eq(i.toSource(), "ctypes.Int64(\"" + i.toString(10) + "\")");
-
- i = ctypes.Int64("-0X28590A1c921DEf71");
- do_check_eq(i.toString(), i.toString(10));
- do_check_eq(i.toString(10), "-2907366152271163249");
- do_check_eq(i.toString(16), "-28590a1c921def71");
- do_check_eq(i.toString(2), "-10100001011001000010100001110010010010000111011110111101110001");
- do_check_eq(i.toSource(), "ctypes.Int64(\"" + i.toString(10) + "\")");
+ do_check_eq(int64.toSource(), "ctypes.Int64(\"0\")");
+ do_check_throws(function() { int64.toSource(10); }, TypeError);
+
+ int64 = ctypes.Int64("0x28590a1c921def71");
+ do_check_eq(int64.toString(), int64.toString(10));
+ do_check_eq(int64.toString(10), "2907366152271163249");
+ do_check_eq(int64.toString(16), "28590a1c921def71");
+ do_check_eq(int64.toString(2), "10100001011001000010100001110010010010000111011110111101110001");
+ do_check_eq(int64.toSource(), "ctypes.Int64(\"" + int64.toString(10) + "\")");
+
+ int64 = ctypes.Int64("-0x28590a1c921def71");
+ do_check_eq(int64.toString(), int64.toString(10));
+ do_check_eq(int64.toString(10), "-2907366152271163249");
+ do_check_eq(int64.toString(16), "-28590a1c921def71");
+ do_check_eq(int64.toString(2), "-10100001011001000010100001110010010010000111011110111101110001");
+ do_check_eq(int64.toSource(), "ctypes.Int64(\"" + int64.toString(10) + "\")");
+
+ int64 = ctypes.Int64("-0X28590A1c921DEf71");
+ do_check_eq(int64.toString(), int64.toString(10));
+ do_check_eq(int64.toString(10), "-2907366152271163249");
+ do_check_eq(int64.toString(16), "-28590a1c921def71");
+ do_check_eq(int64.toString(2), "-10100001011001000010100001110010010010000111011110111101110001");
+ do_check_eq(int64.toSource(), "ctypes.Int64(\"" + int64.toString(10) + "\")");
// Test Int64(primitive double) constructor.
- i = ctypes.Int64(-0);
- do_check_eq(i.toString(), "0");
-
- i = ctypes.Int64(0x7ffffffffffff000);
- do_check_eq(i.toString(), i.toString(10));
- do_check_eq(i.toString(10), "9223372036854771712");
- do_check_eq(i.toString(16), "7ffffffffffff000");
- do_check_eq(i.toString(2), "111111111111111111111111111111111111111111111111111000000000000");
-
- i = ctypes.Int64(-0x8000000000000000);
- do_check_eq(i.toString(), i.toString(10));
- do_check_eq(i.toString(10), "-9223372036854775808");
- do_check_eq(i.toString(16), "-8000000000000000");
- do_check_eq(i.toString(2), "-1000000000000000000000000000000000000000000000000000000000000000");
+ int64 = ctypes.Int64(-0);
+ do_check_eq(int64.toString(), "0");
+
+ int64 = ctypes.Int64(0x7ffffffffffff000);
+ do_check_eq(int64.toString(), int64.toString(10));
+ do_check_eq(int64.toString(10), "9223372036854771712");
+ do_check_eq(int64.toString(16), "7ffffffffffff000");
+ do_check_eq(int64.toString(2), "111111111111111111111111111111111111111111111111111000000000000");
+
+ int64 = ctypes.Int64(-0x8000000000000000);
+ do_check_eq(int64.toString(), int64.toString(10));
+ do_check_eq(int64.toString(10), "-9223372036854775808");
+ do_check_eq(int64.toString(16), "-8000000000000000");
+ do_check_eq(int64.toString(2), "-1000000000000000000000000000000000000000000000000000000000000000");
// Test Int64(string) constructor.
- i = ctypes.Int64("0x7fffffffffffffff");
- do_check_eq(i.toString(), i.toString(10));
- do_check_eq(i.toString(10), "9223372036854775807");
- do_check_eq(i.toString(16), "7fffffffffffffff");
- do_check_eq(i.toString(2), "111111111111111111111111111111111111111111111111111111111111111");
-
- i = ctypes.Int64("-0x8000000000000000");
- do_check_eq(i.toString(), i.toString(10));
- do_check_eq(i.toString(10), "-9223372036854775808");
- do_check_eq(i.toString(16), "-8000000000000000");
- do_check_eq(i.toString(2), "-1000000000000000000000000000000000000000000000000000000000000000");
-
- i = ctypes.Int64("9223372036854775807");
- do_check_eq(i.toString(), i.toString(10));
- do_check_eq(i.toString(10), "9223372036854775807");
- do_check_eq(i.toString(16), "7fffffffffffffff");
- do_check_eq(i.toString(2), "111111111111111111111111111111111111111111111111111111111111111");
-
- i = ctypes.Int64("-9223372036854775808");
- do_check_eq(i.toString(), i.toString(10));
- do_check_eq(i.toString(10), "-9223372036854775808");
- do_check_eq(i.toString(16), "-8000000000000000");
- do_check_eq(i.toString(2), "-1000000000000000000000000000000000000000000000000000000000000000");
+ int64 = ctypes.Int64("0x7fffffffffffffff");
+ do_check_eq(int64.toString(), int64.toString(10));
+ do_check_eq(int64.toString(10), "9223372036854775807");
+ do_check_eq(int64.toString(16), "7fffffffffffffff");
+ do_check_eq(int64.toString(2), "111111111111111111111111111111111111111111111111111111111111111");
+
+ int64 = ctypes.Int64("-0x8000000000000000");
+ do_check_eq(int64.toString(), int64.toString(10));
+ do_check_eq(int64.toString(10), "-9223372036854775808");
+ do_check_eq(int64.toString(16), "-8000000000000000");
+ do_check_eq(int64.toString(2), "-1000000000000000000000000000000000000000000000000000000000000000");
+
+ int64 = ctypes.Int64("9223372036854775807");
+ do_check_eq(int64.toString(), int64.toString(10));
+ do_check_eq(int64.toString(10), "9223372036854775807");
+ do_check_eq(int64.toString(16), "7fffffffffffffff");
+ do_check_eq(int64.toString(2), "111111111111111111111111111111111111111111111111111111111111111");
+
+ int64 = ctypes.Int64("-9223372036854775808");
+ do_check_eq(int64.toString(), int64.toString(10));
+ do_check_eq(int64.toString(10), "-9223372036854775808");
+ do_check_eq(int64.toString(16), "-8000000000000000");
+ do_check_eq(int64.toString(2), "-1000000000000000000000000000000000000000000000000000000000000000");
// Test Int64(other Int64) constructor.
- i = ctypes.Int64(ctypes.Int64(0));
- do_check_eq(i.toString(), "0");
-
- i = ctypes.Int64(ctypes.Int64("0x7fffffffffffffff"));
- do_check_eq(i.toString(), i.toString(10));
- do_check_eq(i.toString(10), "9223372036854775807");
- do_check_eq(i.toString(16), "7fffffffffffffff");
- do_check_eq(i.toString(2), "111111111111111111111111111111111111111111111111111111111111111");
-
- i = ctypes.Int64(ctypes.Int64("-0x8000000000000000"));
- do_check_eq(i.toString(), i.toString(10));
- do_check_eq(i.toString(10), "-9223372036854775808");
- do_check_eq(i.toString(16), "-8000000000000000");
- do_check_eq(i.toString(2), "-1000000000000000000000000000000000000000000000000000000000000000");
+ int64 = ctypes.Int64(ctypes.Int64(0));
+ do_check_eq(int64.toString(), "0");
+
+ int64 = ctypes.Int64(ctypes.Int64("0x7fffffffffffffff"));
+ do_check_eq(int64.toString(), int64.toString(10));
+ do_check_eq(int64.toString(10), "9223372036854775807");
+ do_check_eq(int64.toString(16), "7fffffffffffffff");
+ do_check_eq(int64.toString(2), "111111111111111111111111111111111111111111111111111111111111111");
+
+ int64 = ctypes.Int64(ctypes.Int64("-0x8000000000000000"));
+ do_check_eq(int64.toString(), int64.toString(10));
+ do_check_eq(int64.toString(10), "-9223372036854775808");
+ do_check_eq(int64.toString(16), "-8000000000000000");
+ do_check_eq(int64.toString(2), "-1000000000000000000000000000000000000000000000000000000000000000");
// Test Int64(other UInt64) constructor.
- i = ctypes.Int64(ctypes.UInt64(0));
- do_check_eq(i.toString(), "0");
-
- i = ctypes.Int64(ctypes.UInt64("0x7fffffffffffffff"));
- do_check_eq(i.toString(), i.toString(10));
- do_check_eq(i.toString(10), "9223372036854775807");
- do_check_eq(i.toString(16), "7fffffffffffffff");
- do_check_eq(i.toString(2), "111111111111111111111111111111111111111111111111111111111111111");
+ int64 = ctypes.Int64(ctypes.UInt64(0));
+ do_check_eq(int64.toString(), "0");
+
+ int64 = ctypes.Int64(ctypes.UInt64("0x7fffffffffffffff"));
+ do_check_eq(int64.toString(), int64.toString(10));
+ do_check_eq(int64.toString(10), "9223372036854775807");
+ do_check_eq(int64.toString(16), "7fffffffffffffff");
+ do_check_eq(int64.toString(2), "111111111111111111111111111111111111111111111111111111111111111");
let vals = [-0x8000000000001000, 0x8000000000000000,
ctypes.UInt64("0x8000000000000000"),
Infinity, -Infinity, NaN, 0.1,
5.68e21, null, undefined, "", {}, [], new Number(16),
{toString: function () { return 7; }},
{valueOf: function () { return 7; }}];
for (let i = 0; i < vals.length; i++)
@@ -469,101 +469,101 @@ function run_UInt64_tests() {
do_check_true(ctypes.UInt64.hasOwnProperty("join"));
do_check_true(ctypes.UInt64.prototype.hasOwnProperty("toString"));
do_check_true(ctypes.UInt64.prototype.hasOwnProperty("toSource"));
// Check that the shared functions on ctypes.UInt64.prototype throw.
do_check_throws(function() { ctypes.UInt64.prototype.toString(); }, TypeError);
do_check_throws(function() { ctypes.UInt64.prototype.toSource(); }, TypeError);
- let i = ctypes.UInt64(0);
- do_check_true(i.__proto__ === ctypes.UInt64.prototype);
- do_check_true(i instanceof ctypes.UInt64);
+ let uint64 = ctypes.UInt64(0);
+ do_check_true(uint64.__proto__ === ctypes.UInt64.prototype);
+ do_check_true(uint64 instanceof ctypes.UInt64);
// Test UInt64.toString([radix]).
- do_check_eq(i.toString(), "0");
+ do_check_eq(uint64.toString(), "0");
for (let radix = 2; radix <= 36; ++radix)
- do_check_eq(i.toString(radix), "0");
- do_check_throws(function() { i.toString(0); }, RangeError);
- do_check_throws(function() { i.toString(1); }, RangeError);
- do_check_throws(function() { i.toString(37); }, RangeError);
- do_check_throws(function() { i.toString(10, 2); }, TypeError);
+ do_check_eq(uint64.toString(radix), "0");
+ do_check_throws(function() { uint64.toString(0); }, RangeError);
+ do_check_throws(function() { uint64.toString(1); }, RangeError);
+ do_check_throws(function() { uint64.toString(37); }, RangeError);
+ do_check_throws(function() { uint64.toString(10, 2); }, TypeError);
// Test UInt64.toSource().
- do_check_eq(i.toSource(), "ctypes.UInt64(\"0\")");
- do_check_throws(function() { i.toSource(10); }, TypeError);
-
- i = ctypes.UInt64("0x28590a1c921def71");
- do_check_eq(i.toString(), i.toString(10));
- do_check_eq(i.toString(10), "2907366152271163249");
- do_check_eq(i.toString(16), "28590a1c921def71");
- do_check_eq(i.toString(2), "10100001011001000010100001110010010010000111011110111101110001");
- do_check_eq(i.toSource(), "ctypes.UInt64(\"" + i.toString(10) + "\")");
-
- i = ctypes.UInt64("0X28590A1c921DEf71");
- do_check_eq(i.toString(), i.toString(10));
- do_check_eq(i.toString(10), "2907366152271163249");
- do_check_eq(i.toString(16), "28590a1c921def71");
- do_check_eq(i.toString(2), "10100001011001000010100001110010010010000111011110111101110001");
- do_check_eq(i.toSource(), "ctypes.UInt64(\"" + i.toString(10) + "\")");
+ do_check_eq(uint64.toSource(), "ctypes.UInt64(\"0\")");
+ do_check_throws(function() { uint64.toSource(10); }, TypeError);
+
+ uint64 = ctypes.UInt64("0x28590a1c921def71");
+ do_check_eq(uint64.toString(), uint64.toString(10));
+ do_check_eq(uint64.toString(10), "2907366152271163249");
+ do_check_eq(uint64.toString(16), "28590a1c921def71");
+ do_check_eq(uint64.toString(2), "10100001011001000010100001110010010010000111011110111101110001");
+ do_check_eq(uint64.toSource(), "ctypes.UInt64(\"" + uint64.toString(10) + "\")");
+
+ uint64 = ctypes.UInt64("0X28590A1c921DEf71");
+ do_check_eq(uint64.toString(), uint64.toString(10));
+ do_check_eq(uint64.toString(10), "2907366152271163249");
+ do_check_eq(uint64.toString(16), "28590a1c921def71");
+ do_check_eq(uint64.toString(2), "10100001011001000010100001110010010010000111011110111101110001");
+ do_check_eq(uint64.toSource(), "ctypes.UInt64(\"" + uint64.toString(10) + "\")");
// Test UInt64(primitive double) constructor.
- i = ctypes.UInt64(-0);
- do_check_eq(i.toString(), "0");
-
- i = ctypes.UInt64(0xfffffffffffff000);
- do_check_eq(i.toString(), i.toString(10));
- do_check_eq(i.toString(10), "18446744073709547520");
- do_check_eq(i.toString(16), "fffffffffffff000");
- do_check_eq(i.toString(2), "1111111111111111111111111111111111111111111111111111000000000000");
+ uint64 = ctypes.UInt64(-0);
+ do_check_eq(uint64.toString(), "0");
+
+ uint64 = ctypes.UInt64(0xfffffffffffff000);
+ do_check_eq(uint64.toString(), uint64.toString(10));
+ do_check_eq(uint64.toString(10), "18446744073709547520");
+ do_check_eq(uint64.toString(16), "fffffffffffff000");
+ do_check_eq(uint64.toString(2), "1111111111111111111111111111111111111111111111111111000000000000");
// Test UInt64(string) constructor.
- i = ctypes.UInt64("0xffffffffffffffff");
- do_check_eq(i.toString(), i.toString(10));
- do_check_eq(i.toString(10), "18446744073709551615");
- do_check_eq(i.toString(16), "ffffffffffffffff");
- do_check_eq(i.toString(2), "1111111111111111111111111111111111111111111111111111111111111111");
-
- i = ctypes.UInt64("0x0");
- do_check_eq(i.toString(), i.toString(10));
- do_check_eq(i.toString(10), "0");
- do_check_eq(i.toString(16), "0");
- do_check_eq(i.toString(2), "0");
-
- i = ctypes.UInt64("18446744073709551615");
- do_check_eq(i.toString(), i.toString(10));
- do_check_eq(i.toString(10), "18446744073709551615");
- do_check_eq(i.toString(16), "ffffffffffffffff");
- do_check_eq(i.toString(2), "1111111111111111111111111111111111111111111111111111111111111111");
-
- i = ctypes.UInt64("0");
- do_check_eq(i.toString(), "0");
+ uint64 = ctypes.UInt64("0xffffffffffffffff");
+ do_check_eq(uint64.toString(), uint64.toString(10));
+ do_check_eq(uint64.toString(10), "18446744073709551615");
+ do_check_eq(uint64.toString(16), "ffffffffffffffff");
+ do_check_eq(uint64.toString(2), "1111111111111111111111111111111111111111111111111111111111111111");
+
+ uint64 = ctypes.UInt64("0x0");
+ do_check_eq(uint64.toString(), uint64.toString(10));
+ do_check_eq(uint64.toString(10), "0");
+ do_check_eq(uint64.toString(16), "0");
+ do_check_eq(uint64.toString(2), "0");
+
+ uint64 = ctypes.UInt64("18446744073709551615");
+ do_check_eq(uint64.toString(), uint64.toString(10));
+ do_check_eq(uint64.toString(10), "18446744073709551615");
+ do_check_eq(uint64.toString(16), "ffffffffffffffff");
+ do_check_eq(uint64.toString(2), "1111111111111111111111111111111111111111111111111111111111111111");
+
+ uint64 = ctypes.UInt64("0");
+ do_check_eq(uint64.toString(), "0");
// Test UInt64(other UInt64) constructor.
- i = ctypes.UInt64(ctypes.UInt64(0));
- do_check_eq(i.toString(), "0");
-
- i = ctypes.UInt64(ctypes.UInt64("0xffffffffffffffff"));
- do_check_eq(i.toString(), i.toString(10));
- do_check_eq(i.toString(10), "18446744073709551615");
- do_check_eq(i.toString(16), "ffffffffffffffff");
- do_check_eq(i.toString(2), "1111111111111111111111111111111111111111111111111111111111111111");
-
- i = ctypes.UInt64(ctypes.UInt64("0x0"));
- do_check_eq(i.toString(), "0");
+ uint64 = ctypes.UInt64(ctypes.UInt64(0));
+ do_check_eq(uint64.toString(), "0");
+
+ uint64 = ctypes.UInt64(ctypes.UInt64("0xffffffffffffffff"));
+ do_check_eq(uint64.toString(), uint64.toString(10));
+ do_check_eq(uint64.toString(10), "18446744073709551615");
+ do_check_eq(uint64.toString(16), "ffffffffffffffff");
+ do_check_eq(uint64.toString(2), "1111111111111111111111111111111111111111111111111111111111111111");
+
+ uint64 = ctypes.UInt64(ctypes.UInt64("0x0"));
+ do_check_eq(uint64.toString(), "0");
// Test UInt64(other Int64) constructor.
- i = ctypes.UInt64(ctypes.Int64(0));
- do_check_eq(i.toString(), "0");
-
- i = ctypes.UInt64(ctypes.Int64("0x7fffffffffffffff"));
- do_check_eq(i.toString(), i.toString(10));
- do_check_eq(i.toString(10), "9223372036854775807");
- do_check_eq(i.toString(16), "7fffffffffffffff");
- do_check_eq(i.toString(2), "111111111111111111111111111111111111111111111111111111111111111");
+ uint64 = ctypes.UInt64(ctypes.Int64(0));
+ do_check_eq(uint64.toString(), "0");
+
+ uint64 = ctypes.UInt64(ctypes.Int64("0x7fffffffffffffff"));
+ do_check_eq(uint64.toString(), uint64.toString(10));
+ do_check_eq(uint64.toString(10), "9223372036854775807");
+ do_check_eq(uint64.toString(16), "7fffffffffffffff");
+ do_check_eq(uint64.toString(2), "111111111111111111111111111111111111111111111111111111111111111");
let vals = [-1, 0x10000000000000000, "-1", "-0x1",
ctypes.Int64("-1"), Infinity, -Infinity, NaN, 0.1,
5.68e21, null, undefined, "", {}, [], new Number(16),
{toString: function () { return 7; }},
{valueOf: function () { return 7; }}];
for (let i = 0; i < vals.length; i++)
do_check_throws(function () { ctypes.UInt64(vals[i]); }, TypeError);
@@ -946,19 +946,19 @@ function run_float_tests(library, t, nam
// don't convert anything else
let vals = [true, false, null, undefined, "", "0", {}, [], new Number(16),
{toString: function () { return 7; }},
{valueOf: function () { return 7; }}];
for (let i = 0; i < vals.length; i++)
do_check_throws(function () { d.value = vals[i]; }, TypeError);
// Check that values roundtrip through toSource() correctly.
- function test_roundtrip(t, val)
+ function test_roundtrip(tFn, val)
{
- let f1 = t(val);
+ let f1 = tFn(val);
eval("var f2 = " + f1.toSource());
do_check_eq(f1.value, f2.value);
}
vals = [Infinity, -Infinity, -0, 0, 1, -1, 1/3, -1/3, 1/4, -1/4,
1e-14, -1e-14, 0xfffffffffffff000, -0xfffffffffffff000];
for (let i = 0; i < vals.length; i++)
test_roundtrip(t, vals[i]);
do_check_eq(t(NaN).toSource(), t.toSource() + "(NaN)");
@@ -1681,21 +1681,21 @@ function run_PointerType_tests() {
// Test void pointers.
let v_t = ctypes.PointerType(ctypes.void_t);
do_check_true(v_t === ctypes.voidptr_t);
let v = v_t(p);
do_check_eq(ptrValue(v), ptrValue(p));
// Test 'contents'.
- let i = ctypes.int32_t(9);
- p = i.address();
- do_check_eq(p.contents, i.value);
+ let int32_t = ctypes.int32_t(9);
+ p = int32_t.address();
+ do_check_eq(p.contents, int32_t.value);
p.contents = ctypes.int32_t(12);
- do_check_eq(i.value, 12);
+ do_check_eq(int32_t.value, 12);
// Test 'isNull'.
let n = f_t(0);
do_check_true(n.isNull() === true);
n = p.address();
do_check_true(n.isNull() === false);
// Test 'increment'/'decrement'.
--- a/toolkit/components/downloads/test/unit/test_app_rep_windows.js
+++ b/toolkit/components/downloads/test/unit/test_app_rep_windows.js
@@ -74,23 +74,23 @@ function readFileToString(aFilename) {
*
* @return {Promise}
* @resolves When onSaveComplete is called with a success code.
* @rejects With an exception, if onSaveComplete is called with a failure code.
*/
function promiseSaverComplete(aSaver, aOnTargetChangeFn) {
let deferred = Promise.defer();
aSaver.observer = {
- onTargetChange: function BFSO_onSaveComplete(aSaver, aTarget)
+ onTargetChange: function BFSO_onSaveComplete(unused, aTarget)
{
if (aOnTargetChangeFn) {
aOnTargetChangeFn(aTarget);
}
},
- onSaveComplete: function BFSO_onSaveComplete(aSaver, aStatus)
+ onSaveComplete: function BFSO_onSaveComplete(unused, aStatus)
{
if (Components.isSuccessCode(aStatus)) {
deferred.resolve();
} else {
deferred.reject(new Components.Exception("Saver failed.", aStatus));
}
},
};
--- a/toolkit/components/extensions/test/xpcshell/test_ext_downloads_download.js
+++ b/toolkit/components/extensions/test/xpcshell/test_ext_downloads_download.js
@@ -2,22 +2,22 @@
/* vim: set sts=2 sw=2 et tw=80: */
"use strict";
/* global OS */
Cu.import("resource://gre/modules/osfile.jsm");
Cu.import("resource://gre/modules/Downloads.jsm");
-const server = createHttpServer();
-server.registerDirectory("/data/", do_get_file("data"));
+const gServer = createHttpServer();
+gServer.registerDirectory("/data/", do_get_file("data"));
const WINDOWS = AppConstants.platform == "win";
-const BASE = `http://localhost:${server.identity.primaryPort}/data`;
+const BASE = `http://localhost:${gServer.identity.primaryPort}/data`;
const FILE_NAME = "file_download.txt";
const FILE_URL = BASE + "/" + FILE_NAME;
const FILE_NAME_UNIQUE = "file_download(1).txt";
const FILE_LEN = 46;
let downloadDir;
function setup() {
--- a/toolkit/components/extensions/test/xpcshell/test_ext_downloads_misc.js
+++ b/toolkit/components/extensions/test/xpcshell/test_ext_downloads_misc.js
@@ -97,24 +97,24 @@ function backgroundScript() {
});
// Returns a promise that will resolve when the given list of expected
// events have all been seen. By default, succeeds only if the exact list
// of expected events is seen in the given order. options.exact can be
// set to false to allow other events and options.inorder can be set to
// false to allow the events to arrive in any order.
function waitForEvents(expected, options = {}) {
- function compare(received, expected) {
- if (typeof expected == "object" && expected != null) {
- if (typeof received != "object") {
+ function compare(a, b) {
+ if (typeof b == "object" && b != null) {
+ if (typeof a != "object") {
return false;
}
- return Object.keys(expected).every(fld => compare(received[fld], expected[fld]));
+ return Object.keys(b).every(fld => compare(a[fld], b[fld]));
}
- return (received == expected);
+ return (a == b);
}
const exact = ("exact" in options) ? options.exact : true;
const inorder = ("inorder" in options) ? options.inorder : true;
return new Promise((resolve, reject) => {
function check() {
function fail(msg) {
browser.test.fail(msg);
--- a/toolkit/components/extensions/test/xpcshell/test_ext_downloads_search.js
+++ b/toolkit/components/extensions/test/xpcshell/test_ext_downloads_search.js
@@ -151,22 +151,22 @@ add_task(function* test_search() {
equal(msg.status, "success", "download() succeeded");
downloadIds.html2 = msg.id;
const time3 = new Date();
// Search for each individual download and check
// the corresponding DownloadItem.
function* checkDownloadItem(id, expect) {
- let msg = yield search({id});
- equal(msg.status, "success", "search() succeeded");
- equal(msg.downloads.length, 1, "search() found exactly 1 download");
+ let item = yield search({id});
+ equal(item.status, "success", "search() succeeded");
+ equal(item.downloads.length, 1, "search() found exactly 1 download");
Object.keys(expect).forEach(function(field) {
- equal(msg.downloads[0][field], expect[field], `DownloadItem.${field} is correct"`);
+ equal(item.downloads[0][field], expect[field], `DownloadItem.${field} is correct"`);
});
}
yield checkDownloadItem(downloadIds.txt1, {
url: TXT_URL,
filename: downloadPath(TXT_FILE),
mime: "text/plain",
state: "complete",
bytesReceived: TXT_LEN,
@@ -204,21 +204,21 @@ add_task(function* test_search() {
state: "complete",
bytesReceived: HTML_LEN,
totalBytes: HTML_LEN,
fileSize: HTML_LEN,
exists: true,
});
function* checkSearch(query, expected, description, exact) {
- let msg = yield search(query);
- equal(msg.status, "success", "search() succeeded");
- equal(msg.downloads.length, expected.length, `search() for ${description} found exactly ${expected.length} downloads`);
+ let item = yield search(query);
+ equal(item.status, "success", "search() succeeded");
+ equal(item.downloads.length, expected.length, `search() for ${description} found exactly ${expected.length} downloads`);
- let receivedIds = msg.downloads.map(item => item.id);
+ let receivedIds = item.downloads.map(i => i.id);
if (exact) {
receivedIds.forEach((id, idx) => {
equal(id, downloadIds[expected[idx]], `search() for ${description} returned ${expected[idx]} in position ${idx}`);
});
} else {
Object.keys(downloadIds).forEach(key => {
const id = downloadIds[key];
const thisExpected = expected.includes(key);
@@ -376,19 +376,19 @@ add_task(function* test_search() {
// NB: TXT_URL and HTML_URL differ only in extension and .html precedes .txt
yield checkSearch({orderBy: ["url", "-startTime"]}, ["html2", "html1", "txt2", "txt1"], "orderBy with multiple fields", true);
// Check orderBy with limit.
yield checkSearch({orderBy: ["url"], limit: 1}, ["html1"], "orderBy with limit", true);
// Check bad arguments.
function* checkBadSearch(query, pattern, description) {
- let msg = yield search(query);
- equal(msg.status, "error", "search() failed");
- ok(pattern.test(msg.errmsg), `error message for ${description} was correct (${msg.errmsg}).`);
+ let item = yield search(query);
+ equal(item.status, "error", "search() failed");
+ ok(pattern.test(item.errmsg), `error message for ${description} was correct (${item.errmsg}).`);
}
yield checkBadSearch("myquery", /Incorrect argument type/, "query is not an object");
yield checkBadSearch({bogus: "boo"}, /Unexpected property/, "query contains an unknown field");
yield checkBadSearch({query: "query string"}, /Expected array/, "query.query is a string");
yield checkBadSearch({startedBefore: "i am not a time"}, /Type error/, "query.startedBefore is not a valid time");
yield checkBadSearch({startedAfter: "i am not a time"}, /Type error/, "query.startedAfter is not a valid time");
yield checkBadSearch({endedBefore: "i am not a time"}, /Type error/, "query.endedBefore is not a valid time");
--- a/toolkit/components/extensions/test/xpcshell/test_ext_legacy_extension_context.js
+++ b/toolkit/components/extensions/test/xpcshell/test_ext_legacy_extension_context.js
@@ -36,18 +36,18 @@ add_task(function* test_legacy_extension
let reply = await browser.runtime.sendMessage("webextension -> legacy_extension message");
browser.test.assertEq("legacy_extension -> webextension reply", reply,
"Got the expected message from the LegacyExtensionContext");
browser.test.sendMessage("got-reply-message");
} else if (msg == "do-connect") {
port = browser.runtime.connect();
- port.onMessage.addListener(msg => {
- browser.test.assertEq("legacy_extension -> webextension port message", msg,
+ port.onMessage.addListener(portMsg => {
+ browser.test.assertEq("legacy_extension -> webextension port message", portMsg,
"Got the expected message from the LegacyExtensionContext");
port.postMessage("webextension -> legacy_extension port message");
});
} else if (msg == "do-disconnect") {
port.disconnect();
}
});
}
--- a/toolkit/components/extensions/test/xpcshell/test_ext_native_messaging_perf.js
+++ b/toolkit/components/extensions/test/xpcshell/test_ext_native_messaging_perf.js
@@ -85,17 +85,17 @@ add_task(function* test_round_trip_perf(
function finish() {
let roundTripTime = (Date.now() - now) / COUNT;
port.disconnect();
browser.test.sendMessage("result", roundTripTime);
}
let count = 0;
- port.onMessage.addListener(msg => {
+ port.onMessage.addListener(() => {
if (count == 0) {
// Skip the first round, since it includes the time it takes
// the app to start up.
now = Date.now();
}
if (count++ <= COUNT) {
next();
--- a/toolkit/components/extensions/test/xpcshell/test_ext_schemas.js
+++ b/toolkit/components/extensions/test/xpcshell/test_ext_schemas.js
@@ -632,18 +632,18 @@ add_task(function* () {
tallied = null;
for (let format of ["url", "relativeUrl"]) {
Assert.throws(() => root.testing.format({[format]: "chrome://foo/content/"}),
/Access denied/,
"should throw for access denied");
}
- for (let url of ["//foo.html", "http://foo/bar.html"]) {
- Assert.throws(() => root.testing.format({strictRelativeUrl: url}),
+ for (let urlString of ["//foo.html", "http://foo/bar.html"]) {
+ Assert.throws(() => root.testing.format({strictRelativeUrl: urlString}),
/must be a relative URL/,
"should throw for non-relative URL");
}
const dates = [
"2016-03-04",
"2016-03-04T08:00:00Z",
"2016-03-04T08:00:00.000Z",
@@ -748,20 +748,20 @@ add_task(function* () {
let target = {prop1: 12, prop2: ["value1", "value3"]};
let proxy = new Proxy(target, {});
Assert.throws(() => root.testing.quack(proxy),
/Expected a plain JavaScript object, got a Proxy/,
"should throw when passing a Proxy");
if (Symbol.toStringTag) {
- let target = {prop1: 12, prop2: ["value1", "value3"]};
- target[Symbol.toStringTag] = () => "[object Object]";
- let proxy = new Proxy(target, {});
- Assert.throws(() => root.testing.quack(proxy),
+ let stringTarget = {prop1: 12, prop2: ["value1", "value3"]};
+ stringTarget[Symbol.toStringTag] = () => "[object Object]";
+ let stringProxy = new Proxy(stringTarget, {});
+ Assert.throws(() => root.testing.quack(stringProxy),
/Expected a plain JavaScript object, got a Proxy/,
"should throw when passing a Proxy");
}
root.testing.localize({foo: "__MSG_foo__", bar: "__MSG_foo__", url: "__MSG_http://example.com/__"});
verify("call", "testing", "localize", [{foo: "FOO", bar: "__MSG_foo__", url: "http://example.com/"}]);
tallied = null;
--- a/toolkit/components/extensions/test/xpcshell/test_ext_storage.js
+++ b/toolkit/components/extensions/test/xpcshell/test_ext_storage.js
@@ -15,18 +15,18 @@ async function backgroundScript() {
browser.test.assertEq(value, data[prop], "array getter worked for " + prop);
data = await storage.get({[prop]: undefined});
browser.test.assertEq(value, data[prop], "object getter worked for " + prop);
}
let globalChanges = {};
- browser.storage.onChanged.addListener((changes, storage) => {
- browser.test.assertEq("local", storage, "storage is local");
+ browser.storage.onChanged.addListener((changes, changedStorage) => {
+ browser.test.assertEq("local", changedStorage, "storage is local");
Object.assign(globalChanges, changes);
});
function checkChanges(changes) {
function checkSub(obj1, obj2) {
for (let prop in obj1) {
browser.test.assertEq(obj1[prop].oldValue, obj2[prop].oldValue);
browser.test.assertEq(obj1[prop].newValue, obj2[prop].newValue);
--- a/toolkit/components/extensions/test/xpcshell/test_native_messaging.js
+++ b/toolkit/components/extensions/test/xpcshell/test_native_messaging.js
@@ -267,31 +267,31 @@ while True:
`${REGPATH}\\wontdie`, "", manifestPath);
} else {
yield OS.File.writeAtomic(scriptPath, `#!${PYTHON} -u\n${SCRIPT}`);
yield OS.File.setPermissions(scriptPath, {unixMode: 0o755});
manifest.path = scriptPath;
yield writeManifest(manifestPath, manifest);
}
- let context = new MockContext(ID);
- let app = new NativeApp(context, "wontdie");
+ let mockContext = new MockContext(ID);
+ let app = new NativeApp(mockContext, "wontdie");
// send a message and wait for the reply to make sure the app is running
let MSG = "test";
let recvPromise = new Promise(resolve => {
let listener = (what, msg) => {
equal(msg, MSG, "Received test message");
app.off("message", listener);
resolve();
};
app.on("message", listener);
});
- let buffer = NativeApp.encodeMessage(context, MSG);
+ let buffer = NativeApp.encodeMessage(mockContext, MSG);
app.send(buffer);
yield recvPromise;
app._cleanup();
do_print("waiting for async shutdown");
Services.prefs.setBoolPref("toolkit.asyncshutdown.testing", true);
AsyncShutdown.profileBeforeChange._trigger();
--- a/toolkit/components/jsdownloads/test/unit/common_test_Download.js
+++ b/toolkit/components/jsdownloads/test/unit/common_test_Download.js
@@ -2464,18 +2464,16 @@ add_task(function* test_history_tryToKee
yield promiseDownloadStopped(download);
});
/**
* Tests that the temp download files are removed on exit and exiting private
* mode after they have been launched.
*/
add_task(function* test_launchWhenSucceeded_deleteTempFileOnExit() {
- const kDeleteTempFileOnExit = "browser.helperApps.deleteTempFileOnExit";
-
let customLauncherPath = getTempFile("app-launcher").path;
let autoDeleteTargetPathOne = getTempFile(TEST_TARGET_FILE_NAME).path;
let autoDeleteTargetPathTwo = getTempFile(TEST_TARGET_FILE_NAME).path;
let noAutoDeleteTargetPath = getTempFile(TEST_TARGET_FILE_NAME).path;
let autoDeleteDownloadOne = yield Downloads.createDownload({
source: { url: httpUrl("source.txt"), isPrivate: true },
target: autoDeleteTargetPathOne,
--- a/toolkit/components/jsdownloads/test/unit/head.js
+++ b/toolkit/components/jsdownloads/test/unit/head.js
@@ -413,19 +413,19 @@ function promiseStartExternalHelperAppSe
});
// Start the actual download process.
channel.asyncOpen2({
contentListener: null,
onStartRequest: function (aRequest, aContext)
{
- let channel = aRequest.QueryInterface(Ci.nsIChannel);
+ let requestChannel = aRequest.QueryInterface(Ci.nsIChannel);
this.contentListener = gExternalHelperAppService.doContent(
- channel.contentType, aRequest, null, true);
+ requestChannel.contentType, aRequest, null, true);
this.contentListener.onStartRequest(aRequest, aContext);
},
onStopRequest: function (aRequest, aContext, aStatusCode)
{
this.contentListener.onStopRequest(aRequest, aContext, aStatusCode);
},
--- a/toolkit/components/search/tests/xpcshell/head_search.js
+++ b/toolkit/components/search/tests/xpcshell/head_search.js
@@ -76,19 +76,19 @@ function configureToLoadJarEngines()
/**
* Fake the installation of an add-on in the profile, by creating the
* directory and registering it with the directory service.
*/
function installAddonEngine(name = "engine-addon")
{
const XRE_EXTENSIONS_DIR_LIST = "XREExtDL";
- const gProfD = do_get_profile().QueryInterface(Ci.nsILocalFile);
+ const profD = do_get_profile().QueryInterface(Ci.nsILocalFile);
- let dir = gProfD.clone();
+ let dir = profD.clone();
dir.append("extensions");
if (!dir.exists())
dir.create(dir.DIRECTORY_TYPE, FileUtils.PERMS_DIRECTORY);
dir.append("search-engine@tests.mozilla.org");
dir.create(dir.DIRECTORY_TYPE, FileUtils.PERMS_DIRECTORY);
do_get_file("data/install.rdf").copyTo(dir, "install.rdf");
@@ -128,19 +128,19 @@ function installAddonEngine(name = "engi
/**
* Copy the engine-distribution.xml engine to a fake distribution
* created in the profile, and registered with the directory service.
*/
function installDistributionEngine()
{
const XRE_APP_DISTRIBUTION_DIR = "XREAppDist";
- const gProfD = do_get_profile().QueryInterface(Ci.nsILocalFile);
+ const profD = do_get_profile().QueryInterface(Ci.nsILocalFile);
- let dir = gProfD.clone();
+ let dir = profD.clone();
dir.append("distribution");
dir.create(dir.DIRECTORY_TYPE, FileUtils.PERMS_DIRECTORY);
let distDir = dir.clone();
dir.append("searchplugins");
dir.create(dir.DIRECTORY_TYPE, FileUtils.PERMS_DIRECTORY);
dir.append("common");
--- a/toolkit/components/search/tests/xpcshell/test_engineUpdate.js
+++ b/toolkit/components/search/tests/xpcshell/test_engineUpdate.js
@@ -28,19 +28,19 @@ add_task(function* test_engineUpdate() {
Services.search.moveEngine(engine, 0);
// can't have an accurate updateURL in the file since we can't know the test
// server origin, so manually set it
engine.wrappedJSObject._updateURL = gDataUrl + FILENAME;
yield new Promise(resolve => {
Services.obs.addObserver(function obs(subject, topic, data) {
if (data == "engine-loaded") {
- let engine = subject.QueryInterface(Ci.nsISearchEngine);
- let rawEngine = engine.wrappedJSObject;
- equal(engine.alias, KEYWORD, "Keyword not cleared by update");
+ let loadedEngine = subject.QueryInterface(Ci.nsISearchEngine);
+ let rawEngine = loadedEngine.wrappedJSObject;
+ equal(loadedEngine.alias, KEYWORD, "Keyword not cleared by update");
equal(rawEngine.getAttr("order"), 1, "Order not cleared by update");
Services.obs.removeObserver(obs, TOPIC, false);
resolve();
}
}, TOPIC, false);
// set last update to 8 days ago, since the default interval is 7, then
// trigger an update
--- a/toolkit/components/search/tests/xpcshell/test_searchSuggest.js
+++ b/toolkit/components/search/tests/xpcshell/test_searchSuggest.js
@@ -22,18 +22,18 @@ var httpServer = new HttpServer();
var getEngine, postEngine, unresolvableEngine;
function run_test() {
Services.prefs.setBoolPref("browser.search.suggest.enabled", true);
removeMetadata();
updateAppInfo();
- let httpServer = useHttpServer();
- httpServer.registerContentType("sjs", "sjs");
+ let server = useHttpServer();
+ server.registerContentType("sjs", "sjs");
do_register_cleanup(() => Task.spawn(function* cleanup() {
// Remove added form history entries
yield updateSearchHistory("remove", null);
FormHistory.shutdown();
Services.prefs.clearUserPref("browser.search.suggest.enabled");
}));
--- a/toolkit/components/telemetry/tests/unit/test_TelemetryEnvironment.js
+++ b/toolkit/components/telemetry/tests/unit/test_TelemetryEnvironment.js
@@ -1023,17 +1023,17 @@ add_task(function* test_pluginsWatch_Add
add_task(function* test_pluginsWatch_Remove() {
if (gIsAndroid) {
Assert.ok(true, "Skipping: there is no Plugin Manager on Android.");
return;
}
// Find the test plugin.
- let plugin = gInstalledPlugins.find(plugin => (plugin.name == PLUGIN2_NAME));
+ let plugin = gInstalledPlugins.find(p => (p.name == PLUGIN2_NAME));
Assert.ok(plugin, "The test plugin must exist.");
// Remove it from the PluginHost.
gInstalledPlugins = gInstalledPlugins.filter(p => p != plugin);
let deferred = PromiseUtils.defer();
let receivedNotifications = 0;
let callback = () => {
@@ -1392,26 +1392,26 @@ add_task(function* test_defaultSearchEng
TelemetryEnvironment.unregisterChangeListener("testWatch_SearchDefault");
// Cleanly install an engine from an xml file, and check if origin is
// recorded as "verified".
let promise = new Promise(resolve => {
TelemetryEnvironment.registerChangeListener("testWatch_SearchDefault", resolve);
});
let engine = yield new Promise((resolve, reject) => {
- Services.obs.addObserver(function obs(subject, topic, data) {
+ Services.obs.addObserver(function obs(obsSubject, obsTopic, obsData) {
try {
- let engine = subject.QueryInterface(Ci.nsISearchEngine);
- do_print("Observed " + data + " for " + engine.name);
- if (data != "engine-added" || engine.name != "engine-telemetry") {
+ let searchEngine = obsSubject.QueryInterface(Ci.nsISearchEngine);
+ do_print("Observed " + obsData + " for " + searchEngine.name);
+ if (obsData != "engine-added" || searchEngine.name != "engine-telemetry") {
return;
}
Services.obs.removeObserver(obs, "browser-search-engine-modified");
- resolve(engine);
+ resolve(searchEngine);
} catch (ex) {
reject(ex);
}
}, "browser-search-engine-modified", false);
Services.search.addEngine("file://" + do_get_cwd().path + "/engine.xml",
null, null, false);
});
Services.search.defaultEngine = engine;
--- a/toolkit/components/thumbnails/test/browser_thumbnails_storage_migrate3.js
+++ b/toolkit/components/thumbnails/test/browser_thumbnails_storage_migrate3.js
@@ -69,17 +69,17 @@ function* runTests() {
// Check that our existing thumbnail wasn't overwritten.
is(getFileContents(file), "no-overwrite-plz",
"existing thumbnail was not overwritten");
// Sanity check: ensure that, until it is removed, deprecated
// function |getFileForURL| points to the same path as
// |getFilePathForURL|.
if ("getFileForURL" in PageThumbsStorage) {
- let file = PageThumbsStorage.getFileForURL(URL);
+ file = PageThumbsStorage.getFileForURL(URL);
is(file.path, PageThumbsStorage.getFilePathForURL(URL),
"Deprecated getFileForURL and getFilePathForURL return the same path");
}
}
function changeLocation(aLocation, aNewDir) {
let oldDir = gDirSvc.get(aLocation, Ci.nsILocalFile);
gDirSvc.undefine(aLocation);
--- a/toolkit/forgetaboutsite/test/unit/test_removeDataFromDomain.js
+++ b/toolkit/forgetaboutsite/test/unit/test_removeDataFromDomain.js
@@ -59,17 +59,17 @@ function uri(aURIString)
*
* @return {Promise}
* @resolves When the check has been added successfully.
* @rejects JavaScript exception.
*/
function promiseIsURIVisited(aURI)
{
let deferred = Promise.defer();
- PlacesUtils.asyncHistory.isURIVisited(aURI, function(aURI, aIsVisited) {
+ PlacesUtils.asyncHistory.isURIVisited(aURI, function(unused, aIsVisited) {
deferred.resolve(aIsVisited);
});
return deferred.promise;
}
/**
* Add a cookie to the cookie service.
@@ -454,16 +454,32 @@ function* test_content_preferences_not_c
do_check_true(yield preference_exists(TEST_URI));
// Reset state
ForgetAboutSite.removeDataFromDomain("ilovemozilla.org");
yield waitForPurgeNotification();
do_check_false(yield preference_exists(TEST_URI));
}
+function push_registration_exists(aURL, ps)
+{
+ return new Promise(resolve => {
+ let ssm = Cc["@mozilla.org/scriptsecuritymanager;1"]
+ .getService(Ci.nsIScriptSecurityManager);
+ let principal = ssm.createCodebasePrincipalFromOrigin(aURL);
+ return ps.getSubscription(aURL, principal, (status, record) => {
+ if (!Components.isSuccessCode(status)) {
+ resolve(false);
+ } else {
+ resolve(!!record);
+ }
+ });
+ });
+}
+
// Push
function* test_push_cleared()
{
let ps;
try {
ps = Cc["@mozilla.org/push/Service;1"].
getService(Ci.nsIPushService);
} catch (e) {
@@ -474,38 +490,22 @@ function* test_push_cleared()
do_get_profile();
setPrefs();
const {PushDB, PushService, PushServiceWebSocket} = serviceExports;
const userAgentID = 'bd744428-f125-436a-b6d0-dd0c9845837f';
const channelID = '0ef2ad4a-6c49-41ad-af6e-95d2425276bf';
let db = PushServiceWebSocket.newPushDB();
- function push_registration_exists(aURL, ps)
- {
- return new Promise(resolve => {
- let ssm = Cc["@mozilla.org/scriptsecuritymanager;1"]
- .getService(Ci.nsIScriptSecurityManager);
- let principal = ssm.createCodebasePrincipalFromOrigin(aURL);
- return ps.getSubscription(aURL, principal, (status, record) => {
- if (!Components.isSuccessCode(status)) {
- resolve(false);
- } else {
- resolve(!!record);
- }
- });
- });
- }
-
try {
PushService.init({
serverURI: "wss://push.example.org/",
db,
- makeWebSocket(uri) {
- return new MockWebSocket(uri, {
+ makeWebSocket(uriObj) {
+ return new MockWebSocket(uriObj, {
onHello(request) {
this.serverSendMsg(JSON.stringify({
messageType: 'hello',
status: 200,
uaid: userAgentID,
}));
},
});
--- a/toolkit/identity/tests/unit/test_crypto_service.js
+++ b/toolkit/identity/tests/unit/test_crypto_service.js
@@ -54,19 +54,19 @@ function test_dsa() {
do_check_eq(keyPair.keyType, ALG_DSA);
do_check_eq_or_slightly_less(keyPair.hexDSAGenerator.length, 1024 / 8 * 2);
do_check_eq_or_slightly_less(keyPair.hexDSAPrime.length, 1024 / 8 * 2);
do_check_eq_or_slightly_less(keyPair.hexDSASubPrime.length, 160 / 8 * 2);
do_check_eq_or_slightly_less(keyPair.hexDSAPublicValue.length, 1024 / 8 * 2);
// XXX: test that RSA parameters throw the correct error
log("about to sign with DSA key");
- keyPair.sign("foo", function (rv, signature) {
- log("DSA sign finished ", rv, signature);
- do_check_true(Components.isSuccessCode(rv));
+ keyPair.sign("foo", function (rv2, signature) {
+ log("DSA sign finished ", rv2, signature);
+ do_check_true(Components.isSuccessCode(rv2));
do_check_true(signature.length > 1);
// TODO: verify the signature with the public key
run_next_test();
});
});
}
function test_rsa() {
@@ -75,19 +75,19 @@ function test_rsa() {
do_check_true(Components.isSuccessCode(rv));
do_check_eq(typeof keyPair.sign, "function");
do_check_eq(keyPair.keyType, ALG_RSA);
do_check_eq_or_slightly_less(keyPair.hexRSAPublicKeyModulus.length,
2048 / 8);
do_check_true(keyPair.hexRSAPublicKeyExponent.length > 1);
log("about to sign with RSA key");
- keyPair.sign("foo", function (rv, signature) {
- log("RSA sign finished ", rv, signature);
- do_check_true(Components.isSuccessCode(rv));
+ keyPair.sign("foo", function (rv2, signature) {
+ log("RSA sign finished ", rv2, signature);
+ do_check_true(Components.isSuccessCode(rv2));
do_check_true(signature.length > 1);
run_next_test();
});
});
}
function test_base64UrlEncode() {
for (let [source, target] of BASE64_URL_ENCODINGS) {
--- a/toolkit/identity/tests/unit/test_jwcrypto.js
+++ b/toolkit/identity/tests/unit/test_jwcrypto.js
@@ -47,18 +47,18 @@ function test_generate() {
}
function test_get_assertion() {
do_test_pending();
jwcrypto.generateKeyPair(
"DS160",
function(err, kp) {
- jwcrypto.generateAssertion("fake-cert", kp, RP_ORIGIN, (err, backedAssertion) => {
- do_check_null(err);
+ jwcrypto.generateAssertion("fake-cert", kp, RP_ORIGIN, (err2, backedAssertion) => {
+ do_check_null(err2);
do_check_eq(backedAssertion.split("~").length, 2);
do_check_eq(backedAssertion.split(".").length, 3);
do_test_finished();
run_next_test();
});
});
@@ -140,18 +140,18 @@ function test_get_assertion_with_offset(
jwcrypto.generateKeyPair(
"DS160",
function(err, kp) {
jwcrypto.generateAssertion("fake-cert", kp, RP_ORIGIN,
{ duration: MINUTE_MS,
localtimeOffsetMsec: localtimeOffsetMsec,
now: localMsec},
- function(err, backedAssertion) {
- do_check_null(err);
+ function(err2, backedAssertion) {
+ do_check_null(err2);
// properly formed
let cert;
let assertion;
[cert, assertion] = backedAssertion.split("~");
do_check_eq(cert, "fake-cert");
do_check_eq(assertion.split(".").length, 3);
@@ -173,18 +173,18 @@ function test_get_assertion_with_offset(
function test_assertion_lifetime() {
do_test_pending();
jwcrypto.generateKeyPair(
"DS160",
function(err, kp) {
jwcrypto.generateAssertion("fake-cert", kp, RP_ORIGIN,
{duration: MINUTE_MS},
- function(err, backedAssertion) {
- do_check_null(err);
+ function(err2, backedAssertion) {
+ do_check_null(err2);
// properly formed
let cert;
let assertion;
[cert, assertion] = backedAssertion.split("~");
do_check_eq(cert, "fake-cert");
do_check_eq(assertion.split(".").length, 3);
@@ -207,18 +207,18 @@ function test_assertion_lifetime() {
function test_audience_encoding_bug972582() {
let audience = "i-like-pie.com";
jwcrypto.generateKeyPair(
"DS160",
function(err, kp) {
do_check_null(err);
jwcrypto.generateAssertion("fake-cert", kp, audience,
- function(err, backedAssertion) {
- do_check_null(err);
+ function(err2, backedAssertion) {
+ do_check_null(err2);
let [cert, assertion] = backedAssertion.split("~");
let components = extractComponents(assertion);
do_check_eq(components.payload.aud, audience);
do_test_finished();
run_next_test();
}
--- a/toolkit/modules/subprocess/test/xpcshell/test_subprocess.js
+++ b/toolkit/modules/subprocess/test/xpcshell/test_subprocess.js
@@ -190,17 +190,17 @@ add_task(function* test_subprocess_round
arguments: ["-u", TEST_SCRIPT, "echo"],
});
const LINE = "I'm a leaf on the wind.\n";
let now = Date.now();
const COUNT = 1000;
- for (let i = 0; i < COUNT; i++) {
+ for (let j = 0; j < COUNT; j++) {
let [output] = yield Promise.all([
read(proc.stdout),
proc.stdin.write(LINE),
]);
// We don't want to log this for every iteration, but we still need
// to fail if it goes wrong.
if (output !== LINE) {
@@ -534,22 +534,22 @@ add_task(function* test_subprocess_workd
"Current process directory must not be the current temp directory");
function* pwd(options) {
let proc = yield Subprocess.call(Object.assign({
command: PYTHON,
arguments: ["-u", TEST_SCRIPT, "pwd"],
}, options));
- let pwd = read(proc.stdout);
+ let pwdOutput = read(proc.stdout);
let {exitCode} = yield proc.wait();
equal(exitCode, 0, "Got expected exit code");
- return pwd;
+ return pwdOutput;
}
let dir = yield pwd({});
equal(dir, procDir, "Process should normally launch in current process directory");
dir = yield pwd({workdir: tmpDir});
equal(dir, tmpDir, "Process should launch in the directory specified in `workdir`");
--- a/toolkit/modules/subprocess/test/xpcshell/test_subprocess_pathSearch.js
+++ b/toolkit/modules/subprocess/test/xpcshell/test_subprocess_pathSearch.js
@@ -1,13 +1,13 @@
"use strict";
-let env = Cc["@mozilla.org/process/environment;1"].getService(Ci.nsIEnvironment);
+let envService = Cc["@mozilla.org/process/environment;1"].getService(Ci.nsIEnvironment);
-const PYTHON = env.get("PYTHON");
+const PYTHON = envService.get("PYTHON");
const PYTHON_BIN = OS.Path.basename(PYTHON);
const PYTHON_DIR = OS.Path.dirname(PYTHON);
const DOES_NOT_EXIST = OS.Path.join(OS.Constants.Path.tmpDir,
"ThisPathDoesNotExist");
const PATH_SEP = AppConstants.platform == "win" ? ";" : ":";
--- a/toolkit/modules/tests/xpcshell/test_GMPInstallManager.js
+++ b/toolkit/modules/tests/xpcshell/test_GMPInstallManager.js
@@ -137,20 +137,20 @@ add_test(function test_checkForAddons_40
run_next_test();
});
});
/**
* Tests that a xhr abort() works as expected
*/
add_test(function test_checkForAddons_abort() {
- let xhr = overrideXHR(200, "", { dropRequest: true} );
+ let overriddenXhr = overrideXHR(200, "", { dropRequest: true} );
let installManager = new GMPInstallManager();
let promise = installManager.checkForAddons();
- xhr.abort();
+ overriddenXhr.abort();
promise.then(res => {
do_check_true(res.usedFallback);
installManager.uninit();
run_next_test();
});
});
/**
--- a/toolkit/modules/tests/xpcshell/test_Log.js
+++ b/toolkit/modules/tests/xpcshell/test_Log.js
@@ -484,18 +484,18 @@ add_task(function* log_message_with_para
/*
* If we call a log function with a non-string object in place of the text
* argument, and no parameters, treat that the same as logging empty text
* with the object argument as parameters. This makes the log useful when the
* caller does "catch(err) {logger.error(err)}"
*/
add_task(function* test_log_err_only() {
let log = Log.repository.getLogger("error.only");
- let testFormatter = { format: msg => msg };
- let appender = new MockAppender(testFormatter);
+ let mockFormatter = { format: msg => msg };
+ let appender = new MockAppender(mockFormatter);
log.addAppender(appender);
/*
* Check that log.error(err) is treated the same as
* log.error(null, err) by the logMessage constructor; the formatMessage()
* tests above ensure that the combination of null text and an error object
* is formatted correctly.
*/
@@ -535,18 +535,18 @@ add_task(function* test_structured_basic
do_check_true(appender.messages[1].includes('Structured sub structure'));
});
/*
* Test that all the basic logger methods pass the message and params through to the appender.
*/
add_task(function* log_message_with_params() {
let log = Log.repository.getLogger("error.logger");
- let testFormatter = { format: msg => msg };
- let appender = new MockAppender(testFormatter);
+ let mockFormatter = { format: msg => msg };
+ let appender = new MockAppender(mockFormatter);
log.addAppender(appender);
let testParams = {a:1, b:2};
log.fatal("Test fatal", testParams);
log.error("Test error", testParams);
log.warn("Test warn", testParams);
log.info("Test info", testParams);
log.config("Test config", testParams);
--- a/toolkit/modules/tests/xpcshell/test_MatchURLFilters.js
+++ b/toolkit/modules/tests/xpcshell/test_MatchURLFilters.js
@@ -376,21 +376,21 @@ add_task(function* test_match_url_filter
{urlMatches: "value#ref2$"},
{originAndPathMatches: ".*://moz.*com/"},
], url: "https://mozilla.org/sub/path?p1=v#ref"},
];
// Run all the the testCases defined above.
for (let currentTest of testCases) {
let {
- shouldThrow, exceptionMessageContains,
- shouldFail, url, filters,
+ exceptionMessageContains,
+ url, filters,
} = currentTest;
- if (shouldThrow) {
+ if (currentTest.shouldThrow) {
expectThrow({url, filters, exceptionMessageContains})
- } else if (shouldFail) {
+ } else if (currentTest.shouldFail) {
expectFail({url, filters});
} else {
expectPass({url, filters});
}
}
});
--- a/toolkit/mozapps/extensions/test/xpcshell/head_addons.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/head_addons.js
@@ -263,20 +263,19 @@ this.BootstrapMonitor = {
let info = JSON.parse(data);
let id = info.data.id;
let installPath = new FileUtils.File(info.data.installPath);
if (subject && subject.wrappedJSObject) {
// NOTE: in some of the new tests, we need to received the real objects instead of
// their JSON representations, but most of the current tests expect intallPath
// and resourceURI to have been converted to strings.
- const {installPath, resourceURI} = info.data;
info.data = Object.assign({}, subject.wrappedJSObject.data, {
- installPath,
- resourceURI,
+ installPath: info.data.installPath,
+ resourceURI: info.data.resourceURI,
});
}
// If this is the install event the add-ons shouldn't already be installed
if (info.event == "install") {
this.checkAddonNotInstalled(id);
this.installed.set(id, info);
--- a/toolkit/mozapps/extensions/test/xpcshell/test_LightweightThemeManager.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_LightweightThemeManager.js
@@ -202,108 +202,108 @@ function run_test() {
do_check_eq(typeof roundtrip(data).unknownProperty, "undefined");
data = dummy();
data.unknownURL = "http://lwttest.invalid/";
do_check_eq(typeof roundtrip(data).unknownURL, "undefined");
function roundtripSet(props, modify, test, secure) {
props.forEach(function (prop) {
- var data = dummy();
- modify(data, prop);
- test(roundtrip(data, secure), prop, data);
+ var theme = dummy();
+ modify(theme, prop);
+ test(roundtrip(theme, secure), prop, theme);
});
}
- roundtripSet(MANDATORY, function (data, prop) {
- delete data[prop];
+ roundtripSet(MANDATORY, function (theme, prop) {
+ delete theme[prop];
}, function (after) {
do_check_eq(after, null);
});
- roundtripSet(OPTIONAL, function (data, prop) {
- delete data[prop];
+ roundtripSet(OPTIONAL, function (theme, prop) {
+ delete theme[prop];
}, function (after) {
do_check_neq(after, null);
});
- roundtripSet(MANDATORY, function (data, prop) {
- data[prop] = "";
+ roundtripSet(MANDATORY, function (theme, prop) {
+ theme[prop] = "";
}, function (after) {
do_check_eq(after, null);
});
- roundtripSet(OPTIONAL, function (data, prop) {
- data[prop] = "";
+ roundtripSet(OPTIONAL, function (theme, prop) {
+ theme[prop] = "";
}, function (after, prop) {
do_check_eq(typeof after[prop], "undefined");
});
- roundtripSet(MANDATORY, function (data, prop) {
- data[prop] = " ";
+ roundtripSet(MANDATORY, function (theme, prop) {
+ theme[prop] = " ";
}, function (after) {
do_check_eq(after, null);
});
- roundtripSet(OPTIONAL, function (data, prop) {
- data[prop] = " ";
+ roundtripSet(OPTIONAL, function (theme, prop) {
+ theme[prop] = " ";
}, function (after, prop) {
do_check_neq(after, null);
do_check_eq(typeof after[prop], "undefined");
});
function non_urls(props) {
return props.filter(prop => !/URL$/.test(prop));
}
function urls(props) {
return props.filter(prop => /URL$/.test(prop));
}
- roundtripSet(non_urls(MANDATORY.concat(OPTIONAL)), function (data, prop) {
- data[prop] = prop;
+ roundtripSet(non_urls(MANDATORY.concat(OPTIONAL)), function (theme, prop) {
+ theme[prop] = prop;
}, function (after, prop, before) {
do_check_eq(after[prop], before[prop]);
});
- roundtripSet(non_urls(MANDATORY.concat(OPTIONAL)), function (data, prop) {
- data[prop] = " " + prop + " ";
+ roundtripSet(non_urls(MANDATORY.concat(OPTIONAL)), function (theme, prop) {
+ theme[prop] = " " + prop + " ";
}, function (after, prop, before) {
do_check_eq(after[prop], before[prop].trim());
});
- roundtripSet(urls(MANDATORY.concat(OPTIONAL)), function (data, prop) {
- data[prop] = Math.random().toString();
+ roundtripSet(urls(MANDATORY.concat(OPTIONAL)), function (theme, prop) {
+ theme[prop] = Math.random().toString();
}, function (after, prop, before) {
if (prop == "updateURL")
do_check_eq(typeof after[prop], "undefined");
else
do_check_eq(after[prop], "http://lwttest.invalid/" + before[prop]);
});
- roundtripSet(urls(MANDATORY.concat(OPTIONAL)), function (data, prop) {
- data[prop] = Math.random().toString();
+ roundtripSet(urls(MANDATORY.concat(OPTIONAL)), function (theme, prop) {
+ theme[prop] = Math.random().toString();
}, function (after, prop, before) {
do_check_eq(after[prop], "https://lwttest.invalid/" + before[prop]);
}, true);
- roundtripSet(urls(MANDATORY.concat(OPTIONAL)), function (data, prop) {
- data[prop] = "https://sub.lwttest.invalid/" + Math.random().toString();
+ roundtripSet(urls(MANDATORY.concat(OPTIONAL)), function (theme, prop) {
+ theme[prop] = "https://sub.lwttest.invalid/" + Math.random().toString();
}, function (after, prop, before) {
do_check_eq(after[prop], before[prop]);
});
- roundtripSet(urls(MANDATORY), function (data, prop) {
- data[prop] = "ftp://lwttest.invalid/" + Math.random().toString();
+ roundtripSet(urls(MANDATORY), function (theme, prop) {
+ theme[prop] = "ftp://lwttest.invalid/" + Math.random().toString();
}, function (after) {
do_check_eq(after, null);
});
- roundtripSet(urls(OPTIONAL), function (data, prop) {
- data[prop] = "ftp://lwttest.invalid/" + Math.random().toString();
+ roundtripSet(urls(OPTIONAL), function (theme, prop) {
+ theme[prop] = "ftp://lwttest.invalid/" + Math.random().toString();
}, function (after, prop) {
do_check_eq(typeof after[prop], "undefined");
});
do_check_eq(ltm.usedThemes.length, 0);
do_check_eq(ltm.currentTheme, null);
data = dummy();
@@ -541,42 +541,42 @@ function run_test() {
ltm.addBuiltInTheme(dummy("builtInTheme0"));
ltm.addBuiltInTheme(dummy("builtInTheme1"));
do_check_eq([...ltm._builtInThemes].length, 2);
do_check_eq(ltm.usedThemes.length, 2);
do_test_pending();
- AddonManager.getAddonByID("builtInTheme0@personas.mozilla.org", aAddon => {
+ AddonManager.getAddonByID("builtInTheme0@personas.mozilla.org", builtInThemeAddon => {
// App specific theme can't be uninstalled or disabled,
// but can be enabled (since it isn't already applied).
- do_check_eq(hasPermission(aAddon, "uninstall"), false);
- do_check_eq(hasPermission(aAddon, "disable"), false);
- do_check_eq(hasPermission(aAddon, "enable"), true);
+ do_check_eq(hasPermission(builtInThemeAddon, "uninstall"), false);
+ do_check_eq(hasPermission(builtInThemeAddon, "disable"), false);
+ do_check_eq(hasPermission(builtInThemeAddon, "enable"), true);
ltm.currentTheme = dummy("x0");
do_check_eq([...ltm._builtInThemes].length, 2);
do_check_eq(ltm.usedThemes.length, 3);
do_check_eq(ltm.usedThemes[0].id, "x0");
do_check_eq(ltm.currentTheme.id, "x0");
do_check_eq(ltm.usedThemes[1].id, "builtInTheme0");
do_check_eq(ltm.usedThemes[2].id, "builtInTheme1");
Assert.throws(() => { ltm.addBuiltInTheme(dummy("builtInTheme0")) },
"Exception is thrown adding a duplicate theme");
Assert.throws(() => { ltm.addBuiltInTheme("not a theme object") },
"Exception is thrown adding an invalid theme");
- AddonManager.getAddonByID("x0@personas.mozilla.org", aAddon => {
+ AddonManager.getAddonByID("x0@personas.mozilla.org", x0Addon => {
// Currently applied (non-app-specific) can be uninstalled or disabled,
// but can't be enabled (since it's already applied).
- do_check_eq(hasPermission(aAddon, "uninstall"), true);
- do_check_eq(hasPermission(aAddon, "disable"), true);
- do_check_eq(hasPermission(aAddon, "enable"), false);
+ do_check_eq(hasPermission(x0Addon, "uninstall"), true);
+ do_check_eq(hasPermission(x0Addon, "disable"), true);
+ do_check_eq(hasPermission(x0Addon, "enable"), false);
ltm.forgetUsedTheme("x0");
do_check_eq(ltm.currentTheme, null);
// Removing the currently applied app specific theme should unapply it
ltm.currentTheme = ltm.getUsedTheme("builtInTheme0");
do_check_eq(ltm.currentTheme.id, "builtInTheme0");
do_check_true(ltm.forgetBuiltInTheme("builtInTheme0"));
--- a/toolkit/mozapps/extensions/test/xpcshell/test_bootstrap.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_bootstrap.js
@@ -805,26 +805,26 @@ function check_test_15() {
do_check_true(b1.userDisabled);
do_check_false(b1.isActive);
BootstrapMonitor.checkAddonInstalled(ID1, "2.0");
BootstrapMonitor.checkAddonNotStarted(ID1);
do_check_bootstrappedPref(function() {
restartManager();
- AddonManager.getAddonByID(ID1, callback_soon(function(b1) {
- do_check_neq(b1, null);
- do_check_eq(b1.version, "2.0");
- do_check_false(b1.appDisabled);
- do_check_true(b1.userDisabled);
- do_check_false(b1.isActive);
+ AddonManager.getAddonByID(ID1, callback_soon(function(b1_2) {
+ do_check_neq(b1_2, null);
+ do_check_eq(b1_2.version, "2.0");
+ do_check_false(b1_2.appDisabled);
+ do_check_true(b1_2.userDisabled);
+ do_check_false(b1_2.isActive);
BootstrapMonitor.checkAddonInstalled(ID1, "2.0");
BootstrapMonitor.checkAddonNotStarted(ID1);
- b1.uninstall();
+ b1_2.uninstall();
run_test_16();
}));
});
});
}
// Tests that bootstrapped extensions don't get loaded when in safe mode
@@ -844,35 +844,35 @@ function run_test_16() {
// Should have stopped
BootstrapMonitor.checkAddonInstalled(ID1, "1.0");
BootstrapMonitor.checkAddonNotStarted(ID1);
gAppInfo.inSafeMode = true;
startupManager(false);
- AddonManager.getAddonByID(ID1, callback_soon(function(b1) {
+ AddonManager.getAddonByID(ID1, callback_soon(function(b1_2) {
// Should still be stopped
BootstrapMonitor.checkAddonInstalled(ID1, "1.0");
BootstrapMonitor.checkAddonNotStarted(ID1);
- do_check_false(b1.isActive);
- do_check_eq(b1.iconURL, null);
- do_check_eq(b1.aboutURL, null);
- do_check_eq(b1.optionsURL, null);
+ do_check_false(b1_2.isActive);
+ do_check_eq(b1_2.iconURL, null);
+ do_check_eq(b1_2.aboutURL, null);
+ do_check_eq(b1_2.optionsURL, null);
shutdownManager();
gAppInfo.inSafeMode = false;
startupManager(false);
// Should have started
BootstrapMonitor.checkAddonInstalled(ID1, "1.0");
BootstrapMonitor.checkAddonStarted(ID1, "1.0");
- AddonManager.getAddonByID(ID1, function(b1) {
- b1.uninstall();
+ AddonManager.getAddonByID(ID1, function(b1_3) {
+ b1_3.uninstall();
do_execute_soon(run_test_17);
});
}));
}));
});
installAllFiles([do_get_addon("test_bootstrap1_1")], function() { });
}
@@ -1075,37 +1075,37 @@ function run_test_22() {
manuallyUninstall(profileDir, ID1);
BootstrapMonitor.clear(ID1);
manuallyInstall(do_get_addon("test_bootstrap1_2"), profileDir,
ID1);
startupManager();
- AddonManager.getAddonByID(ID1, function(b1) {
+ AddonManager.getAddonByID(ID1, function(b1_2) {
// Should have installed and started
BootstrapMonitor.checkAddonInstalled(ID1, "2.0");
BootstrapMonitor.checkAddonStarted(ID1, "2.0");
- do_check_neq(b1, null);
- do_check_eq(b1.version, "2.0");
- do_check_true(b1.isActive);
- do_check_false(b1.isSystem);
+ do_check_neq(b1_2, null);
+ do_check_eq(b1_2.version, "2.0");
+ do_check_true(b1_2.isActive);
+ do_check_false(b1_2.isSystem);
// This won't be set as the bootstrap script was gone so we couldn't
// uninstall it properly
do_check_eq(getUninstallReason(), undefined);
do_check_eq(getUninstallNewVersion(), undefined);
do_check_eq(getInstallReason(), ADDON_UPGRADE);
do_check_eq(getInstallOldVersion(), 1);
do_check_eq(getStartupReason(), APP_STARTUP);
do_check_eq(getStartupOldVersion(), undefined);
do_check_bootstrappedPref(function() {
- b1.uninstall();
+ b1_2.uninstall();
run_test_23();
});
});
}));
}
@@ -1179,18 +1179,18 @@ function check_test_23() {
let dir = do_get_addon_root_uri(profileDir, ID1);
do_check_eq(b1.getResourceURI("bootstrap.js").spec, dir + "bootstrap.js");
AddonManager.getAddonsWithOperationsByTypes(null, callback_soon(function(list) {
do_check_eq(list.length, 0);
restartManager();
- AddonManager.getAddonByID(ID1, callback_soon(function(b1) {
- b1.uninstall();
+ AddonManager.getAddonByID(ID1, callback_soon(function(b1_2) {
+ b1_2.uninstall();
restartManager();
testserver.stop(run_test_24);
}));
}));
});
});
});
@@ -1261,22 +1261,22 @@ function run_test_25() {
restartManager();
BootstrapMonitor.checkAddonNotInstalled(ID1);
do_check_eq(getUninstallReason(), ADDON_UPGRADE);
do_check_eq(getUninstallNewVersion(), 4);
BootstrapMonitor.checkAddonNotStarted(ID1);
- AddonManager.getAddonByID(ID1, function(b1) {
- do_check_neq(b1, null);
- do_check_eq(b1.version, "4.0");
- do_check_true(b1.isActive);
- do_check_false(b1.isSystem);
- do_check_eq(b1.pendingOperations, AddonManager.PENDING_NONE);
+ AddonManager.getAddonByID(ID1, function(b1_2) {
+ do_check_neq(b1_2, null);
+ do_check_eq(b1_2.version, "4.0");
+ do_check_true(b1_2.isActive);
+ do_check_false(b1_2.isSystem);
+ do_check_eq(b1_2.pendingOperations, AddonManager.PENDING_NONE);
do_check_bootstrappedPref(run_test_26);
});
}));
});
});
installAllFiles([do_get_addon("test_bootstrap1_1")], function test_25_installed() {
do_print("test 25 install done");
@@ -1300,22 +1300,22 @@ function run_test_26() {
restartManager();
BootstrapMonitor.checkAddonInstalled(ID1, "1.0");
do_check_eq(getInstallReason(), ADDON_DOWNGRADE);
do_check_eq(getInstallOldVersion(), 4);
BootstrapMonitor.checkAddonStarted(ID1, "1.0");
- AddonManager.getAddonByID(ID1, function(b1) {
- do_check_neq(b1, null);
- do_check_eq(b1.version, "1.0");
- do_check_true(b1.isActive);
- do_check_false(b1.isSystem);
- do_check_eq(b1.pendingOperations, AddonManager.PENDING_NONE);
+ AddonManager.getAddonByID(ID1, function(b1_2) {
+ do_check_neq(b1_2, null);
+ do_check_eq(b1_2.version, "1.0");
+ do_check_true(b1_2.isActive);
+ do_check_false(b1_2.isSystem);
+ do_check_eq(b1_2.pendingOperations, AddonManager.PENDING_NONE);
do_check_bootstrappedPref(run_test_27);
});
}));
});
}
// Tests that updating from a bootstrappable add-on to a normal add-on while
@@ -1332,32 +1332,32 @@ function run_test_27() {
installAllFiles([do_get_addon("test_bootstrap1_4")], function() {
// Updating disabled things happens immediately
BootstrapMonitor.checkAddonNotInstalled(ID1);
do_check_eq(getUninstallReason(), ADDON_UPGRADE);
do_check_eq(getUninstallNewVersion(), 4);
BootstrapMonitor.checkAddonNotStarted(ID1);
- AddonManager.getAddonByID(ID1, callback_soon(function(b1) {
- do_check_neq(b1, null);
- do_check_eq(b1.version, "4.0");
- do_check_false(b1.isActive);
- do_check_eq(b1.pendingOperations, AddonManager.PENDING_NONE);
+ AddonManager.getAddonByID(ID1, callback_soon(function(b1_2) {
+ do_check_neq(b1_2, null);
+ do_check_eq(b1_2.version, "4.0");
+ do_check_false(b1_2.isActive);
+ do_check_eq(b1_2.pendingOperations, AddonManager.PENDING_NONE);
restartManager();
BootstrapMonitor.checkAddonNotInstalled(ID1);
BootstrapMonitor.checkAddonNotStarted(ID1);
- AddonManager.getAddonByID(ID1, function(b1) {
- do_check_neq(b1, null);
- do_check_eq(b1.version, "4.0");
- do_check_false(b1.isActive);
- do_check_eq(b1.pendingOperations, AddonManager.PENDING_NONE);
+ AddonManager.getAddonByID(ID1, function(b1_3) {
+ do_check_neq(b1_3, null);
+ do_check_eq(b1_3.version, "4.0");
+ do_check_false(b1_3.isActive);
+ do_check_eq(b1_3.pendingOperations, AddonManager.PENDING_NONE);
do_check_bootstrappedPref(run_test_28);
});
}));
});
});
}
@@ -1379,24 +1379,24 @@ function run_test_28() {
do_check_true(b1.userDisabled);
do_check_eq(b1.pendingOperations, AddonManager.PENDING_NONE);
restartManager();
BootstrapMonitor.checkAddonInstalled(ID1, "1.0");
BootstrapMonitor.checkAddonNotStarted(ID1);
- AddonManager.getAddonByID(ID1, function(b1) {
- do_check_neq(b1, null);
- do_check_true(b1.userDisabled);
- b1.userDisabled = false;
- do_check_eq(b1.version, "1.0");
- do_check_true(b1.isActive);
- do_check_false(b1.isSystem);
- do_check_eq(b1.pendingOperations, AddonManager.PENDING_NONE);
+ AddonManager.getAddonByID(ID1, function(b1_2) {
+ do_check_neq(b1_2, null);
+ do_check_true(b1_2.userDisabled);
+ b1_2.userDisabled = false;
+ do_check_eq(b1_2.version, "1.0");
+ do_check_true(b1_2.isActive);
+ do_check_false(b1_2.isSystem);
+ do_check_eq(b1_2.pendingOperations, AddonManager.PENDING_NONE);
BootstrapMonitor.checkAddonInstalled(ID1, "1.0");
BootstrapMonitor.checkAddonStarted(ID1, "1.0");
do_check_bootstrappedPref(do_test_finished);
});
}));
});
});
--- a/toolkit/mozapps/extensions/test/xpcshell/test_bug324121.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_bug324121.js
@@ -133,19 +133,19 @@ function run_test() {
testserver = new HttpServer();
testserver.registerDirectory("/data/", dataDir);
testserver.start(4444);
startupManager();
installAllFiles(ADDONS.map(a => do_get_addon(a.addon)), function() {
restartManager();
- AddonManager.getAddonByID(ADDONS[0].id, callback_soon(function(addon) {
- do_check_true(!(!addon));
- addon.userDisabled = true;
+ AddonManager.getAddonByID(ADDONS[0].id, callback_soon(function(firstAddon) {
+ do_check_true(firstAddon);
+ firstAddon.userDisabled = true;
restartManager();
AddonManager.getAddonsByTypes(["extension"], function(installedItems) {
var items = [];
for (let addon of ADDONS) {
for (let installedItem of installedItems) {
if (addon.id != installedItem.id)
--- a/toolkit/mozapps/extensions/test/xpcshell/test_bug371495.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_bug371495.js
@@ -18,18 +18,18 @@ function run_test()
// Install test add-on
startupManager();
installAllFiles([do_get_addon(ADDON)], function() {
AddonManager.getAddonByID(ID, callback_soon(function(addon) {
do_check_neq(addon, null);
do_check_eq(addon.name, "Test theme");
restartManager();
- AddonManager.getAddonByID(ID, callback_soon(function(addon) {
- do_check_neq(addon, null);
- do_check_eq(addon.optionsURL, null);
- do_check_eq(addon.aboutURL, null);
+ AddonManager.getAddonByID(ID, callback_soon(function(addon2) {
+ do_check_neq(addon2, null);
+ do_check_eq(addon2.optionsURL, null);
+ do_check_eq(addon2.aboutURL, null);
do_execute_soon(do_test_finished);
}));
}));
});
}
--- a/toolkit/mozapps/extensions/test/xpcshell/test_bug563256.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_bug563256.js
@@ -231,29 +231,29 @@ function check_test_2() {
do_check_eq(Services.prefs.getCharPref(PREF_GENERAL_SKINS_SELECTEDSKIN), "alternate/1.0");
restartManager();
do_check_eq(Services.prefs.getCharPref(PREF_GENERAL_SKINS_SELECTEDSKIN), "classic/1.0");
AddonManager.getAddonsByIDs(["default@tests.mozilla.org",
- "alternate@tests.mozilla.org"], function([d, a]) {
- do_check_neq(d, null);
- do_check_false(d.userDisabled);
- do_check_false(d.appDisabled);
- do_check_true(d.isActive);
- do_check_true(isThemeInAddonsList(profileDir, d.id));
- do_check_false(hasFlag(d.permissions, AddonManager.PERM_CAN_DISABLE));
- do_check_false(hasFlag(d.permissions, AddonManager.PERM_CAN_ENABLE));
+ "alternate@tests.mozilla.org"], function([d2, a2]) {
+ do_check_neq(d2, null);
+ do_check_false(d2.userDisabled);
+ do_check_false(d2.appDisabled);
+ do_check_true(d2.isActive);
+ do_check_true(isThemeInAddonsList(profileDir, d2.id));
+ do_check_false(hasFlag(d2.permissions, AddonManager.PERM_CAN_DISABLE));
+ do_check_false(hasFlag(d2.permissions, AddonManager.PERM_CAN_ENABLE));
- do_check_neq(a, null);
- do_check_true(a.userDisabled);
- do_check_false(a.appDisabled);
- do_check_false(a.isActive);
- do_check_false(isThemeInAddonsList(profileDir, a.id));
- do_check_false(hasFlag(a.permissions, AddonManager.PERM_CAN_DISABLE));
- do_check_true(hasFlag(a.permissions, AddonManager.PERM_CAN_ENABLE));
+ do_check_neq(a2, null);
+ do_check_true(a2.userDisabled);
+ do_check_false(a2.appDisabled);
+ do_check_false(a2.isActive);
+ do_check_false(isThemeInAddonsList(profileDir, a2.id));
+ do_check_false(hasFlag(a2.permissions, AddonManager.PERM_CAN_DISABLE));
+ do_check_true(hasFlag(a2.permissions, AddonManager.PERM_CAN_ENABLE));
end_test();
});
}));
}
--- a/toolkit/mozapps/extensions/test/xpcshell/test_bug564030.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_bug564030.js
@@ -44,20 +44,20 @@ function run_test() {
id: "xpcshell@tests.mozilla.org",
minVersion: "1",
maxVersion: "2"
}]
}, profileDir);
restartManager();
- AddonManager.getAddonByID("addon1@tests.mozilla.org", function(a) {
- do_check_neq(a, null);
- do_check_eq(a.version, "2.0");
- do_check_false(a.userDisabled);
- do_check_false(a.appDisabled);
- do_check_true(a.isActive);
- do_check_true(isExtensionInAddonsList(profileDir, a.id));
+ AddonManager.getAddonByID("addon1@tests.mozilla.org", function(a2) {
+ do_check_neq(a2, null);
+ do_check_eq(a2.version, "2.0");
+ do_check_false(a2.userDisabled);
+ do_check_false(a2.appDisabled);
+ do_check_true(a2.isActive);
+ do_check_true(isExtensionInAddonsList(profileDir, a2.id));
do_execute_soon(do_test_finished);
});
}));
}
--- a/toolkit/mozapps/extensions/test/xpcshell/test_bug576735.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_bug576735.js
@@ -48,19 +48,19 @@ function run_test() {
dest.remove(true);
writeInstallRDFForExtension(addon2, profileDir);
startupManager();
AddonManager.getAddonsByIDs(["addon1@tests.mozilla.org",
"addon2@tests.mozilla.org"],
- function([a1, a2]) {
+ function([a1_2, a2_2]) {
// Addon1 should no longer be installed
- do_check_eq(a1, null);
+ do_check_eq(a1_2, null);
// Addon2 should have been detected
- do_check_neq(a2, null);
+ do_check_neq(a2_2, null);
do_execute_soon(do_test_finished);
});
}));
}
--- a/toolkit/mozapps/extensions/test/xpcshell/test_bug587088.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_bug587088.js
@@ -91,32 +91,32 @@ function run_test_1() {
fstream.init(uri.QueryInterface(AM_Ci.nsIFileURL).file, -1, 0, 0);
installAllFiles([do_get_addon("test_bug587088_2")], function() {
check_addon_upgrading(a1);
restartManager();
- AddonManager.getAddonByID("addon1@tests.mozilla.org", callback_soon(function(a1) {
- check_addon_upgrading(a1);
+ AddonManager.getAddonByID("addon1@tests.mozilla.org", callback_soon(function(a1_2) {
+ check_addon_upgrading(a1_2);
restartManager();
- AddonManager.getAddonByID("addon1@tests.mozilla.org", callback_soon(function(a1) {
- check_addon_upgrading(a1);
+ AddonManager.getAddonByID("addon1@tests.mozilla.org", callback_soon(function(a1_3) {
+ check_addon_upgrading(a1_3);
fstream.close();
restartManager();
- AddonManager.getAddonByID("addon1@tests.mozilla.org", function(a1) {
- check_addon(a1, "2.0");
+ AddonManager.getAddonByID("addon1@tests.mozilla.org", function(a1_4) {
+ check_addon(a1_4, "2.0");
- a1.uninstall();
+ a1_4.uninstall();
do_execute_soon(run_test_2);
});
}));
}));
});
});
});
}
@@ -141,30 +141,30 @@ function run_test_2() {
fstream.init(uri.QueryInterface(AM_Ci.nsIFileURL).file, -1, 0, 0);
a1.uninstall();
check_addon_uninstalling(a1);
restartManager();
- AddonManager.getAddonByID("addon1@tests.mozilla.org", callback_soon(function(a1) {
- check_addon_uninstalling(a1, true);
+ AddonManager.getAddonByID("addon1@tests.mozilla.org", callback_soon(function(a1_2) {
+ check_addon_uninstalling(a1_2, true);
restartManager();
- AddonManager.getAddonByID("addon1@tests.mozilla.org", callback_soon(function(a1) {
- check_addon_uninstalling(a1, true);
+ AddonManager.getAddonByID("addon1@tests.mozilla.org", callback_soon(function(a1_3) {
+ check_addon_uninstalling(a1_3, true);
fstream.close();
restartManager();
- AddonManager.getAddonByID("addon1@tests.mozilla.org", function(a1) {
- do_check_eq(a1, null);
+ AddonManager.getAddonByID("addon1@tests.mozilla.org", function(a1_4) {
+ do_check_eq(a1_4, null);
var dir = profileDir.clone();
dir.append(do_get_expected_addon_name("addon1@tests.mozilla.org"));
do_check_false(dir.exists());
do_check_false(isExtensionInAddonsList(profileDir, "addon1@tests.mozilla.org"));
do_execute_soon(do_test_finished);
});
}));
--- a/toolkit/mozapps/extensions/test/xpcshell/test_bug655254.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_bug655254.js
@@ -79,45 +79,45 @@ function run_test_1() {
do_check_true(a2.isActive);
do_check_false(isExtensionInAddonsList(userDir, a2.id));
do_check_eq(Services.prefs.getIntPref("bootstraptest.active_version"), 1);
a1.findUpdates({
onUpdateFinished: function() {
restartManager();
- AddonManager.getAddonByID("addon1@tests.mozilla.org", callback_soon(function(a1) {
- do_check_neq(a1, null);
- do_check_false(a1.appDisabled);
- do_check_true(a1.isActive);
- do_check_true(isExtensionInAddonsList(userDir, a1.id));
+ AddonManager.getAddonByID("addon1@tests.mozilla.org", callback_soon(function(a1_2) {
+ do_check_neq(a1_2, null);
+ do_check_false(a1_2.appDisabled);
+ do_check_true(a1_2.isActive);
+ do_check_true(isExtensionInAddonsList(userDir, a1_2.id));
shutdownManager();
do_check_eq(Services.prefs.getIntPref("bootstraptest.active_version"), 0);
userDir.parent.moveTo(gProfD, "extensions3");
userDir = gProfD.clone();
userDir.append("extensions3");
userDir.append(gAppInfo.ID);
do_check_true(userDir.exists());
startupManager(false);
AddonManager.getAddonsByIDs(["addon1@tests.mozilla.org",
- "addon2@tests.mozilla.org"], function([a1, a2]) {
- do_check_neq(a1, null);
- do_check_false(a1.appDisabled);
- do_check_true(a1.isActive);
- do_check_true(isExtensionInAddonsList(userDir, a1.id));
+ "addon2@tests.mozilla.org"], function([a1_3, a2_3]) {
+ do_check_neq(a1_3, null);
+ do_check_false(a1_3.appDisabled);
+ do_check_true(a1_3.isActive);
+ do_check_true(isExtensionInAddonsList(userDir, a1_3.id));
- do_check_neq(a2, null);
- do_check_false(a2.appDisabled);
- do_check_true(a2.isActive);
- do_check_false(isExtensionInAddonsList(userDir, a2.id));
+ do_check_neq(a2_3, null);
+ do_check_false(a2_3.appDisabled);
+ do_check_true(a2_3.isActive);
+ do_check_false(isExtensionInAddonsList(userDir, a2_3.id));
do_check_eq(Services.prefs.getIntPref("bootstraptest.active_version"), 1);
do_execute_soon(run_test_2);
});
}));
}
}, AddonManager.UPDATE_WHEN_USER_REQUESTED);
});
@@ -141,24 +141,24 @@ function run_test_2() {
userDir = gProfD.clone();
userDir.append("extensions4");
userDir.append(gAppInfo.ID);
do_check_true(userDir.exists());
startupManager(false);
AddonManager.getAddonsByIDs(["addon1@tests.mozilla.org",
- "addon2@tests.mozilla.org"], function([a1, a2]) {
- do_check_neq(a1, null);
- do_check_false(a1.appDisabled);
- do_check_true(a1.isActive);
- do_check_true(isExtensionInAddonsList(userDir, a1.id));
+ "addon2@tests.mozilla.org"], function([a1_2, a2_2]) {
+ do_check_neq(a1_2, null);
+ do_check_false(a1_2.appDisabled);
+ do_check_true(a1_2.isActive);
+ do_check_true(isExtensionInAddonsList(userDir, a1_2.id));
- do_check_neq(a2, null);
- do_check_true(a2.userDisabled);
- do_check_false(a2.isActive);
- do_check_false(isExtensionInAddonsList(userDir, a2.id));
+ do_check_neq(a2_2, null);
+ do_check_true(a2_2.userDisabled);
+ do_check_false(a2_2.isActive);
+ do_check_false(isExtensionInAddonsList(userDir, a2_2.id));
do_check_eq(Services.prefs.getIntPref("bootstraptest.active_version"), 0);
end_test();
});
}));
}
--- a/toolkit/mozapps/extensions/test/xpcshell/test_bug659772.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_bug659772.js
@@ -143,55 +143,55 @@ function run_test_1() {
Services.prefs.clearUserPref("bootstraptest.uninstall_reason");
startupManager(false);
AddonManager.getAddonsByIDs(["addon1@tests.mozilla.org",
"addon2@tests.mozilla.org",
"addon3@tests.mozilla.org",
"addon4@tests.mozilla.org"],
- function([a1, a2, a3, a4]) {
- do_check_neq(a1, null);
- do_check_eq(a1.version, "2.0");
- do_check_false(a1.appDisabled);
- do_check_false(a1.userDisabled);
- do_check_true(a1.isActive);
+ function([a1_2, a2_2, a3_2, a4_2]) {
+ do_check_neq(a1_2, null);
+ do_check_eq(a1_2.version, "2.0");
+ do_check_false(a1_2.appDisabled);
+ do_check_false(a1_2.userDisabled);
+ do_check_true(a1_2.isActive);
do_check_true(isExtensionInAddonsList(profileDir, addon1.id));
- do_check_neq(a2, null);
- do_check_eq(a2.version, "2.0");
- do_check_false(a2.appDisabled);
- do_check_false(a2.userDisabled);
- do_check_true(a2.isActive);
+ do_check_neq(a2_2, null);
+ do_check_eq(a2_2.version, "2.0");
+ do_check_false(a2_2.appDisabled);
+ do_check_false(a2_2.userDisabled);
+ do_check_true(a2_2.isActive);
do_check_true(isExtensionInAddonsList(profileDir, addon2.id));
// Should stay enabled because we migrate the compat info from
// the previous version of the DB
- do_check_neq(a3, null);
- do_check_eq(a3.version, "2.0");
- todo_check_false(a3.appDisabled); // XXX unresolved issue
- do_check_false(a3.userDisabled);
- todo_check_true(a3.isActive); // XXX same
+ do_check_neq(a3_2, null);
+ do_check_eq(a3_2.version, "2.0");
+ todo_check_false(a3_2.appDisabled); // XXX unresolved issue
+ do_check_false(a3_2.userDisabled);
+ todo_check_true(a3_2.isActive); // XXX same
todo_check_true(isExtensionInAddonsList(profileDir, addon3.id)); // XXX same
- do_check_neq(a4, null);
- do_check_eq(a4.version, "2.0");
- do_check_true(a4.appDisabled);
- do_check_false(a4.userDisabled);
- do_check_false(a4.isActive);
+ do_check_neq(a4_2, null);
+ do_check_eq(a4_2.version, "2.0");
+ do_check_true(a4_2.appDisabled);
+ do_check_false(a4_2.userDisabled);
+ do_check_false(a4_2.isActive);
do_check_false(isExtensionInAddonsList(profileDir, addon4.id));
// Check that install and uninstall haven't been called on the bootstrapped addon
do_check_false(Services.prefs.prefHasUserValue("bootstraptest.install_reason"));
do_check_false(Services.prefs.prefHasUserValue("bootstraptest.uninstall_reason"));
- a1.uninstall();
- a2.uninstall();
- a3.uninstall();
- a4.uninstall();
+ a1_2.uninstall();
+ a2_2.uninstall();
+ a3_2.uninstall();
+ a4_2.uninstall();
do_execute_soon(run_test_2);
});
});
});
}
// Tests whether a schema migration with app version change works
function run_test_2() {
@@ -285,55 +285,55 @@ function run_test_2() {
gAppInfo.version = "2";
startupManager(true);
AddonManager.getAddonsByIDs(["addon1@tests.mozilla.org",
"addon2@tests.mozilla.org",
"addon3@tests.mozilla.org",
"addon4@tests.mozilla.org"],
- callback_soon(function([a1, a2, a3, a4]) {
- do_check_neq(a1, null);
- do_check_eq(a1.version, "2.0");
- do_check_true(a1.appDisabled);
- do_check_false(a1.userDisabled);
- do_check_false(a1.isActive);
+ callback_soon(function([a1_2, a2_2, a3_2, a4_2]) {
+ do_check_neq(a1_2, null);
+ do_check_eq(a1_2.version, "2.0");
+ do_check_true(a1_2.appDisabled);
+ do_check_false(a1_2.userDisabled);
+ do_check_false(a1_2.isActive);
do_check_false(isExtensionInAddonsList(profileDir, addon1.id));
- do_check_neq(a2, null);
- do_check_eq(a2.version, "2.0");
- do_check_false(a2.appDisabled);
- do_check_false(a2.userDisabled);
- do_check_true(a2.isActive);
+ do_check_neq(a2_2, null);
+ do_check_eq(a2_2.version, "2.0");
+ do_check_false(a2_2.appDisabled);
+ do_check_false(a2_2.userDisabled);
+ do_check_true(a2_2.isActive);
do_check_true(isExtensionInAddonsList(profileDir, addon2.id));
// Should become appDisabled because we migrate the compat info from
// the previous version of the DB
- do_check_neq(a3, null);
- do_check_eq(a3.version, "2.0");
- todo_check_true(a3.appDisabled);
- do_check_false(a3.userDisabled);
- todo_check_false(a3.isActive);
+ do_check_neq(a3_2, null);
+ do_check_eq(a3_2.version, "2.0");
+ todo_check_true(a3_2.appDisabled);
+ do_check_false(a3_2.userDisabled);
+ todo_check_false(a3_2.isActive);
todo_check_false(isExtensionInAddonsList(profileDir, addon3.id));
- do_check_neq(a4, null);
- do_check_eq(a4.version, "2.0");
- do_check_false(a4.appDisabled);
- do_check_false(a4.userDisabled);
- do_check_true(a4.isActive);
+ do_check_neq(a4_2, null);
+ do_check_eq(a4_2.version, "2.0");
+ do_check_false(a4_2.appDisabled);
+ do_check_false(a4_2.userDisabled);
+ do_check_true(a4_2.isActive);
do_check_true(isExtensionInAddonsList(profileDir, addon4.id));
// Check that install and uninstall haven't been called on the bootstrapped addon
do_check_false(Services.prefs.prefHasUserValue("bootstraptest.install_reason"));
do_check_false(Services.prefs.prefHasUserValue("bootstraptest.uninstall_reason"));
- a1.uninstall();
- a2.uninstall();
- a3.uninstall();
- a4.uninstall();
+ a1_2.uninstall();
+ a2_2.uninstall();
+ a3_2.uninstall();
+ a4_2.uninstall();
restartManager();
shutdownManager();
do_test_finished();
}));
}
});
--- a/toolkit/mozapps/extensions/test/xpcshell/test_cacheflush.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_cacheflush.js
@@ -83,25 +83,25 @@ function run_test_2() {
});
});
}
// Tests that the cache is flushed when installing a restartless add-on
function run_test_3() {
AddonManager.getInstallForFile(do_get_addon("test_cacheflush2"), function(aInstall) {
aInstall.addListener({
- onInstallStarted: function(aInstall) {
+ onInstallStarted: function() {
// We should flush the staged XPI when completing the install
gExpectedFile = gProfD.clone();
gExpectedFile.append("extensions");
gExpectedFile.append("staged");
gExpectedFile.append("addon2@tests.mozilla.org.xpi");
},
- onInstallEnded: function(aInstall) {
+ onInstallEnded: function() {
do_check_eq(gCacheFlushCount, 1);
gExpectedFile = null;
gCacheFlushCount = 0;
do_execute_soon(run_test_4);
}
});
--- a/toolkit/mozapps/extensions/test/xpcshell/test_corrupt.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_corrupt.js
@@ -260,147 +260,147 @@ function run_test_1() {
"addon2@tests.mozilla.org",
"addon3@tests.mozilla.org",
"addon4@tests.mozilla.org",
"addon5@tests.mozilla.org",
"addon6@tests.mozilla.org",
"addon7@tests.mozilla.org",
"theme1@tests.mozilla.org",
"theme2@tests.mozilla.org"],
- callback_soon(function([a1, a2, a3, a4, a5, a6, a7, t1, t2]) {
+ callback_soon(function([a1_2, a2_2, a3_2, a4_2, a5_2, a6_2, a7_2, t1_2, t2_2]) {
// Should be correctly recovered
- do_check_neq(a1, null);
- do_check_true(a1.isActive);
- do_check_false(a1.userDisabled);
- do_check_false(a1.appDisabled);
- do_check_eq(a1.pendingOperations, AddonManager.PENDING_NONE);
+ do_check_neq(a1_2, null);
+ do_check_true(a1_2.isActive);
+ do_check_false(a1_2.userDisabled);
+ do_check_false(a1_2.appDisabled);
+ do_check_eq(a1_2.pendingOperations, AddonManager.PENDING_NONE);
// Should be correctly recovered
- do_check_neq(a2, null);
- do_check_false(a2.isActive);
- do_check_true(a2.userDisabled);
- do_check_false(a2.appDisabled);
- do_check_eq(a2.pendingOperations, AddonManager.PENDING_NONE);
+ do_check_neq(a2_2, null);
+ do_check_false(a2_2.isActive);
+ do_check_true(a2_2.userDisabled);
+ do_check_false(a2_2.appDisabled);
+ do_check_eq(a2_2.pendingOperations, AddonManager.PENDING_NONE);
// The compatibility update won't be recovered but it should still be
// active for this session
- do_check_neq(a3, null);
- do_check_true(a3.isActive);
- do_check_false(a3.userDisabled);
- do_check_false(a3.appDisabled);
- do_check_eq(a3.pendingOperations, AddonManager.PENDING_NONE);
+ do_check_neq(a3_2, null);
+ do_check_true(a3_2.isActive);
+ do_check_false(a3_2.userDisabled);
+ do_check_false(a3_2.appDisabled);
+ do_check_eq(a3_2.pendingOperations, AddonManager.PENDING_NONE);
// The compatibility update won't be recovered and with strict
// compatibility it would not have been able to tell that it was
// previously userDisabled. However, without strict compat, it wasn't
// appDisabled, so it knows it must have been userDisabled.
- do_check_neq(a4, null);
- do_check_false(a4.isActive);
- do_check_true(a4.userDisabled);
- do_check_false(a4.appDisabled);
- do_check_eq(a4.pendingOperations, AddonManager.PENDING_NONE);
+ do_check_neq(a4_2, null);
+ do_check_false(a4_2.isActive);
+ do_check_true(a4_2.userDisabled);
+ do_check_false(a4_2.appDisabled);
+ do_check_eq(a4_2.pendingOperations, AddonManager.PENDING_NONE);
- do_check_neq(a5, null);
- do_check_true(a5.isActive);
- do_check_false(a5.userDisabled);
- do_check_false(a5.appDisabled);
- do_check_eq(a5.pendingOperations, AddonManager.PENDING_NONE);
+ do_check_neq(a5_2, null);
+ do_check_true(a5_2.isActive);
+ do_check_false(a5_2.userDisabled);
+ do_check_false(a5_2.appDisabled);
+ do_check_eq(a5_2.pendingOperations, AddonManager.PENDING_NONE);
- do_check_neq(a6, null);
- do_check_true(a6.isActive);
- do_check_false(a6.userDisabled);
- do_check_false(a6.appDisabled);
- do_check_eq(a6.pendingOperations, AddonManager.PENDING_NONE);
+ do_check_neq(a6_2, null);
+ do_check_true(a6_2.isActive);
+ do_check_false(a6_2.userDisabled);
+ do_check_false(a6_2.appDisabled);
+ do_check_eq(a6_2.pendingOperations, AddonManager.PENDING_NONE);
- do_check_neq(a7, null);
- do_check_false(a7.isActive);
- do_check_true(a7.userDisabled);
- do_check_false(a7.appDisabled);
- do_check_eq(a7.pendingOperations, AddonManager.PENDING_NONE);
+ do_check_neq(a7_2, null);
+ do_check_false(a7_2.isActive);
+ do_check_true(a7_2.userDisabled);
+ do_check_false(a7_2.appDisabled);
+ do_check_eq(a7_2.pendingOperations, AddonManager.PENDING_NONE);
// Should be correctly recovered
- do_check_neq(t1, null);
- do_check_false(t1.isActive);
- do_check_true(t1.userDisabled);
- do_check_false(t1.appDisabled);
- do_check_eq(t1.pendingOperations, AddonManager.PENDING_NONE);
+ do_check_neq(t1_2, null);
+ do_check_false(t1_2.isActive);
+ do_check_true(t1_2.userDisabled);
+ do_check_false(t1_2.appDisabled);
+ do_check_eq(t1_2.pendingOperations, AddonManager.PENDING_NONE);
// Should be correctly recovered
- do_check_neq(t2, null);
- do_check_true(t2.isActive);
- do_check_false(t2.userDisabled);
- do_check_false(t2.appDisabled);
- do_check_eq(t2.pendingOperations, AddonManager.PENDING_NONE);
+ do_check_neq(t2_2, null);
+ do_check_true(t2_2.isActive);
+ do_check_false(t2_2.userDisabled);
+ do_check_false(t2_2.appDisabled);
+ do_check_eq(t2_2.pendingOperations, AddonManager.PENDING_NONE);
Assert.throws(shutdownManager);
startupManager(false);
AddonManager.getAddonsByIDs(["addon1@tests.mozilla.org",
"addon2@tests.mozilla.org",
"addon3@tests.mozilla.org",
"addon4@tests.mozilla.org",
"addon5@tests.mozilla.org",
"addon6@tests.mozilla.org",
"addon7@tests.mozilla.org",
"theme1@tests.mozilla.org",
"theme2@tests.mozilla.org"],
- callback_soon(function([a1, a2, a3, a4, a5, a6, a7, t1, t2]) {
- do_check_neq(a1, null);
- do_check_true(a1.isActive);
- do_check_false(a1.userDisabled);
- do_check_false(a1.appDisabled);
- do_check_eq(a1.pendingOperations, AddonManager.PENDING_NONE);
+ callback_soon(function([a1_3, a2_3, a3_3, a4_3, a5_3, a6_3, a7_3, t1_3, t2_3]) {
+ do_check_neq(a1_3, null);
+ do_check_true(a1_3.isActive);
+ do_check_false(a1_3.userDisabled);
+ do_check_false(a1_3.appDisabled);
+ do_check_eq(a1_3.pendingOperations, AddonManager.PENDING_NONE);
- do_check_neq(a2, null);
- do_check_false(a2.isActive);
- do_check_true(a2.userDisabled);
- do_check_false(a2.appDisabled);
- do_check_eq(a2.pendingOperations, AddonManager.PENDING_NONE);
+ do_check_neq(a2_3, null);
+ do_check_false(a2_3.isActive);
+ do_check_true(a2_3.userDisabled);
+ do_check_false(a2_3.appDisabled);
+ do_check_eq(a2_3.pendingOperations, AddonManager.PENDING_NONE);
- do_check_neq(a3, null);
- do_check_true(a3.isActive);
- do_check_false(a3.userDisabled);
- do_check_false(a3.appDisabled);
- do_check_eq(a3.pendingOperations, AddonManager.PENDING_NONE);
+ do_check_neq(a3_3, null);
+ do_check_true(a3_3.isActive);
+ do_check_false(a3_3.userDisabled);
+ do_check_false(a3_3.appDisabled);
+ do_check_eq(a3_3.pendingOperations, AddonManager.PENDING_NONE);
- do_check_neq(a4, null);
- do_check_false(a4.isActive);
- do_check_true(a4.userDisabled);
- do_check_false(a4.appDisabled);
- do_check_eq(a4.pendingOperations, AddonManager.PENDING_NONE);
+ do_check_neq(a4_3, null);
+ do_check_false(a4_3.isActive);
+ do_check_true(a4_3.userDisabled);
+ do_check_false(a4_3.appDisabled);
+ do_check_eq(a4_3.pendingOperations, AddonManager.PENDING_NONE);
- do_check_neq(a5, null);
- do_check_true(a5.isActive);
- do_check_false(a5.userDisabled);
- do_check_false(a5.appDisabled);
- do_check_eq(a5.pendingOperations, AddonManager.PENDING_NONE);
+ do_check_neq(a5_3, null);
+ do_check_true(a5_3.isActive);
+ do_check_false(a5_3.userDisabled);
+ do_check_false(a5_3.appDisabled);
+ do_check_eq(a5_3.pendingOperations, AddonManager.PENDING_NONE);
- do_check_neq(a6, null);
- do_check_true(a6.isActive);
- do_check_false(a6.userDisabled);
- do_check_false(a6.appDisabled);
- do_check_eq(a6.pendingOperations, AddonManager.PENDING_NONE);
+ do_check_neq(a6_3, null);
+ do_check_true(a6_3.isActive);
+ do_check_false(a6_3.userDisabled);
+ do_check_false(a6_3.appDisabled);
+ do_check_eq(a6_3.pendingOperations, AddonManager.PENDING_NONE);
- do_check_neq(a7, null);
- do_check_false(a7.isActive);
- do_check_true(a7.userDisabled);
- do_check_false(a7.appDisabled);
- do_check_eq(a7.pendingOperations, AddonManager.PENDING_NONE);
+ do_check_neq(a7_3, null);
+ do_check_false(a7_3.isActive);
+ do_check_true(a7_3.userDisabled);
+ do_check_false(a7_3.appDisabled);
+ do_check_eq(a7_3.pendingOperations, AddonManager.PENDING_NONE);
- do_check_neq(t1, null);
- do_check_false(t1.isActive);
- do_check_true(t1.userDisabled);
- do_check_false(t1.appDisabled);
- do_check_eq(t1.pendingOperations, AddonManager.PENDING_NONE);
+ do_check_neq(t1_3, null);
+ do_check_false(t1_3.isActive);
+ do_check_true(t1_3.userDisabled);
+ do_check_false(t1_3.appDisabled);
+ do_check_eq(t1_3.pendingOperations, AddonManager.PENDING_NONE);
- do_check_neq(t2, null);
- do_check_true(t2.isActive);
- do_check_false(t2.userDisabled);
- do_check_false(t2.appDisabled);
- do_check_eq(t2.pendingOperations, AddonManager.PENDING_NONE);
+ do_check_neq(t2_3, null);
+ do_check_true(t2_3.isActive);
+ do_check_false(t2_3.userDisabled);
+ do_check_false(t2_3.appDisabled);
+ do_check_eq(t2_3.pendingOperations, AddonManager.PENDING_NONE);
Assert.throws(shutdownManager);
end_test();
}));
}));
}));
}
--- a/toolkit/mozapps/extensions/test/xpcshell/test_corrupt_strictcompat.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_corrupt_strictcompat.js
@@ -261,145 +261,145 @@ function run_test_1() {
"addon2@tests.mozilla.org",
"addon3@tests.mozilla.org",
"addon4@tests.mozilla.org",
"addon5@tests.mozilla.org",
"addon6@tests.mozilla.org",
"addon7@tests.mozilla.org",
"theme1@tests.mozilla.org",
"theme2@tests.mozilla.org"],
- callback_soon(function([a1, a2, a3, a4, a5, a6, a7, t1, t2]) {
+ callback_soon(function([a1_2, a2_2, a3_2, a4_2, a5_2, a6_2, a7_2, t1_2, t2_2]) {
// Should be correctly recovered
- do_check_neq(a1, null);
- do_check_true(a1.isActive);
- do_check_false(a1.userDisabled);
- do_check_false(a1.appDisabled);
- do_check_eq(a1.pendingOperations, AddonManager.PENDING_NONE);
+ do_check_neq(a1_2, null);
+ do_check_true(a1_2.isActive);
+ do_check_false(a1_2.userDisabled);
+ do_check_false(a1_2.appDisabled);
+ do_check_eq(a1_2.pendingOperations, AddonManager.PENDING_NONE);
// Should be correctly recovered
- do_check_neq(a2, null);
- do_check_false(a2.isActive);
- do_check_true(a2.userDisabled);
- do_check_false(a2.appDisabled);
- do_check_eq(a2.pendingOperations, AddonManager.PENDING_NONE);
+ do_check_neq(a2_2, null);
+ do_check_false(a2_2.isActive);
+ do_check_true(a2_2.userDisabled);
+ do_check_false(a2_2.appDisabled);
+ do_check_eq(a2_2.pendingOperations, AddonManager.PENDING_NONE);
// The compatibility update won't be recovered but it should still be
// active for this session
- do_check_neq(a3, null);
- do_check_true(a3.isActive);
- do_check_false(a3.userDisabled);
- do_check_true(a3.appDisabled);
- do_check_eq(a3.pendingOperations, AddonManager.PENDING_DISABLE);
+ do_check_neq(a3_2, null);
+ do_check_true(a3_2.isActive);
+ do_check_false(a3_2.userDisabled);
+ do_check_true(a3_2.appDisabled);
+ do_check_eq(a3_2.pendingOperations, AddonManager.PENDING_DISABLE);
// The compatibility update won't be recovered and it will not have been
// able to tell that it was previously userDisabled
- do_check_neq(a4, null);
- do_check_false(a4.isActive);
- do_check_false(a4.userDisabled);
- do_check_true(a4.appDisabled);
- do_check_eq(a4.pendingOperations, AddonManager.PENDING_NONE);
+ do_check_neq(a4_2, null);
+ do_check_false(a4_2.isActive);
+ do_check_false(a4_2.userDisabled);
+ do_check_true(a4_2.appDisabled);
+ do_check_eq(a4_2.pendingOperations, AddonManager.PENDING_NONE);
- do_check_neq(a5, null);
- do_check_false(a5.isActive);
- do_check_false(a5.userDisabled);
- do_check_true(a5.appDisabled);
- do_check_eq(a5.pendingOperations, AddonManager.PENDING_NONE);
+ do_check_neq(a5_2, null);
+ do_check_false(a5_2.isActive);
+ do_check_false(a5_2.userDisabled);
+ do_check_true(a5_2.appDisabled);
+ do_check_eq(a5_2.pendingOperations, AddonManager.PENDING_NONE);
- do_check_neq(a6, null);
- do_check_true(a6.isActive);
- do_check_false(a6.userDisabled);
- do_check_false(a6.appDisabled);
- do_check_eq(a6.pendingOperations, AddonManager.PENDING_NONE);
+ do_check_neq(a6_2, null);
+ do_check_true(a6_2.isActive);
+ do_check_false(a6_2.userDisabled);
+ do_check_false(a6_2.appDisabled);
+ do_check_eq(a6_2.pendingOperations, AddonManager.PENDING_NONE);
- do_check_neq(a7, null);
- do_check_false(a7.isActive);
- do_check_true(a7.userDisabled);
- do_check_false(a7.appDisabled);
- do_check_eq(a7.pendingOperations, AddonManager.PENDING_NONE);
+ do_check_neq(a7_2, null);
+ do_check_false(a7_2.isActive);
+ do_check_true(a7_2.userDisabled);
+ do_check_false(a7_2.appDisabled);
+ do_check_eq(a7_2.pendingOperations, AddonManager.PENDING_NONE);
// Should be correctly recovered
- do_check_neq(t1, null);
- do_check_false(t1.isActive);
- do_check_true(t1.userDisabled);
- do_check_false(t1.appDisabled);
- do_check_eq(t1.pendingOperations, AddonManager.PENDING_NONE);
+ do_check_neq(t1_2, null);
+ do_check_false(t1_2.isActive);
+ do_check_true(t1_2.userDisabled);
+ do_check_false(t1_2.appDisabled);
+ do_check_eq(t1_2.pendingOperations, AddonManager.PENDING_NONE);
// Should be correctly recovered
- do_check_neq(t2, null);
- do_check_true(t2.isActive);
- do_check_false(t2.userDisabled);
- do_check_false(t2.appDisabled);
- do_check_eq(t2.pendingOperations, AddonManager.PENDING_NONE);
+ do_check_neq(t2_2, null);
+ do_check_true(t2_2.isActive);
+ do_check_false(t2_2.userDisabled);
+ do_check_false(t2_2.appDisabled);
+ do_check_eq(t2_2.pendingOperations, AddonManager.PENDING_NONE);
Assert.throws(shutdownManager);
startupManager(false);
AddonManager.getAddonsByIDs(["addon1@tests.mozilla.org",
"addon2@tests.mozilla.org",
"addon3@tests.mozilla.org",
"addon4@tests.mozilla.org",
"addon5@tests.mozilla.org",
"addon6@tests.mozilla.org",
"addon7@tests.mozilla.org",
"theme1@tests.mozilla.org",
"theme2@tests.mozilla.org"],
- callback_soon(function([a1, a2, a3, a4, a5, a6, a7, t1, t2]) {
- do_check_neq(a1, null);
- do_check_true(a1.isActive);
- do_check_false(a1.userDisabled);
- do_check_false(a1.appDisabled);
- do_check_eq(a1.pendingOperations, AddonManager.PENDING_NONE);
+ callback_soon(function([a1_3, a2_3, a3_3, a4_3, a5_3, a6_3, a7_3, t1_3, t2_3]) {
+ do_check_neq(a1_3, null);
+ do_check_true(a1_3.isActive);
+ do_check_false(a1_3.userDisabled);
+ do_check_false(a1_3.appDisabled);
+ do_check_eq(a1_3.pendingOperations, AddonManager.PENDING_NONE);
- do_check_neq(a2, null);
- do_check_false(a2.isActive);
- do_check_true(a2.userDisabled);
- do_check_false(a2.appDisabled);
- do_check_eq(a2.pendingOperations, AddonManager.PENDING_NONE);
+ do_check_neq(a2_3, null);
+ do_check_false(a2_3.isActive);
+ do_check_true(a2_3.userDisabled);
+ do_check_false(a2_3.appDisabled);
+ do_check_eq(a2_3.pendingOperations, AddonManager.PENDING_NONE);
- do_check_neq(a3, null);
- do_check_false(a3.isActive);
- do_check_false(a3.userDisabled);
- do_check_true(a3.appDisabled);
- do_check_eq(a3.pendingOperations, AddonManager.PENDING_NONE);
+ do_check_neq(a3_3, null);
+ do_check_false(a3_3.isActive);
+ do_check_false(a3_3.userDisabled);
+ do_check_true(a3_3.appDisabled);
+ do_check_eq(a3_3.pendingOperations, AddonManager.PENDING_NONE);
- do_check_neq(a4, null);
- do_check_false(a4.isActive);
- do_check_false(a4.userDisabled);
- do_check_true(a4.appDisabled);
- do_check_eq(a4.pendingOperations, AddonManager.PENDING_NONE);
+ do_check_neq(a4_3, null);
+ do_check_false(a4_3.isActive);
+ do_check_false(a4_3.userDisabled);
+ do_check_true(a4_3.appDisabled);
+ do_check_eq(a4_3.pendingOperations, AddonManager.PENDING_NONE);
- do_check_neq(a5, null);
- do_check_false(a5.isActive);
- do_check_false(a5.userDisabled);
- do_check_true(a5.appDisabled);
- do_check_eq(a5.pendingOperations, AddonManager.PENDING_NONE);
+ do_check_neq(a5_3, null);
+ do_check_false(a5_3.isActive);
+ do_check_false(a5_3.userDisabled);
+ do_check_true(a5_3.appDisabled);
+ do_check_eq(a5_3.pendingOperations, AddonManager.PENDING_NONE);
- do_check_neq(a6, null);
- do_check_true(a6.isActive);
- do_check_false(a6.userDisabled);
- do_check_false(a6.appDisabled);
- do_check_eq(a6.pendingOperations, AddonManager.PENDING_NONE);
+ do_check_neq(a6_3, null);
+ do_check_true(a6_3.isActive);
+ do_check_false(a6_3.userDisabled);
+ do_check_false(a6_3.appDisabled);
+ do_check_eq(a6_3.pendingOperations, AddonManager.PENDING_NONE);
- do_check_neq(a7, null);
- do_check_false(a7.isActive);
- do_check_true(a7.userDisabled);
- do_check_false(a7.appDisabled);
- do_check_eq(a7.pendingOperations, AddonManager.PENDING_NONE);
+ do_check_neq(a7_3, null);
+ do_check_false(a7_3.isActive);
+ do_check_true(a7_3.userDisabled);
+ do_check_false(a7_3.appDisabled);
+ do_check_eq(a7_3.pendingOperations, AddonManager.PENDING_NONE);
- do_check_neq(t1, null);
- do_check_false(t1.isActive);
- do_check_true(t1.userDisabled);
- do_check_false(t1.appDisabled);
- do_check_eq(t1.pendingOperations, AddonManager.PENDING_NONE);
+ do_check_neq(t1_3, null);
+ do_check_false(t1_3.isActive);
+ do_check_true(t1_3.userDisabled);
+ do_check_false(t1_3.appDisabled);
+ do_check_eq(t1_3.pendingOperations, AddonManager.PENDING_NONE);
- do_check_neq(t2, null);
- do_check_true(t2.isActive);
- do_check_false(t2.userDisabled);
- do_check_false(t2.appDisabled);
- do_check_eq(t2.pendingOperations, AddonManager.PENDING_NONE);
+ do_check_neq(t2_3, null);
+ do_check_true(t2_3.isActive);
+ do_check_false(t2_3.userDisabled);
+ do_check_false(t2_3.appDisabled);
+ do_check_eq(t2_3.pendingOperations, AddonManager.PENDING_NONE);
Assert.throws(shutdownManager);
end_test();
}));
}));
}));
}
--- a/toolkit/mozapps/extensions/test/xpcshell/test_dataDirectory.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_dataDirectory.js
@@ -6,21 +6,21 @@
// Disables security checking our updates which haven't been signed
Services.prefs.setBoolPref("extensions.checkUpdateSecurity", false);
var ADDON = {
id: "datadirectory1@tests.mozilla.org",
addon: "test_data_directory"
};
-var expectedDir = gProfD.clone();
-expectedDir.append("extension-data");
-expectedDir.append(ADDON.id);
+function run_test() {
+ var expectedDir = gProfD.clone();
+ expectedDir.append("extension-data");
+ expectedDir.append(ADDON.id);
-function run_test() {
do_test_pending();
do_check_false(expectedDir.exists());
createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "2", "1.9");
startupManager();
installAllFiles([do_get_addon(ADDON.addon)], function() {
restartManager();
--- a/toolkit/mozapps/extensions/test/xpcshell/test_dictionary.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_dictionary.js
@@ -447,30 +447,30 @@ function run_test_16() {
// Should have stopped
do_check_false(HunspellEngine.isDictionaryEnabled("ab-CD.dic"));
gAppInfo.inSafeMode = true;
startupManager(false);
AddonManager.getAddonByID("ab-CD@dictionaries.addons.mozilla.org",
- callback_soon(function(b1) {
+ callback_soon(function(b1_2) {
// Should still be stopped
do_check_false(HunspellEngine.isDictionaryEnabled("ab-CD.dic"));
- do_check_false(b1.isActive);
+ do_check_false(b1_2.isActive);
shutdownManager();
gAppInfo.inSafeMode = false;
startupManager(false);
// Should have started
do_check_true(HunspellEngine.isDictionaryEnabled("ab-CD.dic"));
- AddonManager.getAddonByID("ab-CD@dictionaries.addons.mozilla.org", function(b1) {
- b1.uninstall();
+ AddonManager.getAddonByID("ab-CD@dictionaries.addons.mozilla.org", function(b1_3) {
+ b1_3.uninstall();
do_execute_soon(run_test_17);
});
}));
}));
});
});
}
@@ -578,18 +578,18 @@ function check_test_23() {
do_check_in_crash_annotation("ab-CD@dictionaries.addons.mozilla.org", "1.0");
let dir = do_get_addon_root_uri(profileDir, "ab-CD@dictionaries.addons.mozilla.org");
AddonManager.getAddonsWithOperationsByTypes(null, callback_soon(function(list) {
do_check_eq(list.length, 0);
restartManager();
- AddonManager.getAddonByID("ab-CD@dictionaries.addons.mozilla.org", function(b1) {
- b1.uninstall();
+ AddonManager.getAddonByID("ab-CD@dictionaries.addons.mozilla.org", function(b1_2) {
+ b1_2.uninstall();
do_execute_soon(run_test_25);
});
}));
});
});
}
// Tests that updating from a bootstrappable add-on to a normal add-on calls
@@ -612,21 +612,21 @@ function run_test_25() {
do_check_eq(b1.version, "1.0");
do_check_true(b1.isActive);
do_check_true(hasFlag(b1.pendingOperations, AddonManager.PENDING_UPGRADE));
restartManager();
do_check_false(HunspellEngine.isDictionaryEnabled("ab-CD.dic"));
- AddonManager.getAddonByID("ab-CD@dictionaries.addons.mozilla.org", function(b1) {
- do_check_neq(b1, null);
- do_check_eq(b1.version, "2.0");
- do_check_true(b1.isActive);
- do_check_eq(b1.pendingOperations, AddonManager.PENDING_NONE);
+ AddonManager.getAddonByID("ab-CD@dictionaries.addons.mozilla.org", function(b1_2) {
+ do_check_neq(b1_2, null);
+ do_check_eq(b1_2.version, "2.0");
+ do_check_true(b1_2.isActive);
+ do_check_eq(b1_2.pendingOperations, AddonManager.PENDING_NONE);
do_execute_soon(run_test_26);
});
}));
});
};
installAllFiles([do_get_addon("test_dictionary")], function test_25_installed() { });
@@ -645,24 +645,24 @@ function run_test_26() {
do_check_eq(b1.version, "2.0");
do_check_true(b1.isActive);
do_check_true(hasFlag(b1.pendingOperations, AddonManager.PENDING_UPGRADE));
restartManager();
do_check_true(HunspellEngine.isDictionaryEnabled("ab-CD.dic"));
- AddonManager.getAddonByID("ab-CD@dictionaries.addons.mozilla.org", function(b1) {
- do_check_neq(b1, null);
- do_check_eq(b1.version, "1.0");
- do_check_true(b1.isActive);
- do_check_eq(b1.pendingOperations, AddonManager.PENDING_NONE);
+ AddonManager.getAddonByID("ab-CD@dictionaries.addons.mozilla.org", function(b1_2) {
+ do_check_neq(b1_2, null);
+ do_check_eq(b1_2.version, "1.0");
+ do_check_true(b1_2.isActive);
+ do_check_eq(b1_2.pendingOperations, AddonManager.PENDING_NONE);
HunspellEngine.deactivate();
- b1.uninstall();
+ b1_2.uninstall();
do_execute_soon(run_test_27);
});
}));
});
}
// Tests that an update check from a normal add-on to a bootstrappable add-on works
function run_test_27() {
--- a/toolkit/mozapps/extensions/test/xpcshell/test_distribution.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_distribution.js
@@ -160,18 +160,18 @@ function run_test_4() {
// Tests that after uninstalling a restart doesn't re-install the extension
function run_test_5() {
AddonManager.getAddonByID("addon1@tests.mozilla.org", callback_soon(function(a1) {
a1.uninstall();
restartManager();
- AddonManager.getAddonByID("addon1@tests.mozilla.org", function(a1) {
- do_check_eq(a1, null);
+ AddonManager.getAddonByID("addon1@tests.mozilla.org", function(a1_2) {
+ do_check_eq(a1_2, null);
do_execute_soon(run_test_6);
});
}));
}
// Tests that upgrading the application still doesn't re-install the uninstalled
// extension
--- a/toolkit/mozapps/extensions/test/xpcshell/test_duplicateplugins.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_duplicateplugins.js
@@ -171,17 +171,17 @@ function run_test_3() {
do_check_neq(p, null);
do_check_eq(p.name, "Duplicate Plugin 1");
do_check_eq(p.description, "A duplicate plugin");
// Reorder the plugins and restart again
[PLUGINS[0], PLUGINS[1]] = [PLUGINS[1], PLUGINS[0]];
restartManager();
- AddonManager.getAddonByID(gPluginIDs[0], function(p) {
- do_check_neq(p, null);
- do_check_eq(p.name, "Duplicate Plugin 1");
- do_check_eq(p.description, "A duplicate plugin");
+ AddonManager.getAddonByID(gPluginIDs[0], function(p_2) {
+ do_check_neq(p_2, null);
+ do_check_eq(p_2.name, "Duplicate Plugin 1");
+ do_check_eq(p_2.description, "A duplicate plugin");
do_execute_soon(do_test_finished);
});
}));
}
--- a/toolkit/mozapps/extensions/test/xpcshell/test_filepointer.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_filepointer.js
@@ -242,19 +242,19 @@ function run_test_5() {
do_check_neq(a1, null);
do_check_eq(a1.version, "1.0");
writeInstallRDFForExtension(addon2, sourceDir, addon1.id);
restartManager();
AddonManager.getAddonsByIDs(["addon1@tests.mozilla.org",
- "addon2@tests.mozilla.org"], function([a1, a2]) {
- do_check_eq(a1, null);
- do_check_eq(a2, null);
+ "addon2@tests.mozilla.org"], function([a1_2, a2_2]) {
+ do_check_eq(a1_2, null);
+ do_check_eq(a2_2, null);
let source = sourceDir.clone();
source.append(addon1.id);
do_check_true(source.exists());
let pointer = profileDir.clone();
pointer.append(addon1.id);
do_check_false(pointer.exists());
@@ -278,18 +278,18 @@ function run_test_6() {
do_check_eq(a1.version, "1.0");
let pointer = profileDir.clone();
pointer.append(addon1.id);
pointer.remove(false);
restartManager();
- AddonManager.getAddonByID("addon1@tests.mozilla.org", function(a1) {
- do_check_eq(a1, null);
+ AddonManager.getAddonByID("addon1@tests.mozilla.org", function(a1_2) {
+ do_check_eq(a1_2, null);
do_execute_soon(run_test_7);
});
}));
}
// Removing the pointer file and replacing it with a directory should work
function run_test_7() {
@@ -304,21 +304,21 @@ function run_test_7() {
let pointer = profileDir.clone();
pointer.append(addon1.id);
pointer.remove(false);
writeInstallRDFForExtension(addon1_2, profileDir);
restartManager();
- AddonManager.getAddonByID("addon1@tests.mozilla.org", function(a1) {
- do_check_neq(a1, null);
- do_check_eq(a1.version, "2.0");
+ AddonManager.getAddonByID("addon1@tests.mozilla.org", function(a1_2) {
+ do_check_neq(a1_2, null);
+ do_check_eq(a1_2.version, "2.0");
- a1.uninstall();
+ a1_2.uninstall();
do_execute_soon(run_test_8);
});
}));
}
// Changes to the source files should be detected
function run_test_8() {
@@ -331,21 +331,21 @@ function run_test_8() {
AddonManager.getAddonByID("addon1@tests.mozilla.org", callback_soon(function(a1) {
do_check_neq(a1, null);
do_check_eq(a1.version, "1.0");
writeInstallRDFForExtension(addon1_2, sourceDir);
restartManager();
- AddonManager.getAddonByID("addon1@tests.mozilla.org", function(a1) {
- do_check_neq(a1, null);
- do_check_eq(a1.version, "2.0");
+ AddonManager.getAddonByID("addon1@tests.mozilla.org", function(a1_2) {
+ do_check_neq(a1_2, null);
+ do_check_eq(a1_2.version, "2.0");
- a1.uninstall();
+ a1_2.uninstall();
do_execute_soon(run_test_9);
});
}));
}
// Removing the add-on the pointer file points at should uninstall the add-on
function run_test_9() {
@@ -359,18 +359,18 @@ function run_test_9() {
AddonManager.getAddonByID(addon1.id, callback_soon(function(a1) {
do_check_neq(a1, null);
do_check_eq(a1.version, "1.0");
dest.remove(true);
restartManager();
- AddonManager.getAddonByID(addon1.id, function(a1) {
- do_check_eq(a1, null);
+ AddonManager.getAddonByID(addon1.id, function(a1_2) {
+ do_check_eq(a1_2, null);
let pointer = profileDir.clone();
pointer.append(addon1.id);
do_check_false(pointer.exists());
do_execute_soon(run_test_10);
});
}));
--- a/toolkit/mozapps/extensions/test/xpcshell/test_getresource.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_getresource.js
@@ -71,19 +71,19 @@ function run_test() {
try {
// hasResource should never throw an exception.
do_check_false(a1.hasResource("icon.png"));
} catch (e) {
do_check_true(false);
}
AddonManager.getInstallForFile(do_get_addon("test_getresource"),
- callback_soon(function(aInstall) {
+ callback_soon(function(aInstall_2) {
do_check_false(a1.hasResource("icon.png"));
- do_check_true(aInstall.addon.hasResource("icon.png"));
+ do_check_true(aInstall_2.addon.hasResource("icon.png"));
restartManager();
AddonManager.getAddonByID("addon1@tests.mozilla.org", function(newa1) {
do_check_eq(newa1, null);
do_execute_soon(do_test_finished);
});
--- a/toolkit/mozapps/extensions/test/xpcshell/test_install.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_install.js
@@ -181,20 +181,20 @@ function check_test_1(installSyncGUID) {
difference = a1.updateDate.getTime() - updateDate;
if (Math.abs(difference) > MAX_TIME_DIFFERENCE)
do_throw("Add-on update time was out by " + difference + "ms");
do_check_true(a1.hasResource("install.rdf"));
do_check_false(a1.hasResource("foo.bar"));
- let uri = do_get_addon_root_uri(profileDir, "addon1@tests.mozilla.org");
- do_check_eq(a1.getResourceURI("install.rdf").spec, uri + "install.rdf");
- do_check_eq(a1.iconURL, uri + "icon.png");
- do_check_eq(a1.icon64URL, uri + "icon64.png");
+ let uri2 = do_get_addon_root_uri(profileDir, "addon1@tests.mozilla.org");
+ do_check_eq(a1.getResourceURI("install.rdf").spec, uri2 + "install.rdf");
+ do_check_eq(a1.iconURL, uri2 + "icon.png");
+ do_check_eq(a1.icon64URL, uri2 + "icon64.png");
// Ensure that extension bundle (or icon if unpacked) has updated
// lastModifiedDate.
let testURI = a1.getResourceURI(TEST_UNPACKED ? "icon.png" : "");
let testFile = testURI.QueryInterface(Components.interfaces.nsIFileURL).file;
do_check_true(testFile.exists());
difference = testFile.lastModifiedTime - Date.now();
do_check_true(Math.abs(difference) < MAX_TIME_DIFFERENCE);
@@ -228,17 +228,17 @@ function run_test_2() {
do_check_eq(activeInstalls[0], install);
prepare_test({}, [
"onDownloadStarted",
"onDownloadEnded",
], check_test_2);
install.addListener({
- onDownloadProgress: function(install) {
+ onDownloadProgress: function() {
do_execute_soon(function() {
Components.utils.forceGC();
});
}
});
install.install();
});
@@ -382,18 +382,18 @@ function check_test_5(install) {
do_check_neq(olda2, null);
do_check_true(hasFlag(olda2.pendingOperations, AddonManager.PENDING_UPGRADE));
AddonManager.getInstallsByTypes(null, callback_soon(function(installs) {
do_check_eq(installs.length, 1);
do_check_eq(installs[0].addon, olda2.pendingUpgrade);
restartManager();
- AddonManager.getInstallsByTypes(null, function(installs) {
- do_check_eq(installs.length, 0);
+ AddonManager.getInstallsByTypes(null, function(installs2) {
+ do_check_eq(installs2.length, 0);
AddonManager.getAddonByID("addon2@tests.mozilla.org", function(a2) {
do_check_neq(a2, null);
do_check_eq(a2.type, "extension");
do_check_eq(a2.version, "3.0");
do_check_eq(a2.name, "Real Test 3");
do_check_true(a2.isActive);
do_check_true(isExtensionInAddonsList(profileDir, a2.id));
@@ -1143,36 +1143,36 @@ function run_test_16() {
onInstallEnded: function() {
do_execute_soon(function install2_1_ended() {
restartManager();
AddonManager.getAddonByID("addon2@tests.mozilla.org", function(a2) {
do_check_true(a2.userDisabled);
do_check_false(a2.isActive);
- let url = "http://localhost:" + gPort + "/addons/test_install2_2.xpi";
- AddonManager.getInstallForURL(url, function(aInstall) {
- aInstall.addListener({
+ let url_2 = "http://localhost:" + gPort + "/addons/test_install2_2.xpi";
+ AddonManager.getInstallForURL(url_2, function(aInstall_2) {
+ aInstall_2.addListener({
onInstallEnded: function() {
do_execute_soon(function install2_2_ended() {
- do_check_true(aInstall.addon.userDisabled);
+ do_check_true(aInstall_2.addon.userDisabled);
restartManager();
- AddonManager.getAddonByID("addon2@tests.mozilla.org", function(a2) {
- do_check_true(a2.userDisabled);
- do_check_false(a2.isActive);
+ AddonManager.getAddonByID("addon2@tests.mozilla.org", function(a2_2) {
+ do_check_true(a2_2.userDisabled);
+ do_check_false(a2_2.isActive);
- a2.uninstall();
+ a2_2.uninstall();
do_execute_soon(run_test_17);
});
});
}
});
- aInstall.install();
+ aInstall_2.install();
}, "application/x-xpinstall");
});
});
}
});
aInstall.install();
}, "application/x-xpinstall");
}
@@ -1189,39 +1189,39 @@ function run_test_17() {
do_check_false(aInstall.addon.userDisabled);
restartManager();
AddonManager.getAddonByID("addon2@tests.mozilla.org", function(a2) {
do_check_false(a2.userDisabled);
do_check_true(a2.isActive);
- let url = "http://localhost:" + gPort + "/addons/test_install2_2.xpi";
- AddonManager.getInstallForURL(url, function(aInstall) {
- aInstall.addListener({
+ let url_2 = "http://localhost:" + gPort + "/addons/test_install2_2.xpi";
+ AddonManager.getInstallForURL(url_2, function(aInstall_2) {
+ aInstall_2.addListener({
onInstallStarted: function() {
- do_check_false(aInstall.addon.userDisabled);
- aInstall.addon.userDisabled = true;
+ do_check_false(aInstall_2.addon.userDisabled);
+ aInstall_2.addon.userDisabled = true;
},
onInstallEnded: function() {
do_execute_soon(function install2_2_ended2() {
restartManager();
- AddonManager.getAddonByID("addon2@tests.mozilla.org", function(a2) {
- do_check_true(a2.userDisabled);
- do_check_false(a2.isActive);
+ AddonManager.getAddonByID("addon2@tests.mozilla.org", function(a2_2) {
+ do_check_true(a2_2.userDisabled);
+ do_check_false(a2_2.isActive);
- a2.uninstall();
+ a2_2.uninstall();
do_execute_soon(run_test_18);
});
});
}
});
- aInstall.install();
+ aInstall_2.install();
}, "application/x-xpinstall");
});
});
}
});
aInstall.install();
}, "application/x-xpinstall");
}
@@ -1241,39 +1241,39 @@ function run_test_18() {
onInstallEnded: function() {
do_execute_soon(function install_2_1_ended3() {
restartManager();
AddonManager.getAddonByID("addon2@tests.mozilla.org", function(a2) {
do_check_true(a2.userDisabled);
do_check_false(a2.isActive);
- let url = "http://localhost:" + gPort + "/addons/test_install2_2.xpi";
- AddonManager.getInstallForURL(url, function(aInstall) {
- aInstall.addListener({
+ let url_2 = "http://localhost:" + gPort + "/addons/test_install2_2.xpi";
+ AddonManager.getInstallForURL(url_2, function(aInstall_2) {
+ aInstall_2.addListener({
onInstallStarted: function() {
- do_check_true(aInstall.addon.userDisabled);
- aInstall.addon.userDisabled = false;
+ do_check_true(aInstall_2.addon.userDisabled);
+ aInstall_2.addon.userDisabled = false;
},
onInstallEnded: function() {
do_execute_soon(function install_2_2_ended3() {
restartManager();
- AddonManager.getAddonByID("addon2@tests.mozilla.org", function(a2) {
- do_check_false(a2.userDisabled);
- do_check_true(a2.isActive);
+ AddonManager.getAddonByID("addon2@tests.mozilla.org", function(a2_2) {
+ do_check_false(a2_2.userDisabled);
+ do_check_true(a2_2.isActive);
- a2.uninstall();
+ a2_2.uninstall();
do_execute_soon(run_test_18_1);
});
});
}
});
- aInstall.install();
+ aInstall_2.install();
}, "application/x-xpinstall");
});
});
}
});
aInstall.install();
}, "application/x-xpinstall");
}
@@ -1287,17 +1287,17 @@ function run_test_18_1() {
Services.prefs.setCharPref(PREF_GETADDONS_BYIDS,
"http://localhost:" + gPort + "/data/test_install.xml");
Services.prefs.setBoolPref("extensions.addon2@tests.mozilla.org.getAddons.cache.enabled", false);
let url = "http://localhost:" + gPort + "/addons/test_install2_1.xpi";
AddonManager.getInstallForURL(url, function(aInstall) {
aInstall.addListener({
- onInstallEnded: function(aInstall, aAddon) {
+ onInstallEnded: function(unused, aAddon) {
do_execute_soon(function test18_1_install_ended() {
do_check_neq(aAddon.fullDescription, "Repository description");
restartManager();
AddonManager.getAddonByID("addon2@tests.mozilla.org", function(a2) {
do_check_neq(a2.fullDescription, "Repository description");
@@ -1315,17 +1315,17 @@ function run_test_18_1() {
// after restart
function run_test_19() {
restartManager();
Services.prefs.setBoolPref("extensions.addon2@tests.mozilla.org.getAddons.cache.enabled", true);
let url = "http://localhost:" + gPort + "/addons/test_install2_1.xpi";
AddonManager.getInstallForURL(url, function(aInstall) {
aInstall.addListener({
- onInstallEnded: function(aInstall, aAddon) {
+ onInstallEnded: function(unused, aAddon) {
do_execute_soon(function test19_install_ended() {
do_check_eq(aAddon.fullDescription, "Repository description");
restartManager();
AddonManager.getAddonByID("addon2@tests.mozilla.org", function(a2) {
do_check_eq(a2.fullDescription, "Repository description");
@@ -1341,17 +1341,17 @@ function run_test_19() {
// Do the same again to make sure it works when the data is already in the cache
function run_test_20() {
restartManager();
let url = "http://localhost:" + gPort + "/addons/test_install2_1.xpi";
AddonManager.getInstallForURL(url, function(aInstall) {
aInstall.addListener({
- onInstallEnded: function(aInstall, aAddon) {
+ onInstallEnded: function(unused, aAddon) {
do_execute_soon(function test20_install_ended() {
do_check_eq(aAddon.fullDescription, "Repository description");
restartManager();
AddonManager.getAddonByID("addon2@tests.mozilla.org", function(a2) {
do_check_eq(a2.fullDescription, "Repository description");
@@ -1628,18 +1628,18 @@ function run_test_26() {
run_test_27();
}
});
let url = "http://localhost:" + gPort + "/redirect?/addons/test_install1.xpi";
AddonManager.getInstallForURL(url, function(aInstall) {
aInstall.addListener({
- onDownloadProgress: function(aInstall) {
- aInstall.cancel();
+ onDownloadProgress: function(aDownloadProgressInstall) {
+ aDownloadProgressInstall.cancel();
}
});
aInstall.install();
}, "application/x-xpinstall");
}
--- a/toolkit/mozapps/extensions/test/xpcshell/test_install_strictcompat.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_install_strictcompat.js
@@ -172,20 +172,20 @@ function check_test_1() {
difference = a1.updateDate.getTime() - updateDate;
if (Math.abs(difference) > MAX_TIME_DIFFERENCE)
do_throw("Add-on update time was out by " + difference + "ms");
do_check_true(a1.hasResource("install.rdf"));
do_check_false(a1.hasResource("foo.bar"));
- let uri = do_get_addon_root_uri(profileDir, "addon1@tests.mozilla.org");
- do_check_eq(a1.getResourceURI("install.rdf").spec, uri + "install.rdf");
- do_check_eq(a1.iconURL, uri + "icon.png");
- do_check_eq(a1.icon64URL, uri + "icon64.png");
+ let root_uri = do_get_addon_root_uri(profileDir, "addon1@tests.mozilla.org");
+ do_check_eq(a1.getResourceURI("install.rdf").spec, root_uri + "install.rdf");
+ do_check_eq(a1.iconURL, root_uri + "icon.png");
+ do_check_eq(a1.icon64URL, root_uri + "icon64.png");
a1.uninstall();
do_execute_soon(function() { run_test_2(a1) });
});
});
}));
});
}
@@ -211,17 +211,17 @@ function run_test_2(aAddon) {
do_check_eq(activeInstalls[0], install);
prepare_test({}, [
"onDownloadStarted",
"onDownloadEnded",
], check_test_2);
install.addListener({
- onDownloadProgress: function(install) {
+ onDownloadProgress: function() {
do_execute_soon(function() {
Components.utils.forceGC();
});
}
});
install.install();
});
@@ -364,18 +364,18 @@ function check_test_5(install) {
do_check_neq(olda2, null);
do_check_true(hasFlag(olda2.pendingOperations, AddonManager.PENDING_UPGRADE));
AddonManager.getInstallsByTypes(null, callback_soon(function(installs) {
do_check_eq(installs.length, 1);
do_check_eq(installs[0].addon, olda2.pendingUpgrade);
restartManager();
- AddonManager.getInstallsByTypes(null, function(installs) {
- do_check_eq(installs.length, 0);
+ AddonManager.getInstallsByTypes(null, function(installs2) {
+ do_check_eq(installs2.length, 0);
AddonManager.getAddonByID("addon2@tests.mozilla.org", function(a2) {
do_check_neq(a2, null);
do_check_eq(a2.type, "extension");
do_check_eq(a2.version, "3.0");
do_check_eq(a2.name, "Real Test 3");
do_check_true(a2.isActive);
do_check_true(isExtensionInAddonsList(profileDir, a2.id));
@@ -1124,36 +1124,36 @@ function run_test_16() {
onInstallEnded: function() {
do_execute_soon(function test16_install1() {
restartManager();
AddonManager.getAddonByID("addon2@tests.mozilla.org", function(a2) {
do_check_true(a2.userDisabled);
do_check_false(a2.isActive);
- let url = "http://localhost:4444/addons/test_install2_2.xpi";
- AddonManager.getInstallForURL(url, function(aInstall) {
- aInstall.addListener({
+ let url_2 = "http://localhost:4444/addons/test_install2_2.xpi";
+ AddonManager.getInstallForURL(url_2, function(aInstall_2) {
+ aInstall_2.addListener({
onInstallEnded: function() {
do_execute_soon(function test16_install2() {
- do_check_true(aInstall.addon.userDisabled);
+ do_check_true(aInstall_2.addon.userDisabled);
restartManager();
- AddonManager.getAddonByID("addon2@tests.mozilla.org", function(a2) {
- do_check_true(a2.userDisabled);
- do_check_false(a2.isActive);
+ AddonManager.getAddonByID("addon2@tests.mozilla.org", function(a2_2) {
+ do_check_true(a2_2.userDisabled);
+ do_check_false(a2_2.isActive);
- a2.uninstall();
+ a2_2.uninstall();
do_execute_soon(run_test_17);
});
});
}
});
- aInstall.install();
+ aInstall_2.install();
}, "application/x-xpinstall");
});
});
}
});
aInstall.install();
}, "application/x-xpinstall");
}
@@ -1161,48 +1161,48 @@ function run_test_16() {
// Verify that changing the userDisabled value before onInstallEnded works
function run_test_17() {
restartManager();
let url = "http://localhost:4444/addons/test_install2_1.xpi";
AddonManager.getInstallForURL(url, function(aInstall) {
aInstall.addListener({
onInstallEnded: function() {
- do_execute_soon(function test17_install1() {
+ do_execute_soon(function() {
do_check_false(aInstall.addon.userDisabled);
restartManager();
AddonManager.getAddonByID("addon2@tests.mozilla.org", function(a2) {
do_check_false(a2.userDisabled);
do_check_true(a2.isActive);
- let url = "http://localhost:4444/addons/test_install2_2.xpi";
- AddonManager.getInstallForURL(url, function(aInstall) {
- aInstall.addListener({
+ let url_2 = "http://localhost:4444/addons/test_install2_2.xpi";
+ AddonManager.getInstallForURL(url_2, function(aInstall_2) {
+ aInstall_2.addListener({
onInstallStarted: function() {
- do_check_false(aInstall.addon.userDisabled);
- aInstall.addon.userDisabled = true;
+ do_check_false(aInstall_2.addon.userDisabled);
+ aInstall_2.addon.userDisabled = true;
},
onInstallEnded: function() {
- do_execute_soon(function test17_install1() {
+ do_execute_soon(function() {
restartManager();
- AddonManager.getAddonByID("addon2@tests.mozilla.org", function(a2) {
- do_check_true(a2.userDisabled);
- do_check_false(a2.isActive);
+ AddonManager.getAddonByID("addon2@tests.mozilla.org", function(a2_2) {
+ do_check_true(a2_2.userDisabled);
+ do_check_false(a2_2.isActive);
- a2.uninstall();
+ a2_2.uninstall();
do_execute_soon(run_test_18);
});
});
}
});
- aInstall.install();
+ aInstall_2.install();
}, "application/x-xpinstall");
});
});
}
});
aInstall.install();
}, "application/x-xpinstall");
}
@@ -1222,39 +1222,39 @@ function run_test_18() {
onInstallEnded: function() {
do_execute_soon(function test18_install1() {
restartManager();
AddonManager.getAddonByID("addon2@tests.mozilla.org", function(a2) {
do_check_true(a2.userDisabled);
do_check_false(a2.isActive);
- let url = "http://localhost:4444/addons/test_install2_2.xpi";
- AddonManager.getInstallForURL(url, function(aInstall) {
- aInstall.addListener({
+ let url_2 = "http://localhost:4444/addons/test_install2_2.xpi";
+ AddonManager.getInstallForURL(url_2, function(aInstall_2) {
+ aInstall_2.addListener({
onInstallStarted: function() {
- do_check_true(aInstall.addon.userDisabled);
- aInstall.addon.userDisabled = false;
+ do_check_true(aInstall_2.addon.userDisabled);
+ aInstall_2.addon.userDisabled = false;
},
onInstallEnded: function() {
do_execute_soon(function test18_install2() {
restartManager();
- AddonManager.getAddonByID("addon2@tests.mozilla.org", function(a2) {
- do_check_false(a2.userDisabled);
- do_check_true(a2.isActive);
+ AddonManager.getAddonByID("addon2@tests.mozilla.org", function(a2_2) {
+ do_check_false(a2_2.userDisabled);
+ do_check_true(a2_2.isActive);
- a2.uninstall();
+ a2_2.uninstall();
do_execute_soon(run_test_18_1);
});
});
}
});
- aInstall.install();
+ aInstall_2.install();
}, "application/x-xpinstall");
});
});
}
});
aInstall.install();
}, "application/x-xpinstall");
}
@@ -1268,17 +1268,17 @@ function run_test_18_1() {
Services.prefs.setCharPref(PREF_GETADDONS_BYIDS,
"http://localhost:4444/data/test_install.xml");
Services.prefs.setBoolPref("extensions.addon2@tests.mozilla.org.getAddons.cache.enabled", false);
let url = "http://localhost:4444/addons/test_install2_1.xpi";
AddonManager.getInstallForURL(url, function(aInstall) {
aInstall.addListener({
- onInstallEnded: function(aInstall, aAddon) {
+ onInstallEnded: function(unused, aAddon) {
do_execute_soon(function test18_install() {
do_check_neq(aAddon.fullDescription, "Repository description");
restartManager();
AddonManager.getAddonByID("addon2@tests.mozilla.org", function(a2) {
do_check_neq(a2.fullDescription, "Repository description");
@@ -1296,17 +1296,17 @@ function run_test_18_1() {
// after restart
function run_test_19() {
restartManager();
Services.prefs.setBoolPref("extensions.addon2@tests.mozilla.org.getAddons.cache.enabled", true);
let url = "http://localhost:4444/addons/test_install2_1.xpi";
AddonManager.getInstallForURL(url, function(aInstall) {
aInstall.addListener({
- onInstallEnded: function(aInstall, aAddon) {
+ onInstallEnded: function(unused, aAddon) {
do_execute_soon(function test19_install() {
do_check_eq(aAddon.fullDescription, "Repository description");
restartManager();
AddonManager.getAddonByID("addon2@tests.mozilla.org", function(a2) {
do_check_eq(a2.fullDescription, "Repository description");
@@ -1322,17 +1322,17 @@ function run_test_19() {
// Do the same again to make sure it works when the data is already in the cache
function run_test_20() {
restartManager();
let url = "http://localhost:4444/addons/test_install2_1.xpi";
AddonManager.getInstallForURL(url, function(aInstall) {
aInstall.addListener({
- onInstallEnded: function(aInstall, aAddon) {
+ onInstallEnded: function(unused, aAddon) {
do_execute_soon(function test20_install() {
do_check_eq(aAddon.fullDescription, "Repository description");
restartManager();
AddonManager.getAddonByID("addon2@tests.mozilla.org", function(a2) {
do_check_eq(a2.fullDescription, "Repository description");
@@ -1609,18 +1609,18 @@ function run_test_26() {
run_test_27();
}
});
let url = "http://localhost:4444/redirect?/addons/test_install1.xpi";
AddonManager.getInstallForURL(url, function(aInstall) {
aInstall.addListener({
- onDownloadProgress: function(aInstall) {
- aInstall.cancel();
+ onDownloadProgress: function(aDownloadProgressInstall) {
+ aDownloadProgressInstall.cancel();
}
});
aInstall.install();
}, "application/x-xpinstall");
}
--- a/toolkit/mozapps/extensions/test/xpcshell/test_migrate4.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_migrate4.js
@@ -143,21 +143,21 @@ function prepare_profile() {
restartManager();
AddonManager.getAddonsByIDs(["addon1@tests.mozilla.org",
"addon2@tests.mozilla.org",
"addon3@tests.mozilla.org",
"addon4@tests.mozilla.org",
"addon5@tests.mozilla.org",
"addon6@tests.mozilla.org"],
- function([a1, a2, a3, a4, a5, a6]) {
- a3.userDisabled = true;
- a4.userDisabled = false;
+ function([a1_2, a2_2, a3_2, a4_2, a5_2, a6_2]) {
+ a3_2.userDisabled = true;
+ a4_2.userDisabled = false;
- a5.findUpdates({
+ a5_2.findUpdates({
onUpdateFinished: function() {
do_execute_soon(perform_migration);
}
}, AddonManager.UPDATE_WHEN_USER_REQUESTED);
});
});
}, "application/x-xpinstall");
}
--- a/toolkit/mozapps/extensions/test/xpcshell/test_migrateAddonRepository.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_migrateAddonRepository.js
@@ -54,31 +54,31 @@ function run_test() {
db.createTable("screenshot",
"addon_internal_id INTEGER, " +
"num INTEGER, " +
"url TEXT, " +
"thumbnailURL TEXT, " +
"caption TEXT, " +
"PRIMARY KEY (addon_internal_id, num)");
- let stmt = db.createStatement("INSERT INTO addon (id) VALUES (:id)");
- stmt.params.id = "test1@tests.mozilla.org";
- stmt.execute();
- stmt.finalize();
+ let insertStmt = db.createStatement("INSERT INTO addon (id) VALUES (:id)");
+ insertStmt.params.id = "test1@tests.mozilla.org";
+ insertStmt.execute();
+ insertStmt.finalize();
- stmt = db.createStatement("INSERT INTO screenshot VALUES " +
+ insertStmt = db.createStatement("INSERT INTO screenshot VALUES " +
"(:addon_internal_id, :num, :url, :thumbnailURL, :caption)");
- stmt.params.addon_internal_id = 1;
- stmt.params.num = 0;
- stmt.params.url = "http://localhost/full1-1.png";
- stmt.params.thumbnailURL = "http://localhost/thumbnail1-1.png";
- stmt.params.caption = "Caption 1 - 1";
- stmt.execute();
- stmt.finalize();
+ insertStmt.params.addon_internal_id = 1;
+ insertStmt.params.num = 0;
+ insertStmt.params.url = "http://localhost/full1-1.png";
+ insertStmt.params.thumbnailURL = "http://localhost/thumbnail1-1.png";
+ insertStmt.params.caption = "Caption 1 - 1";
+ insertStmt.execute();
+ insertStmt.finalize();
db.schemaVersion = 1;
db.close();
Services.prefs.setBoolPref("extensions.getAddons.cache.enabled", true);
AddonRepository.getCachedAddonByID("test1@tests.mozilla.org", function (aAddon) {
do_check_neq(aAddon, null);
@@ -103,25 +103,25 @@ function run_test() {
do_check_true(db.indexExists("icon_idx"));
do_check_true(db.tableExists("icon"));
// Check the trigger is working
db.executeSimpleSQL("INSERT INTO addon (id, type, name) VALUES('test_addon', 'extension', 'Test Addon')");
let internalID = db.lastInsertRowID;
db.executeSimpleSQL("INSERT INTO compatibility_override (addon_internal_id, num, type) VALUES('" + internalID + "', '1', 'incompatible')");
- let stmt = db.createStatement("SELECT COUNT(*) AS count FROM compatibility_override");
- stmt.executeStep();
- do_check_eq(stmt.row.count, 1);
- stmt.reset();
+ let selectStmt = db.createStatement("SELECT COUNT(*) AS count FROM compatibility_override");
+ selectStmt.executeStep();
+ do_check_eq(selectStmt.row.count, 1);
+ selectStmt.reset();
db.executeSimpleSQL("DELETE FROM addon");
- stmt.executeStep();
- do_check_eq(stmt.row.count, 0);
- stmt.finalize();
+ selectStmt.executeStep();
+ do_check_eq(selectStmt.row.count, 0);
+ selectStmt.finalize();
db.close();
do_test_finished();
},
do_report_unexpected_exception
);
});
}
--- a/toolkit/mozapps/extensions/test/xpcshell/test_plugins.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_plugins.js
@@ -151,24 +151,24 @@ function run_test_2(p) {
p.userDisabled = true;
ensure_test_completed();
do_check_true(p.userDisabled);
do_check_false(p.appDisabled);
do_check_false(p.isActive);
- AddonManager.getAddonByID(gID, function(p) {
- do_check_neq(p, null);
- do_check_true(p.userDisabled);
- do_check_false(p.appDisabled);
- do_check_false(p.isActive);
- do_check_eq(p.name, "Shockwave Flash");
+ AddonManager.getAddonByID(gID, function(p2) {
+ do_check_neq(p2, null);
+ do_check_true(p2.userDisabled);
+ do_check_false(p2.appDisabled);
+ do_check_false(p2.isActive);
+ do_check_eq(p2.name, "Shockwave Flash");
- run_test_3(p);
+ run_test_3(p2);
});
}
// Tests that enabling a plugin works
function run_test_3(p) {
let test = {};
test[gID] = [
["onEnabling", false],
@@ -179,22 +179,22 @@ function run_test_3(p) {
p.userDisabled = false;
ensure_test_completed();
do_check_false(p.userDisabled);
do_check_false(p.appDisabled);
do_check_true(p.isActive);
- AddonManager.getAddonByID(gID, function(p) {
- do_check_neq(p, null);
- do_check_false(p.userDisabled);
- do_check_false(p.appDisabled);
- do_check_true(p.isActive);
- do_check_eq(p.name, "Shockwave Flash");
+ AddonManager.getAddonByID(gID, function(p2) {
+ do_check_neq(p2, null);
+ do_check_false(p2.userDisabled);
+ do_check_false(p2.appDisabled);
+ do_check_true(p2.isActive);
+ do_check_eq(p2.name, "Shockwave Flash");
do_execute_soon(run_test_4);
});
}
// Verify that after a restart the test plugin has the same ID
function run_test_4() {
restartManager();
--- a/toolkit/mozapps/extensions/test/xpcshell/test_reload.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_reload.js
@@ -50,33 +50,33 @@ add_task(function* test_reloading_a_temp
var receivedOnUninstalled = false;
var receivedOnUninstalling = false;
var receivedOnInstalled = false;
var receivedOnInstalling = false;
const onReload = new Promise(resolve => {
const listener = {
- onUninstalling: (addon) => {
- if (addon.id === sampleAddon.id) {
+ onUninstalling: (addonObj) => {
+ if (addonObj.id === sampleAddon.id) {
receivedOnUninstalling = true;
}
},
- onUninstalled: (addon) => {
- if (addon.id === sampleAddon.id) {
+ onUninstalled: (addonObj) => {
+ if (addonObj.id === sampleAddon.id) {
receivedOnUninstalled = true;
}
},
- onInstalling: (addon) => {
+ onInstalling: (addonObj) => {
receivedOnInstalling = true;
- equal(addon.id, sampleAddon.id);
+ equal(addonObj.id, sampleAddon.id);
},
- onInstalled: (addon) => {
+ onInstalled: (addonObj) => {
receivedOnInstalled = true;
- equal(addon.id, sampleAddon.id);
+ equal(addonObj.id, sampleAddon.id);
// This should be the last event called.
AddonManager.removeAddonListener(listener);
resolve();
},
}
AddonManager.addAddonListener(listener);
});
--- a/toolkit/mozapps/extensions/test/xpcshell/test_sourceURI.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_sourceURI.js
@@ -49,18 +49,18 @@ function run_test() {
AddonManager.getAddonByID("addon@tests.mozilla.org", function(a) {
do_check_neq(a, null);
do_check_eq(a.sourceURI, null);
backgroundUpdate(function() {
restartManager();
- AddonManager.getAddonByID("addon@tests.mozilla.org", function(a) {
- do_check_neq(a, null);
- do_check_neq(a.sourceURI, null);
- do_check_eq(a.sourceURI.spec, "http://www.example.com/testaddon.xpi");
+ AddonManager.getAddonByID("addon@tests.mozilla.org", function(a2) {
+ do_check_neq(a2, null);
+ do_check_neq(a2.sourceURI, null);
+ do_check_eq(a2.sourceURI.spec, "http://www.example.com/testaddon.xpi");
do_test_finished();
});
});
});
}
--- a/toolkit/mozapps/extensions/test/xpcshell/test_startup.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_startup.js
@@ -863,70 +863,70 @@ function run_test_12() {
restartManager();
AddonManager.getAddonsByIDs(["addon1@tests.mozilla.org",
"addon2@tests.mozilla.org",
"addon3@tests.mozilla.org",
"addon4@tests.mozilla.org",
"addon5@tests.mozilla.org"],
- function([a1, a2, a3, a4, a5]) {
- do_check_neq(a1, null);
- do_check_false(a1.userDisabled);
- do_check_true(a1.seen);
- do_check_true(a1.isActive);
+ function([a1_2, a2_2, a3_2, a4_2, a5_2]) {
+ do_check_neq(a1_2, null);
+ do_check_false(a1_2.userDisabled);
+ do_check_true(a1_2.seen);
+ do_check_true(a1_2.isActive);
- do_check_neq(a2, null);
- do_check_false(a2.userDisabled);
- do_check_true(a2.seen);
- do_check_true(a2.isActive);
+ do_check_neq(a2_2, null);
+ do_check_false(a2_2.userDisabled);
+ do_check_true(a2_2.seen);
+ do_check_true(a2_2.isActive);
- do_check_neq(a3, null);
- do_check_true(a3.userDisabled);
- do_check_false(a3.seen);
- do_check_false(a3.isActive);
+ do_check_neq(a3_2, null);
+ do_check_true(a3_2.userDisabled);
+ do_check_false(a3_2.seen);
+ do_check_false(a3_2.isActive);
- var dest = profileDir.clone();
- dest.append(do_get_expected_addon_name("addon1@tests.mozilla.org"));
- dest.remove(true);
- dest = userDir.clone();
- dest.append(do_get_expected_addon_name("addon2@tests.mozilla.org"));
- dest.remove(true);
- dest = globalDir.clone();
- dest.append(do_get_expected_addon_name("addon3@tests.mozilla.org"));
- dest.remove(true);
+ var dest2 = profileDir.clone();
+ dest2.append(do_get_expected_addon_name("addon1@tests.mozilla.org"));
+ dest2.remove(true);
+ dest2 = userDir.clone();
+ dest2.append(do_get_expected_addon_name("addon2@tests.mozilla.org"));
+ dest2.remove(true);
+ dest2 = globalDir.clone();
+ dest2.append(do_get_expected_addon_name("addon3@tests.mozilla.org"));
+ dest2.remove(true);
restartManager();
Services.prefs.setIntPref("extensions.autoDisableScopes", AddonManager.SCOPE_USER + AddonManager.SCOPE_SYSTEM);
writeInstallRDFForExtension(addon1, profileDir);
writeInstallRDFForExtension(addon2, userDir);
writeInstallRDFForExtension(addon3, globalDir);
restartManager();
AddonManager.getAddonsByIDs(["addon1@tests.mozilla.org",
"addon2@tests.mozilla.org",
"addon3@tests.mozilla.org",
"addon4@tests.mozilla.org",
"addon5@tests.mozilla.org"],
- function([a1, a2, a3, a4, a5]) {
- do_check_neq(a1, null);
- do_check_false(a1.userDisabled);
- do_check_true(a1.seen);
- do_check_true(a1.isActive);
+ function([a1_3, a2_3, a3_3, a4_3, a5_3]) {
+ do_check_neq(a1_3, null);
+ do_check_false(a1_3.userDisabled);
+ do_check_true(a1_3.seen);
+ do_check_true(a1_3.isActive);
- do_check_neq(a2, null);
- do_check_true(a2.userDisabled);
- do_check_false(a2.seen);
- do_check_false(a2.isActive);
+ do_check_neq(a2_3, null);
+ do_check_true(a2_3.userDisabled);
+ do_check_false(a2_3.seen);
+ do_check_false(a2_3.isActive);
- do_check_neq(a3, null);
- do_check_true(a3.userDisabled);
- do_check_false(a3.seen);
- do_check_false(a3.isActive);
+ do_check_neq(a3_3, null);
+ do_check_true(a3_3.userDisabled);
+ do_check_false(a3_3.seen);
+ do_check_false(a3_3.isActive);
do_execute_soon(end_test);
});
});
}));
}
--- a/toolkit/mozapps/extensions/test/xpcshell/test_switch_os.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_switch_os.js
@@ -27,20 +27,20 @@ add_task(function*() {
do_check_true(addon.isActive);
yield promiseShutdownManager();
BootstrapMonitor.checkAddonNotStarted(ID);
let jData = loadJSON(gExtensionsJSON);
- for (let addon of jData.addons) {
- if (addon.id == ID) {
+ for (let addonInstance of jData.addons) {
+ if (addonInstance.id == ID) {
// Set to something that would be an invalid descriptor for this platform
- addon.descriptor = AppConstants.platform == "win" ? "/foo/bar" : "C:\\foo\\bar";
+ addonInstance.descriptor = AppConstants.platform == "win" ? "/foo/bar" : "C:\\foo\\bar";
}
}
saveJSON(jData, gExtensionsJSON);
startupManager();
addon = yield promiseAddonByID(ID);
--- a/toolkit/mozapps/extensions/test/xpcshell/test_theme.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_theme.js
@@ -852,37 +852,37 @@ function run_test_15() {
AddonManager.getAddonByID("theme1@tests.mozilla.org", callback_soon(function(t1) {
t1.userDisabled = false;
restartManager();
do_check_eq(Services.prefs.getCharPref(PREF_GENERAL_SKINS_SELECTEDSKIN), "theme1/1.0");
AddonManager.getAddonsByIDs(["default@tests.mozilla.org",
"theme1@tests.mozilla.org"],
- callback_soon(function([d, t1]) {
- do_check_true(d.userDisabled);
- do_check_false(d.appDisabled);
- do_check_false(d.isActive);
+ callback_soon(function([d_2, t1_2]) {
+ do_check_true(d_2.userDisabled);
+ do_check_false(d_2.appDisabled);
+ do_check_false(d_2.isActive);
- do_check_false(t1.userDisabled);
- do_check_false(t1.appDisabled);
- do_check_true(t1.isActive);
+ do_check_false(t1_2.userDisabled);
+ do_check_false(t1_2.appDisabled);
+ do_check_true(t1_2.isActive);
restartManager("2");
do_check_eq(Services.prefs.getCharPref(PREF_GENERAL_SKINS_SELECTEDSKIN), "theme1/1.0");
AddonManager.getAddonsByIDs(["default@tests.mozilla.org",
- "theme1@tests.mozilla.org"], function([d, t1]) {
- do_check_true(d.userDisabled);
- do_check_false(d.appDisabled);
- do_check_false(d.isActive);
+ "theme1@tests.mozilla.org"], function([d_3, t1_3]) {
+ do_check_true(d_3.userDisabled);
+ do_check_false(d_3.appDisabled);
+ do_check_false(d_3.isActive);
- do_check_false(t1.userDisabled);
- do_check_false(t1.appDisabled);
- do_check_true(t1.isActive);
+ do_check_false(t1_3.userDisabled);
+ do_check_false(t1_3.appDisabled);
+ do_check_true(t1_3.isActive);
do_execute_soon(run_test_16);
});
}));
}));
});
}
@@ -938,55 +938,55 @@ function run_test_18() {
AddonManager.getAddonByID("theme1@tests.mozilla.org", callback_soon(function(t1) {
t1.userDisabled = false;
restartManager();
AddonManager.getAddonsByIDs(["default@tests.mozilla.org",
"theme1@tests.mozilla.org"],
- callback_soon(function([d, t1]) {
- do_check_true(d.userDisabled);
- do_check_false(d.appDisabled);
- do_check_false(d.isActive);
+ callback_soon(function([d_2, t1_2]) {
+ do_check_true(d_2.userDisabled);
+ do_check_false(d_2.appDisabled);
+ do_check_false(d_2.isActive);
- do_check_false(t1.userDisabled);
- do_check_false(t1.appDisabled);
- do_check_true(t1.isActive);
+ do_check_false(t1_2.userDisabled);
+ do_check_false(t1_2.appDisabled);
+ do_check_true(t1_2.isActive);
prepare_test({
"theme1@tests.mozilla.org": [
"onDisabling",
],
"default@tests.mozilla.org": [
"onEnabling",
]
});
- t1.userDisabled = true;
+ t1_2.userDisabled = true;
ensure_test_completed();
- do_check_false(d.userDisabled);
- do_check_false(d.appDisabled);
- do_check_false(d.isActive);
+ do_check_false(d_2.userDisabled);
+ do_check_false(d_2.appDisabled);
+ do_check_false(d_2.isActive);
- do_check_true(t1.userDisabled);
- do_check_false(t1.appDisabled);
- do_check_true(t1.isActive);
+ do_check_true(t1_2.userDisabled);
+ do_check_false(t1_2.appDisabled);
+ do_check_true(t1_2.isActive);
restartManager();
AddonManager.getAddonsByIDs(["default@tests.mozilla.org",
- "theme1@tests.mozilla.org"], function([d, t1]) {
- do_check_false(d.userDisabled);
- do_check_false(d.appDisabled);
- do_check_true(d.isActive);
+ "theme1@tests.mozilla.org"], function([d_3, t1_3]) {
+ do_check_false(d_3.userDisabled);
+ do_check_false(d_3.appDisabled);
+ do_check_true(d_3.isActive);
- do_check_true(t1.userDisabled);
- do_check_false(t1.appDisabled);
- do_check_false(t1.isActive);
+ do_check_true(t1_3.userDisabled);
+ do_check_false(t1_3.appDisabled);
+ do_check_false(t1_3.isActive);
do_execute_soon(run_test_19);
});
}));
}));
}
// Disabling the active persona should switch back to the default theme
@@ -1119,21 +1119,21 @@ function run_test_22() {
minVersion: "1",
maxVersion: "2"
}]
}, profileDir);
restartManager();
AddonManager.getAddonsByIDs(["default@tests.mozilla.org",
- "1@personas.mozilla.org"], function([d, p1]) {
- do_check_true(d.userDisabled);
- do_check_false(d.appDisabled);
- do_check_false(d.isActive);
+ "1@personas.mozilla.org"], function([d_2, p1_2]) {
+ do_check_true(d_2.userDisabled);
+ do_check_false(d_2.appDisabled);
+ do_check_false(d_2.isActive);
- do_check_false(p1.userDisabled);
- do_check_false(p1.appDisabled);
- do_check_true(p1.isActive);
+ do_check_false(p1_2.userDisabled);
+ do_check_false(p1_2.appDisabled);
+ do_check_true(p1_2.isActive);
end_test();
});
});
}
--- a/toolkit/mozapps/extensions/test/xpcshell/test_update.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_update.js
@@ -49,17 +49,17 @@ let testParams = [
appId: "xpcshell@tests.mozilla.org" },
{ updateFile: "test_update.json",
appId: "toolkit@mozilla.org" },
];
for (let test of testParams) {
let { updateFile, appId } = test;
- add_test(function run_test() {
+ add_test(function() {
writeInstallRDFForExtension({
id: "addon1@tests.mozilla.org",
version: "1.0",
updateURL: "http://localhost:" + gPort + "/data/" + updateFile,
targetApplications: [{
id: appId,
minVersion: "1",
maxVersion: "1"
@@ -140,36 +140,36 @@ for (let test of testParams) {
do_check_eq(install.name, addon.name);
do_check_eq(install.version, "2.0");
do_check_eq(install.state, AddonManager.STATE_AVAILABLE);
do_check_eq(install.existingAddon, addon);
do_check_eq(install.releaseNotesURI.spec, "http://example.com/updateInfo.xhtml");
// Verify that another update check returns the same AddonInstall
a1.findUpdates({
- onNoCompatibilityUpdateAvailable: function(addon) {
+ onNoCompatibilityUpdateAvailable: function() {
ok(false, "Should not have seen onNoCompatibilityUpdateAvailable notification");
},
onUpdateAvailable: function(newAddon, newInstall) {
- AddonManager.getAllInstalls(function(aInstalls) {
- do_check_eq(aInstalls.length, 1);
- do_check_eq(aInstalls[0], install);
+ AddonManager.getAllInstalls(function(aInstalls2) {
+ do_check_eq(aInstalls2.length, 1);
+ do_check_eq(aInstalls2[0], install);
do_check_eq(newAddon, addon);
do_check_eq(newInstall, install);
prepare_test({}, [
"onDownloadStarted",
"onDownloadEnded",
], check_test_1);
install.install();
});
},
- onNoUpdateAvailable: function(addon) {
+ onNoUpdateAvailable: function() {
ok(false, "Should not have seen onNoUpdateAvailable notification");
}
}, AddonManager.UPDATE_WHEN_USER_REQUESTED);
});
},
onNoUpdateAvailable: function(addon) {
ok(false, "Should not have seen onNoUpdateAvailable notification");
@@ -190,17 +190,17 @@ for (let test of testParams) {
let check_test_2;
run_test_2 = (install) => {
// Verify that another update check returns no new update
install.existingAddon.findUpdates({
onNoCompatibilityUpdateAvailable: function(addon) {
ok(false, "Should not have seen onNoCompatibilityUpdateAvailable notification");
},
- onUpdateAvailable: function(addon, install) {
+ onUpdateAvailable: function() {
ok(false, "Should find no available update when one is already downloading");
},
onNoUpdateAvailable: function(addon) {
AddonManager.getAllInstalls(function(aInstalls) {
do_check_eq(aInstalls.length, 1);
do_check_eq(aInstalls[0], install);
@@ -588,26 +588,26 @@ for (let test of testParams) {
});
AddonManager.getAddonsByIDs(["addon1@tests.mozilla.org",
"addon2@tests.mozilla.org",
"addon3@tests.mozilla.org",
"addon4@tests.mozilla.org",
"addon5@tests.mozilla.org",
"addon6@tests.mozilla.org"],
- function([a1, a2, a3, a4, a5, a6]) {
+ function([a1_2, a2_2, a3_2, a4_2, a5_2, a6_2]) {
let count = 6;
function next_test() {
- a1.uninstall();
- a2.uninstall();
- a3.uninstall();
- a4.uninstall();
- a5.uninstall();
- a6.uninstall();
+ a1_2.uninstall();
+ a2_2.uninstall();
+ a3_2.uninstall();
+ a4_2.uninstall();
+ a5_2.uninstall();
+ a6_2.uninstall();
restartManager();
run_next_test();
}
let compatListener = {
onUpdateFinished: function(addon, error) {
if (--count == 0)
@@ -621,22 +621,22 @@ for (let test of testParams) {
},
onUpdateFinished: function(addon, error) {
if (--count == 0)
do_execute_soon(next_test);
}
};
- a1.findUpdates(updateListener, AddonManager.UPDATE_WHEN_USER_REQUESTED);
- a2.findUpdates(compatListener, AddonManager.UPDATE_WHEN_ADDON_INSTALLED);
- a3.findUpdates(updateListener, AddonManager.UPDATE_WHEN_PERIODIC_UPDATE);
- a4.findUpdates(updateListener, AddonManager.UPDATE_WHEN_NEW_APP_DETECTED, "2");
- a5.findUpdates(compatListener, AddonManager.UPDATE_WHEN_NEW_APP_INSTALLED);
- a6.findUpdates(updateListener, AddonManager.UPDATE_WHEN_NEW_APP_INSTALLED);
+ a1_2.findUpdates(updateListener, AddonManager.UPDATE_WHEN_USER_REQUESTED);
+ a2_2.findUpdates(compatListener, AddonManager.UPDATE_WHEN_ADDON_INSTALLED);
+ a3_2.findUpdates(updateListener, AddonManager.UPDATE_WHEN_PERIODIC_UPDATE);
+ a4_2.findUpdates(updateListener, AddonManager.UPDATE_WHEN_NEW_APP_DETECTED, "2");
+ a5_2.findUpdates(compatListener, AddonManager.UPDATE_WHEN_NEW_APP_INSTALLED);
+ a6_2.findUpdates(updateListener, AddonManager.UPDATE_WHEN_NEW_APP_INSTALLED);
});
}));
});
// Tests that if an install.rdf claims compatibility then the add-on will be
// seen as compatible regardless of what the update.rdf says.
add_test(function run_test_9() {
writeInstallRDFForExtension({
@@ -970,34 +970,34 @@ for (let test of testParams) {
onInstallEnded: function() {
do_execute_soon(function install_2_1_ended() {
restartManager();
AddonManager.getAddonByID("addon2@tests.mozilla.org", function(a1) {
do_check_neq(a1.syncGUID, null);
let oldGUID = a1.syncGUID;
- let url = "http://localhost:" + gPort + "/addons/test_install2_2.xpi";
- AddonManager.getInstallForURL(url, function(aInstall) {
- aInstall.addListener({
+ let url_2 = "http://localhost:" + gPort + "/addons/test_install2_2.xpi";
+ AddonManager.getInstallForURL(url_2, function(aInstall_2) {
+ aInstall_2.addListener({
onInstallEnded: function() {
do_execute_soon(function install_2_2_ended() {
restartManager();
AddonManager.getAddonByID("addon2@tests.mozilla.org", function(a2) {
do_check_neq(a2.syncGUID, null);
do_check_eq(oldGUID, a2.syncGUID);
a2.uninstall();
run_next_test();
});
});
}
});
- aInstall.install();
+ aInstall_2.install();
}, "application/x-xpinstall");
});
});
}
});
aInstall.install();
}, "application/x-xpinstall");
});
--- a/toolkit/mozapps/extensions/test/xpcshell/test_update_compatmode.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_update_compatmode.js
@@ -93,17 +93,17 @@ function run_test_1() {
onCompatibilityUpdateAvailable: function() {
do_throw("Should have not have seen compatibility information");
},
onNoUpdateAvailable: function() {
do_throw("Should have seen an available update");
},
- onUpdateAvailable: function(addon, install) {
+ onUpdateAvailable: function(unused, install) {
do_check_eq(install.version, "2.0")
},
onUpdateFinished: function() {
run_test_2();
}
}, AddonManager.UPDATE_WHEN_USER_REQUESTED);
});
@@ -119,17 +119,17 @@ function run_test_2() {
onCompatibilityUpdateAvailable: function() {
do_throw("Should have not have seen compatibility information");
},
onNoUpdateAvailable: function() {
do_throw("Should have seen an available update");
},
- onUpdateAvailable: function(addon, install) {
+ onUpdateAvailable: function(unused, install) {
do_check_eq(install.version, "2.0")
},
onUpdateFinished: function() {
run_test_3();
}
}, AddonManager.UPDATE_WHEN_USER_REQUESTED);
});
@@ -141,17 +141,17 @@ function run_test_3() {
Services.prefs.setBoolPref(PREF_EM_STRICT_COMPATIBILITY, false);
AddonManager.getAddonByID("compatmode-strict-optin@tests.mozilla.org", function(addon) {
do_check_neq(addon, null);
addon.findUpdates({
onCompatibilityUpdateAvailable: function() {
do_throw("Should have not have seen compatibility information");
},
- onUpdateAvailable: function(addon, install) {
+ onUpdateAvailable: function() {
do_throw("Should not have seen an available update");
},
onUpdateFinished: function() {
run_test_4();
}
}, AddonManager.UPDATE_WHEN_USER_REQUESTED);
});
@@ -167,17 +167,17 @@ function run_test_4() {
onCompatibilityUpdateAvailable: function() {
do_throw("Should have not have seen compatibility information");
},
onNoUpdateAvailable: function() {
do_throw("Should have seen an available update");
},
- onUpdateAvailable: function(addon, install) {
+ onUpdateAvailable: function(unused, install) {
do_check_eq(install.version, "2.0")
},
onUpdateFinished: function() {
end_test();
}
}, AddonManager.UPDATE_WHEN_USER_REQUESTED);
});
--- a/toolkit/mozapps/extensions/test/xpcshell/test_update_strictcompat.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_update_strictcompat.js
@@ -47,17 +47,17 @@ let testParams = [
appId: "xpcshell@tests.mozilla.org" },
{ updateFile: "test_update.json",
appId: "toolkit@mozilla.org" },
];
for (let test of testParams) {
let { updateFile, appId } = test;
- add_test(function run_test() {
+ add_test(function() {
writeInstallRDFForExtension({
id: "addon1@tests.mozilla.org",
version: "1.0",
updateURL: "http://localhost:" + gPort + "/data/" + updateFile,
targetApplications: [{
id: appId,
minVersion: "1",
maxVersion: "1"
@@ -135,36 +135,36 @@ for (let test of testParams) {
do_check_eq(install.name, addon.name);
do_check_eq(install.version, "2.0");
do_check_eq(install.state, AddonManager.STATE_AVAILABLE);
do_check_eq(install.existingAddon, addon);
do_check_eq(install.releaseNotesURI.spec, "http://example.com/updateInfo.xhtml");
// Verify that another update check returns the same AddonInstall
a1.findUpdates({
- onNoCompatibilityUpdateAvailable: function(addon) {
+ onNoCompatibilityUpdateAvailable: function() {
ok(false, "Should not have seen onNoCompatibilityUpdateAvailable notification");
},
onUpdateAvailable: function(newAddon, newInstall) {
- AddonManager.getAllInstalls(function(aInstalls) {
- do_check_eq(aInstalls.length, 1);
- do_check_eq(aInstalls[0], install);
+ AddonManager.getAllInstalls(function(aInstalls2) {
+ do_check_eq(aInstalls2.length, 1);
+ do_check_eq(aInstalls2[0], install);
do_check_eq(newAddon, addon);
do_check_eq(newInstall, install);
prepare_test({}, [
"onDownloadStarted",
"onDownloadEnded",
], check_test_1);
install.install();
});
},
- onNoUpdateAvailable: function(addon) {
+ onNoUpdateAvailable: function() {
ok(false, "Should not have seen onNoUpdateAvailable notification");
}
}, AddonManager.UPDATE_WHEN_USER_REQUESTED);
});
},
onNoUpdateAvailable: function(addon) {
ok(false, "Should not have seen onNoUpdateAvailable notification");
@@ -185,17 +185,17 @@ for (let test of testParams) {
let check_test_2;
run_test_2 = (install) => {
// Verify that another update check returns no new update
install.existingAddon.findUpdates({
onNoCompatibilityUpdateAvailable: function(addon) {
ok(false, "Should not have seen onNoCompatibilityUpdateAvailable notification");
},
- onUpdateAvailable: function(addon, install) {
+ onUpdateAvailable: function() {
ok(false, "Should find no available update when one is already downloading");
},
onNoUpdateAvailable: function(addon) {
AddonManager.getAllInstalls(function(aInstalls) {
do_check_eq(aInstalls.length, 1);
do_check_eq(aInstalls[0], install);
@@ -575,26 +575,26 @@ for (let test of testParams) {
});
AddonManager.getAddonsByIDs(["addon1@tests.mozilla.org",
"addon2@tests.mozilla.org",
"addon3@tests.mozilla.org",
"addon4@tests.mozilla.org",
"addon5@tests.mozilla.org",
"addon6@tests.mozilla.org"],
- function([a1, a2, a3, a4, a5, a6]) {
+ function([a1_2, a2_2, a3_2, a4_2, a5_2, a6_2]) {
let count = 6;
function next_test() {
- a1.uninstall();
- a2.uninstall();
- a3.uninstall();
- a4.uninstall();
- a5.uninstall();
- a6.uninstall();
+ a1_2.uninstall();
+ a2_2.uninstall();
+ a3_2.uninstall();
+ a4_2.uninstall();
+ a5_2.uninstall();
+ a6_2.uninstall();
restartManager();
run_next_test();
}
let compatListener = {
onUpdateFinished: function(addon, error) {
if (--count == 0)
@@ -608,22 +608,22 @@ for (let test of testParams) {
},
onUpdateFinished: function(addon, error) {
if (--count == 0)
do_execute_soon(next_test);
}
};
- a1.findUpdates(updateListener, AddonManager.UPDATE_WHEN_USER_REQUESTED);
- a2.findUpdates(compatListener, AddonManager.UPDATE_WHEN_ADDON_INSTALLED);
- a3.findUpdates(updateListener, AddonManager.UPDATE_WHEN_PERIODIC_UPDATE);
- a4.findUpdates(updateListener, AddonManager.UPDATE_WHEN_NEW_APP_DETECTED, "2");
- a5.findUpdates(compatListener, AddonManager.UPDATE_WHEN_NEW_APP_INSTALLED);
- a6.findUpdates(updateListener, AddonManager.UPDATE_WHEN_NEW_APP_INSTALLED);
+ a1_2.findUpdates(updateListener, AddonManager.UPDATE_WHEN_USER_REQUESTED);
+ a2_2.findUpdates(compatListener, AddonManager.UPDATE_WHEN_ADDON_INSTALLED);
+ a3_2.findUpdates(updateListener, AddonManager.UPDATE_WHEN_PERIODIC_UPDATE);
+ a4_2.findUpdates(updateListener, AddonManager.UPDATE_WHEN_NEW_APP_DETECTED, "2");
+ a5_2.findUpdates(compatListener, AddonManager.UPDATE_WHEN_NEW_APP_INSTALLED);
+ a6_2.findUpdates(updateListener, AddonManager.UPDATE_WHEN_NEW_APP_INSTALLED);
});
}));
});
// Tests that if an install.rdf claims compatibility then the add-on will be
// seen as compatible regardless of what the update.rdf says.
add_test(function run_test_9() {
writeInstallRDFForExtension({
--- a/toolkit/mozapps/extensions/test/xpcshell/test_webextension.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_webextension.js
@@ -153,39 +153,39 @@ add_task(function*() {
do_check_true(file.exists());
addon.uninstall();
yield promiseRestartManager();
});
add_task(function* test_manifest_localization() {
- const ID = "webextension3@tests.mozilla.org";
+ const extensionId = "webextension3@tests.mozilla.org";
yield promiseInstallAllFiles([do_get_addon("webextension_3")], true);
yield promiseAddonStartup();
- let addon = yield promiseAddonByID(ID);
+ let addon = yield promiseAddonByID(extensionId);
addon.userDisabled = true;
equal(addon.name, "Web Extensiøn foo ☹");
equal(addon.description, "Descriptïon bar ☹ of add-on");
Services.prefs.setCharPref(PREF_SELECTED_LOCALE, "fr-FR");
yield promiseRestartManager();
- addon = yield promiseAddonByID(ID);
+ addon = yield promiseAddonByID(extensionId);
equal(addon.name, "Web Extensiøn le foo ☺");
equal(addon.description, "Descriptïon le bar ☺ of add-on");
Services.prefs.setCharPref(PREF_SELECTED_LOCALE, "de");
yield promiseRestartManager();
- addon = yield promiseAddonByID(ID);
+ addon = yield promiseAddonByID(extensionId);
equal(addon.name, "Web Extensiøn foo ☹");
equal(addon.description, "Descriptïon bar ☹ of add-on");
addon.uninstall();
});
// Missing version should cause a failure
@@ -257,27 +257,27 @@ add_task(function*() {
yield promiseRestartManager();
});
// Test that the "options_ui" manifest section is processed correctly.
add_task(function* test_options_ui() {
let OPTIONS_RE = /^moz-extension:\/\/[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}\/options\.html$/;
- const ID = "webextension@tests.mozilla.org";
+ const extensionId = "webextension@tests.mozilla.org";
yield promiseInstallWebExtension({
manifest: {
- applications: {gecko: {id: ID}},
+ applications: {gecko: {id: extensionId}},
"options_ui": {
"page": "options.html",
},
},
});
- let addon = yield promiseAddonByID(ID);
+ let addon = yield promiseAddonByID(extensionId);
equal(addon.optionsType, AddonManager.OPTIONS_TYPE_INLINE_BROWSER,
"Addon should have an INLINE_BROWSER options type");
ok(OPTIONS_RE.test(addon.optionsURL),
"Addon should have a moz-extension: options URL for /options.html");
addon.uninstall();
@@ -328,33 +328,33 @@ add_task(function* test_experiments_depe
});
// Test that experiments API extensions install correctly.
add_task(function* test_experiments_api() {
if (AppConstants.RELEASE_OR_BETA)
// Experiments are not enabled on release builds.
return;
- const ID = "meh@experiments.addons.mozilla.org";
+ const extensionId = "meh@experiments.addons.mozilla.org";
let addonFile = createTempXPIFile({
- id: ID,
+ id: extensionId,
type: 256,
version: "0.1",
name: "Meh API",
});
yield promiseInstallAllFiles([addonFile]);
let addons = yield new Promise(resolve => AddonManager.getAddonsByTypes(["apiextension"], resolve));
let addon = addons.pop();
- equal(addon.id, ID, "Add-on should be installed as an API extension");
+ equal(addon.id, extensionId, "Add-on should be installed as an API extension");
addons = yield new Promise(resolve => AddonManager.getAddonsByTypes(["extension"], resolve));
- equal(addons.pop().id, ID, "Add-on type should be aliased to extension");
+ equal(addons.pop().id, extensionId, "Add-on type should be aliased to extension");
addon.uninstall();
});
add_task(function* developerShouldOverride() {
let addon = yield promiseInstallWebExtension({
manifest: {
default_locale: "en",
--- a/toolkit/mozapps/extensions/test/xpcshell/test_webextension_icons.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_webextension_icons.js
@@ -46,18 +46,18 @@ add_task(function*() {
yield promiseRestartManager();
yield promiseAddonStartup();
let uri = do_get_addon_root_uri(profileDir, ID);
let addon = yield promiseAddonByID(ID);
do_check_neq(addon, null);
- function check_icons(addon) {
- deepEqual(addon.icons, {
+ function check_icons(addon_copy) {
+ deepEqual(addon_copy.icons, {
16: uri + "icon16.png",
32: uri + "icon32.png",
48: uri + "icon48.png",
64: uri + "icon64.png"
});
// iconURL should map to icons[48] and icons[64]
equal(addon.iconURL, uri + "icon48.png");
--- a/toolkit/mozapps/extensions/test/xpcshell/test_webextension_install.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_webextension_install.js
@@ -418,39 +418,39 @@ add_task(function* test_strict_min_max()
notEqual(addon, null, "Add-on is installed");
equal(addon.id, newId, "Installed add-on has the expected ID");
yield extension.unload();
// * in min will throw an error
for (let version of ["0.*", "0.*.0"]) {
newId = "strict_min_star@tests.mozilla.org";
- let apps = {
+ let minStarApps = {
applications: {
gecko: {
id: newId,
strict_min_version: version,
},
},
}
- let testManifest = Object.assign(apps, MANIFEST);
+ let minStarTestManifest = Object.assign(minStarApps, MANIFEST);
- let extension = ExtensionTestUtils.loadExtension({
- manifest: testManifest,
+ let minStarExtension = ExtensionTestUtils.loadExtension({
+ manifest: minStarTestManifest,
useAddonManager: "temporary",
});
yield Assert.rejects(
- extension.startup(),
+ minStarExtension.startup(),
/The use of '\*' in strict_min_version is invalid/,
"loading an extension with a * in strict_min_version throws an exception");
- let addon = yield promiseAddonByID(newId);
- equal(addon, null, "Add-on is not installed");
+ let minStarAddon = yield promiseAddonByID(newId);
+ equal(minStarAddon, null, "Add-on is not installed");
}
// incompatible extension but with compatibility checking off
newId = "checkCompatibility@tests.mozilla.org";
apps = {
applications: {
gecko: {
id: newId,