new file mode 100644
--- /dev/null
+++ b/browser/base/.eslintrc.js
@@ -0,0 +1,11 @@
+"use strict";
+
+module.exports = {
+ "rules": {
+ "no-unused-vars": ["error", {
+ "vars": "local",
+ "varsIgnorePattern": "^Cc|Ci|Cu|Cr|EXPORTED_SYMBOLS",
+ "args": "none",
+ }]
+ }
+};
--- a/browser/base/content/aboutDialog-appUpdater.js
+++ b/browser/base/content/aboutDialog-appUpdater.js
@@ -361,17 +361,16 @@ appUpdater.prototype =
break;
case Components.results.NS_BINDING_ABORTED:
// Do not remove UI listener since the user may resume downloading again.
break;
case Components.results.NS_OK:
this.removeDownloadListener();
if (this.backgroundUpdateEnabled) {
this.selectPanel("applying");
- let update = this.um.activeUpdate;
let self = this;
Services.obs.addObserver(function (aSubject, aTopic, aData) {
// Update the UI when the background updater is finished
let status = aData;
if (status == "applied" || status == "applied-service" ||
status == "pending" || status == "pending-service" ||
status == "pending-elevate") {
// If the update is successfully applied, or if the updater has
--- a/browser/base/content/browser-data-submission-info-bar.js
+++ b/browser/base/content/browser-data-submission-info-bar.js
@@ -64,17 +64,17 @@ var gDataNotificationInfoBar = {
popup: null,
callback: () => {
this._actionTaken = true;
window.openAdvancedPreferences("dataChoicesTab");
},
}];
this._log.info("Creating data reporting policy notification.");
- let notification = this._notificationBox.appendNotification(
+ this._notificationBox.appendNotification(
message,
this._DATA_REPORTING_NOTIFICATION,
null,
this._notificationBox.PRIORITY_INFO_HIGH,
buttons,
event => {
if (event == "removed") {
Services.obs.notifyObservers(null, "datareporting:notify-data-policy:close", null);
@@ -120,9 +120,8 @@ var gDataNotificationInfoBar = {
}
},
QueryInterface: XPCOMUtils.generateQI([
Ci.nsIObserver,
Ci.nsISupportsWeakReference,
]),
};
-
--- a/browser/base/content/browser-places.js
+++ b/browser/base/content/browser-places.js
@@ -747,19 +747,16 @@ HistoryMenu.prototype = {
},
/**
* Populate when the history menu is opened
*/
populateUndoWindowSubmenu: function PHM_populateUndoWindowSubmenu() {
let undoMenu = this._rootElt.getElementsByClassName("recentlyClosedWindowsMenu")[0];
let undoPopup = undoMenu.firstChild;
- let menuLabelString = gNavigatorBundle.getString("menuUndoCloseWindowLabel");
- let menuLabelStringSingleTab =
- gNavigatorBundle.getString("menuUndoCloseWindowSingleTabLabel");
// remove existing menu items
while (undoPopup.hasChildNodes())
undoPopup.removeChild(undoPopup.firstChild);
// no restorable windows, so make sure menu is disabled, and return
if (SessionStore.getClosedWindowCount() == 0) {
undoMenu.setAttribute("disabled", true);
--- a/browser/base/content/browser-plugins.js
+++ b/browser/base/content/browser-plugins.js
@@ -190,17 +190,16 @@ var gPluginHandler = {
aPluginInfo.fallbackType = Ci.nsIObjectLoadingContent.PLUGIN_ACTIVE;
break;
default:
Cu.reportError(Error("Unexpected plugin state: " + aNewState));
return;
}
let browser = aNotification.browser;
- let contentWindow = browser.contentWindow;
if (aNewState != "continue") {
let principal = aNotification.options.principal;
Services.perms.addFromPrincipal(principal, aPluginInfo.permissionString,
permission, expireType, expireTime);
aPluginInfo.pluginPermissionType = expireType;
}
browser.messageManager.sendAsyncMessage("BrowserPlugins:ActivatePlugins", {
--- a/browser/base/content/browser-syncui.js
+++ b/browser/base/content/browser-syncui.js
@@ -436,20 +436,16 @@ var gSyncUI = {
dateFormat = {month: 'long', day: 'numeric'};
} else {
dateFormat = {weekday: 'long', hour: 'numeric', minute: 'numeric'};
}
let lastSyncDateString = date.toLocaleDateString(undefined, dateFormat);
return this._stringBundle.formatStringFromName("lastSync2.label", [lastSyncDateString], 1);
},
- onSyncFinish: function SUI_onSyncFinish() {
- let title = this._stringBundle.GetStringFromName("error.sync.title");
- },
-
onClientsSynced: function() {
let broadcaster = document.getElementById("sync-syncnow-state");
if (broadcaster) {
if (Weave.Service.clientsEngine.stats.numClients > 1) {
broadcaster.setAttribute("devices-status", "multi");
} else {
broadcaster.setAttribute("devices-status", "single");
}
@@ -479,17 +475,17 @@ var gSyncUI = {
case "weave:service:sync:error":
this.onActivityStop();
break;
}
// Now non-activity state (eg, enabled, errors, etc)
// Note that sync uses the ":ui:" notifications for errors because sync.
switch (topic) {
case "weave:ui:sync:finish":
- this.onSyncFinish();
+ // Do nothing.
break;
case "weave:ui:sync:error":
case "weave:service:setup-complete":
case "weave:service:login:finish":
case "weave:service:login:start":
case "weave:service:start-over":
this.updateUI();
break;
--- a/browser/base/content/browser-tabsintitlebar.js
+++ b/browser/base/content/browser-tabsintitlebar.js
@@ -111,18 +111,16 @@ var TabsInTitlebar = {
// In some edgecases it is possible for this to fire before we've initialized.
// Don't run now, but don't forget to run it when we do initialize.
if (!this._initialized) {
this._updateOnInit = true;
return;
}
- let allowed = true;
-
if (!aForce) {
// _update is called on resize events, because the window is not ready
// after sizemode events. However, we only care about the event when the
// sizemode is different from the last time we updated the appearance of
// the tabs in the titlebar.
let sizemode = document.documentElement.getAttribute("sizemode");
if (this._lastSizeMode == sizemode) {
return;
@@ -133,20 +131,17 @@ var TabsInTitlebar = {
// still changing in the consequent "fullscreen" event. Code there will
// call this function again when everything is ready.
// See browser-fullScreen.js: FullScreen.toggle and bug 1173768.
if (oldSizeMode == "fullscreen") {
return;
}
}
- for (let something in this._disallowed) {
- allowed = false;
- break;
- }
+ let allowed = (Object.keys(this._disallowed)).length == 0;
let titlebar = $("titlebar");
let titlebarContent = $("titlebar-content");
let menubar = $("toolbar-menubar");
if (allowed) {
// We set the tabsintitlebar attribute first so that our CSS for
// tabsintitlebar manifests before we do our measurements.
--- a/browser/base/content/browser.js
+++ b/browser/base/content/browser.js
@@ -616,17 +616,17 @@ var gPopupBlockerObserver = {
var target = aEvent.target;
var popupReportIndex = target.getAttribute("popupReportIndex");
let browser = target.popupReportBrowser;
browser.unblockPopup(popupReportIndex);
},
showAllBlockedPopups: function (aBrowser)
{
- let popups = aBrowser.retrieveListOfBlockedPopups().then(popups => {
+ aBrowser.retrieveListOfBlockedPopups().then(popups => {
for (let i = 0; i < popups.length; i++) {
if (popups[i].popupWindowURIspec)
aBrowser.unblockPopup(i);
}
}, null);
},
editPopupSettings: function ()
@@ -791,17 +791,16 @@ function gKeywordURIFixup({ target: brow
function _loadURIWithFlags(browser, uri, params) {
if (!uri) {
uri = "about:blank";
}
let flags = params.flags || 0;
let referrer = params.referrerURI;
let referrerPolicy = ('referrerPolicy' in params ? params.referrerPolicy :
Ci.nsIHttpChannel.REFERRER_POLICY_DEFAULT);
- let charset = params.charset;
let postData = params.postData;
let wasRemote = browser.isRemoteBrowser;
let process = browser.isRemoteBrowser ? Ci.nsIXULRuntime.PROCESS_TYPE_CONTENT
: Ci.nsIXULRuntime.PROCESS_TYPE_DEFAULT;
let mustChangeProcess = gMultiProcessBrowser &&
!E10SUtils.canLoadURIInProcess(uri, process);
@@ -3153,17 +3152,16 @@ function mirrorMenuItemClicked(event) {
{service: event.originalTarget._service});
}
function populateMirrorTabMenu(popup) {
popup.innerHTML = null;
if (!Services.prefs.getBoolPref("browser.casting.enabled")) {
return;
}
- let videoEl = this.target;
let doc = popup.ownerDocument;
let services = CastingApps.getServicesForMirroring();
services.forEach(service => {
let item = doc.createElement("menuitem");
item.setAttribute("label", service.friendlyName);
item._service = service;
item.addEventListener("command", mirrorMenuItemClicked);
popup.appendChild(item);
@@ -5706,17 +5704,17 @@ function handleDroppedLink(event, urlOrL
let lastLocationChange = gBrowser.selectedBrowser.lastLocationChange;
let userContextId = gBrowser.selectedBrowser.getAttribute("usercontextid");
// event is null if links are dropped in content process.
// inBackground should be false, as it's loading into current browser.
let inBackground = false;
if (event) {
- let inBackground = Services.prefs.getBoolPref("browser.tabs.loadInBackground");
+ inBackground = Services.prefs.getBoolPref("browser.tabs.loadInBackground");
if (event.shiftKey)
inBackground = !inBackground;
}
Task.spawn(function*() {
let urls = [];
let postDatas = [];
for (let link of links) {
--- a/browser/base/content/contentSearchUI.js
+++ b/browser/base/content/contentSearchUI.js
@@ -4,17 +4,16 @@
"use strict";
this.ContentSearchUIController = (function () {
const MAX_DISPLAYED_SUGGESTIONS = 6;
const SUGGESTION_ID_PREFIX = "searchSuggestion";
const ONE_OFF_ID_PREFIX = "oneOff";
-const CSS_URI = "chrome://browser/content/contentSearchUI.css";
const HTML_NS = "http://www.w3.org/1999/xhtml";
/**
* Creates a new object that manages search suggestions and their UI for a text
* box.
*
* The UI consists of an html:table that's inserted into the DOM after the given
--- a/browser/base/content/pageinfo/pageInfo.js
+++ b/browser/base/content/pageinfo/pageInfo.js
@@ -819,17 +819,16 @@ function onImageSelect()
tree.flex = 0;
makePreview(getSelectedRows(tree)[0]);
}
}
// Makes the media preview (image, video, etc) for the selected row on the media tab.
function makePreview(row)
{
- var imageTree = document.getElementById("imagetree");
var item = gImageView.data[row][COL_IMAGE_NODE];
var url = gImageView.data[row][COL_IMAGE_ADDRESS];
var isBG = gImageView.data[row][COL_IMAGE_BG];
var isAudio = false;
setItemValue("imageurltext", url);
setItemValue("imagetext", item.imageText);
setItemValue("imagelongdesctext", item.longDesc);
@@ -1010,17 +1009,16 @@ var imagePermissionObserver = {
if (document.getElementById("mediaPreviewBox").collapsed)
return;
if (aTopic == "perm-changed") {
var permission = aSubject.QueryInterface(Components.interfaces.nsIPermission);
if (permission.type == "image") {
var imageTree = document.getElementById("imagetree");
var row = getSelectedRow(imageTree);
- var item = gImageView.data[row][COL_IMAGE_NODE];
var url = gImageView.data[row][COL_IMAGE_ADDRESS];
if (permission.matchesURI(makeURI(url), true)) {
makeBlockImage(url);
}
}
}
}
}
--- a/browser/base/content/pageinfo/security.js
+++ b/browser/base/content/pageinfo/security.js
@@ -16,19 +16,16 @@ var security = {
// Display the server certificate (static)
viewCert : function () {
var cert = security._cert;
viewCertHelper(window, cert);
},
_getSecurityInfo : function() {
- const nsIX509Cert = Components.interfaces.nsIX509Cert;
- const nsIX509CertDB = Components.interfaces.nsIX509CertDB;
- const nsX509CertDB = "@mozilla.org/security/x509certdb;1";
const nsISSLStatusProvider = Components.interfaces.nsISSLStatusProvider;
const nsISSLStatus = Components.interfaces.nsISSLStatus;
// We don't have separate info for a frame, return null until further notice
// (see bug 138479)
if (!this.windowInfo.isTopWindow)
return null;
--- a/browser/base/content/safeMode.js
+++ b/browser/base/content/safeMode.js
@@ -60,17 +60,16 @@ function onExtra1() {
return true;
}
// The reset dialog will handle starting the reset process if the user confirms.
showResetDialog();
return false;
}
function onLoad() {
- let dialog = document.documentElement;
if (appStartup.automaticSafeModeNecessary) {
document.getElementById("autoSafeMode").hidden = false;
document.getElementById("safeMode").hidden = true;
if (ResetProfile.resetSupported()) {
document.getElementById("resetProfile").hidden = false;
} else {
// Hide the reset button is it's not supported.
document.documentElement.getButton("extra1").hidden = true;
--- a/browser/base/content/sync/aboutSyncTabs.js
+++ b/browser/base/content/sync/aboutSyncTabs.js
@@ -206,17 +206,17 @@ var RemoteTabViewer = {
_generateWeaveTabList: function () {
let engine = Weave.Service.engineManager.get("tabs");
let list = this._tabsList;
let seenURLs = new Set();
let localURLs = engine.getOpenURLs();
- for (let [guid, client] of Object.entries(engine.getAllClients())) {
+ for (let [, client] of Object.entries(engine.getAllClients())) {
// Create the client node, but don't add it in-case we don't show any tabs
let appendClient = true;
client.tabs.forEach(function({title, urlHistory, icon}) {
let url = urlHistory[0];
if (!url || localURLs.has(url) || seenURLs.has(url)) {
return;
}
--- a/browser/base/content/sync/genericChange.js
+++ b/browser/base/content/sync/genericChange.js
@@ -27,17 +27,16 @@ var Change = {
get _updatingPassphrase() {
return this._dialogType == "UpdatePassphrase";
},
onLoad: function Change_onLoad() {
/* Load labels */
let introText = document.getElementById("introText");
- let introText2 = document.getElementById("introText2");
let warningText = document.getElementById("warningText");
// load some other elements & info from the window
this._dialog = document.getElementById("change-dialog");
this._dialogType = window.arguments[0];
this._duringSetup = window.arguments[1];
this._status = document.getElementById("status");
this._statusIcon = document.getElementById("statusIcon");
--- a/browser/base/content/sync/setup.js
+++ b/browser/base/content/sync/setup.js
@@ -792,17 +792,16 @@ var gSyncSetup = {
}, 1000);
},
checkServer: function () {
delete this._checkServerTimer;
let el = document.getElementById("server");
let valid = false;
let feedback = document.getElementById("serverFeedbackRow");
- let str = "";
if (el.value) {
valid = this._validateServer(el);
let str = valid ? "" : "serverInvalid.label";
this._setFeedbackMessage(feedback, valid, str);
}
else
this._setFeedbackMessage(feedback, true);
--- a/browser/base/content/tab-content.js
+++ b/browser/base/content/tab-content.js
@@ -267,17 +267,16 @@ var AboutReaderListener = {
addEventListener("pagehide", this, false);
addMessageListener("Reader:ToggleReaderMode", this);
addMessageListener("Reader:PushState", this);
},
receiveMessage: function(message) {
switch (message.name) {
case "Reader:ToggleReaderMode":
- let url = content.document.location.href;
if (!this.isAboutReader) {
this._articlePromise = ReaderMode.parseDocument(content.document).catch(Cu.reportError);
ReaderMode.enterReaderMode(docShell, content);
} else {
this._isLeavingReaderMode = true;
ReaderMode.leaveReaderMode(docShell, content);
}
break;
--- a/browser/base/content/tabbrowser.xml
+++ b/browser/base/content/tabbrowser.xml
@@ -1750,17 +1750,17 @@
// Restore the securityUI state.
let securityUI = aBrowser.securityUI;
let state = securityUI ? securityUI.state
: Ci.nsIWebProgressListener.STATE_IS_INSECURE;
// Include the true final argument to indicate that this event is
// simulated (instead of being observed by the webProgressListener).
this._callProgressListeners(aBrowser, "onSecurityChange",
- [aBrowser.webProgress, null, securityUI.state, true],
+ [aBrowser.webProgress, null, state, true],
true, false);
if (aShouldBeRemote) {
// Switching the browser to be remote will connect to a new child
// process so the browser can no longer be considered to be
// crashed.
tab.removeAttribute("crashed");
} else {
@@ -3756,17 +3756,17 @@
},
// This function runs before every event. It fixes up the state
// to account for closed tabs.
preActions: function() {
this.assert(this.tabbrowser._switcher);
this.assert(this.tabbrowser._switcher === this);
- for (let [tab, state] of this.tabState) {
+ for (let [tab, ] of this.tabState) {
if (!tab.linkedBrowser) {
this.tabState.delete(tab);
}
}
if (this.lastVisibleTab && !this.lastVisibleTab.linkedBrowser) {
this.lastVisibleTab = null;
}
@@ -4715,17 +4715,16 @@
this._findAsYouType = Services.prefs.getBoolPref("accessibility.typeaheadfind");
break;
}
]]></body>
</method>
<constructor>
<![CDATA[
- let browserStack = document.getAnonymousElementByAttribute(this, "anonid", "browserStack");
this.mCurrentBrowser = document.getAnonymousElementByAttribute(this, "anonid", "initialBrowser");
this.mCurrentBrowser.permanentKey = {};
Services.obs.addObserver(this, "live-resize-start", false);
Services.obs.addObserver(this, "live-resize-end", false);
this.mCurrentTab = this.tabContainer.firstChild;
const nsIEventListenerService =
@@ -5562,17 +5561,16 @@
if (!("animLastScreenX" in draggedTab._dragData))
draggedTab._dragData.animLastScreenX = draggedTab._dragData.screenX;
let screenX = event.screenX;
if (screenX == draggedTab._dragData.animLastScreenX)
return;
- let draggingRight = screenX > draggedTab._dragData.animLastScreenX;
draggedTab._dragData.animLastScreenX = screenX;
let rtl = (window.getComputedStyle(this).direction == "rtl");
let pinned = draggedTab.pinned;
let numPinned = this.tabbrowser._numPinnedTabs;
let tabs = this.tabbrowser.visibleTabs
.slice(pinned ? 0 : numPinned,
pinned ? numPinned : undefined);
@@ -7127,18 +7125,16 @@
</getter>
<setter>
<![CDATA[
if (val < 0 || val >= this.childNodes.length)
return val;
let toTab = this.getRelatedElement(this.childNodes[val]);
- let fromTab = this._selectedPanel ? this.getRelatedElement(this._selectedPanel)
- : null;
gBrowser._getSwitcher().requestTab(toTab);
var panel = this._selectedPanel;
var newPanel = this.childNodes[val];
this._selectedPanel = newPanel;
if (this._selectedPanel != panel) {
var event = document.createEvent("Events");
--- a/browser/base/content/test/alerts/browser_notification_close.js
+++ b/browser/base/content/test/alerts/browser_notification_close.js
@@ -1,14 +1,13 @@
"use strict";
const {PlacesTestUtils} =
Cu.import("resource://testing-common/PlacesTestUtils.jsm", {});
-let tab;
let notificationURL = "http://example.org/browser/browser/base/content/test/alerts/file_dom_notifications.html";
let oldShowFavicons;
add_task(function* test_notificationClose() {
let pm = Services.perms;
let notificationURI = makeURI(notificationURL);
pm.add(notificationURI, "desktop-notification", pm.ALLOW_ACTION);
@@ -48,17 +47,17 @@ add_task(function* test_notificationClos
let alertCloseButton = alertWindow.document.querySelector(".alertCloseButton");
is(alertCloseButton.localName, "toolbarbutton", "close button found");
let promiseBeforeUnloadEvent =
BrowserTestUtils.waitForEvent(alertWindow, "beforeunload");
let closedTime = alertWindow.Date.now();
alertCloseButton.click();
info("Clicked on close button");
- let beforeUnloadEvent = yield promiseBeforeUnloadEvent;
+ yield promiseBeforeUnloadEvent;
ok(true, "Alert should close when the close button is clicked");
let currentTime = alertWindow.Date.now();
// The notification will self-close at 12 seconds, so this checks
// that the notification closed before the timeout.
ok(currentTime - closedTime < 5000,
"Close requested at " + closedTime + ", actually closed at " + currentTime);
});
--- a/browser/base/content/test/general/browser_aboutAccounts.js
+++ b/browser/base/content/test/general/browser_aboutAccounts.js
@@ -124,17 +124,17 @@ var gTests = [
},
{
desc: "Test action=signin - captive portal",
teardown: () => gBrowser.removeCurrentTab(),
run: function* ()
{
const signinUrl = "https://redirproxy.example.com/test";
setPref("identity.fxaccounts.remote.signin.uri", signinUrl);
- let [tab, url] = yield promiseNewTabWithIframeLoadEvent("about:accounts?action=signin");
+ let [tab, ] = yield promiseNewTabWithIframeLoadEvent("about:accounts?action=signin");
yield checkVisibilities(tab, {
stage: true, // parent of 'manage' and 'intro'
manage: false,
intro: false, // this is "get started"
remote: false,
networkError: true
});
}
@@ -147,17 +147,17 @@ var gTests = [
},
run: function* ()
{
BrowserOffline.toggleOfflineStatus();
Services.cache2.clear();
const signinUrl = "https://unknowndomain.cow";
setPref("identity.fxaccounts.remote.signin.uri", signinUrl);
- let [tab, url] = yield promiseNewTabWithIframeLoadEvent("about:accounts?action=signin");
+ let [tab, ] = yield promiseNewTabWithIframeLoadEvent("about:accounts?action=signin");
yield checkVisibilities(tab, {
stage: true, // parent of 'manage' and 'intro'
manage: false,
intro: false, // this is "get started"
remote: false,
networkError: true
});
}
@@ -206,28 +206,19 @@ var gTests = [
teardown: function* () {
gBrowser.removeCurrentTab();
yield signOut();
},
run: function* ()
{
const expected_url = "https://example.com/?is_force_auth";
setPref("identity.fxaccounts.remote.force_auth.uri", expected_url);
- let userData = {
- email: "foo@example.com",
- uid: "1234@lcip.org",
- assertion: "foobar",
- sessionToken: "dead",
- kA: "beef",
- kB: "cafe",
- verified: true
- };
yield setSignedInUser();
- let [tab, url] = yield promiseNewTabWithIframeLoadEvent("about:accounts?action=reauth");
+ let [, url] = yield promiseNewTabWithIframeLoadEvent("about:accounts?action=reauth");
// The current user will be appended to the url
let expected = expected_url + "&email=foo%40example.com";
is(url, expected, "action=reauth got the expected URL");
},
},
{
desc: "Test with migrateToDevEdition enabled (success)",
teardown: function* () {
@@ -346,69 +337,69 @@ var gTests = [
}
},
{
desc: "Test entrypoint query string, no action, no user logged in",
teardown: () => gBrowser.removeCurrentTab(),
run: function* () {
// When this loads with no user logged-in, we expect the "normal" URL
setPref("identity.fxaccounts.remote.signup.uri", "https://example.com/");
- let [tab, url] = yield promiseNewTabWithIframeLoadEvent("about:accounts?entrypoint=abouthome");
+ let [, url] = yield promiseNewTabWithIframeLoadEvent("about:accounts?entrypoint=abouthome");
is(url, "https://example.com/?entrypoint=abouthome", "entrypoint=abouthome got the expected URL");
},
},
{
desc: "Test entrypoint query string for signin",
teardown: () => gBrowser.removeCurrentTab(),
run: function* () {
// When this loads with no user logged-in, we expect the "normal" URL
const expected_url = "https://example.com/?is_sign_in";
setPref("identity.fxaccounts.remote.signin.uri", expected_url);
- let [tab, url] = yield promiseNewTabWithIframeLoadEvent("about:accounts?action=signin&entrypoint=abouthome");
+ let [, url] = yield promiseNewTabWithIframeLoadEvent("about:accounts?action=signin&entrypoint=abouthome");
is(url, expected_url + "&entrypoint=abouthome", "entrypoint=abouthome got the expected URL");
},
},
{
desc: "Test entrypoint query string for signup",
teardown: () => gBrowser.removeCurrentTab(),
run: function* () {
// When this loads with no user logged-in, we expect the "normal" URL
const sign_up_url = "https://example.com/?is_sign_up";
setPref("identity.fxaccounts.remote.signup.uri", sign_up_url);
- let [tab, url] = yield promiseNewTabWithIframeLoadEvent("about:accounts?entrypoint=abouthome&action=signup");
+ let [, url] = yield promiseNewTabWithIframeLoadEvent("about:accounts?entrypoint=abouthome&action=signup");
is(url, sign_up_url + "&entrypoint=abouthome", "entrypoint=abouthome got the expected URL");
},
},
{
desc: "about:accounts URL params should be copied to remote URL params " +
"when remote URL has no URL params, except for 'action'",
teardown() {
gBrowser.removeCurrentTab();
},
run: function* () {
let signupURL = "https://example.com/";
setPref("identity.fxaccounts.remote.signup.uri", signupURL);
let queryStr = "email=foo%40example.com&foo=bar&baz=quux";
- let [tab, url] =
+ let [, url] =
yield promiseNewTabWithIframeLoadEvent("about:accounts?" + queryStr +
"&action=action");
is(url, signupURL + "?" + queryStr, "URL params are copied to signup URL");
},
},
{
desc: "about:accounts URL params should be copied to remote URL params " +
"when remote URL already has some URL params, except for 'action'",
teardown() {
gBrowser.removeCurrentTab();
},
run: function* () {
let signupURL = "https://example.com/?param";
setPref("identity.fxaccounts.remote.signup.uri", signupURL);
let queryStr = "email=foo%40example.com&foo=bar&baz=quux";
- let [tab, url] =
+ let [, url] =
yield promiseNewTabWithIframeLoadEvent("about:accounts?" + queryStr +
"&action=action");
is(url, signupURL + "&" + queryStr, "URL params are copied to signup URL");
},
},
]; // gTests
function test()
--- a/browser/base/content/test/general/browser_aboutCertError.js
+++ b/browser/base/content/test/general/browser_aboutCertError.js
@@ -82,17 +82,17 @@ add_task(function* checkReturnToPrevious
is(browser.webNavigation.canGoForward, true, "webNavigation.canGoForward");
is(gBrowser.currentURI.spec, GOOD_PAGE, "Went back");
yield BrowserTestUtils.removeTab(gBrowser.selectedTab);
});
add_task(function* checkBadStsCert() {
info("Loading a badStsCert and making sure exception button doesn't show up");
- let tab = yield BrowserTestUtils.openNewForegroundTab(gBrowser, GOOD_PAGE);
+ yield BrowserTestUtils.openNewForegroundTab(gBrowser, GOOD_PAGE);
let browser = gBrowser.selectedBrowser;
info("Loading and waiting for the cert error");
let certErrorLoaded = waitForCertErrorLoad(browser);
BrowserTestUtils.loadURI(browser, BAD_STS_CERT);
yield certErrorLoaded;
let exceptionButtonHidden = yield ContentTask.spawn(browser, null, function* () {
@@ -106,17 +106,17 @@ add_task(function* checkBadStsCert() {
});
const PREF_BLOCKLIST_CLOCK_SKEW_SECONDS = "services.blocklist.clock_skew_seconds";
add_task(function* checkWrongSystemTimeWarning() {
function* setUpPage() {
let browser;
let certErrorLoaded;
- let tab = yield BrowserTestUtils.openNewForegroundTab(gBrowser, () => {
+ yield BrowserTestUtils.openNewForegroundTab(gBrowser, () => {
gBrowser.selectedTab = gBrowser.addTab(BAD_CERT);
browser = gBrowser.selectedBrowser;
certErrorLoaded = waitForCertErrorLoad(browser);
}, false);
info("Loading and waiting for the cert error");
yield certErrorLoaded;
@@ -206,17 +206,17 @@ add_task(function* checkWrongSystemTimeW
yield BrowserTestUtils.removeTab(gBrowser.selectedTab);
});
add_task(function* checkAdvancedDetails() {
info("Loading a bad cert page and verifying the advanced details section");
let browser;
let certErrorLoaded;
- let tab = yield BrowserTestUtils.openNewForegroundTab(gBrowser, () => {
+ yield BrowserTestUtils.openNewForegroundTab(gBrowser, () => {
gBrowser.selectedTab = gBrowser.addTab(BAD_CERT);
browser = gBrowser.selectedBrowser;
certErrorLoaded = waitForCertErrorLoad(browser);
}, false);
info("Loading and waiting for the cert error");
yield certErrorLoaded;
@@ -233,19 +233,16 @@ add_task(function* checkAdvancedDetails(
message = yield ContentTask.spawn(browser, null, function* () {
let doc = content.document;
let errorCode = doc.getElementById("errorCode");
errorCode.click();
let div = doc.getElementById("certificateErrorDebugInformation");
let text = doc.getElementById("certificateErrorText");
- let docshell = content.QueryInterface(Ci.nsIInterfaceRequestor)
- .getInterface(Ci.nsIWebNavigation)
- .QueryInterface(Ci.nsIDocShell);
let serhelper = Cc["@mozilla.org/network/serialization-helper;1"]
.getService(Ci.nsISerializationHelper);
let serializable = docShell.failedChannel.securityInfo
.QueryInterface(Ci.nsITransportSecurityInfo)
.QueryInterface(Ci.nsISerializable);
let serializedSecurityInfo = serhelper.serializeToString(serializable);
return {
divDisplay: content.getComputedStyle(div).display,
@@ -266,17 +263,17 @@ add_task(function* checkAdvancedDetails(
yield BrowserTestUtils.removeTab(gBrowser.selectedTab);
});
add_task(function* checkAdvancedDetailsForHSTS() {
info("Loading a bad STS cert page and verifying the advanced details section");
let browser;
let certErrorLoaded;
- let tab = yield BrowserTestUtils.openNewForegroundTab(gBrowser, () => {
+ yield BrowserTestUtils.openNewForegroundTab(gBrowser, () => {
gBrowser.selectedTab = gBrowser.addTab(BAD_STS_CERT);
browser = gBrowser.selectedBrowser;
certErrorLoaded = waitForCertErrorLoad(browser);
}, false);
info("Loading and waiting for the cert error");
yield certErrorLoaded;
@@ -305,19 +302,16 @@ add_task(function* checkAdvancedDetailsF
message = yield ContentTask.spawn(browser, null, function* () {
let doc = content.document;
let errorCode = doc.getElementById("errorCode");
errorCode.click();
let div = doc.getElementById("certificateErrorDebugInformation");
let text = doc.getElementById("certificateErrorText");
- let docshell = content.QueryInterface(Ci.nsIInterfaceRequestor)
- .getInterface(Ci.nsIWebNavigation)
- .QueryInterface(Ci.nsIDocShell);
let serhelper = Cc["@mozilla.org/network/serialization-helper;1"]
.getService(Ci.nsISerializationHelper);
let serializable = docShell.failedChannel.securityInfo
.QueryInterface(Ci.nsITransportSecurityInfo)
.QueryInterface(Ci.nsISerializable);
let serializedSecurityInfo = serhelper.serializeToString(serializable);
return {
divDisplay: content.getComputedStyle(div).display,
@@ -338,17 +332,17 @@ add_task(function* checkAdvancedDetailsF
yield BrowserTestUtils.removeTab(gBrowser.selectedTab);
});
add_task(function* checkUnknownIssuerLearnMoreLink() {
info("Loading a cert error for self-signed pages and checking the correct link is shown");
let browser;
let certErrorLoaded;
- let tab = yield BrowserTestUtils.openNewForegroundTab(gBrowser, () => {
+ yield BrowserTestUtils.openNewForegroundTab(gBrowser, () => {
gBrowser.selectedTab = gBrowser.addTab(UNKNOWN_ISSUER);
browser = gBrowser.selectedBrowser;
certErrorLoaded = waitForCertErrorLoad(browser);
}, false);
info("Loading and waiting for the cert error");
yield certErrorLoaded;
--- a/browser/base/content/test/general/browser_aboutNetError.js
+++ b/browser/base/content/test/general/browser_aboutNetError.js
@@ -10,17 +10,17 @@ Services.prefs.setIntPref("security.tls.
const LOW_TLS_VERSION = "https://tls1.example.com/";
const {TabStateFlusher} = Cu.import("resource:///modules/sessionstore/TabStateFlusher.jsm", {});
const ss = Cc["@mozilla.org/browser/sessionstore;1"].getService(Ci.nsISessionStore);
add_task(function* checkReturnToPreviousPage() {
info("Loading a TLS page that isn't supported, ensure we have a fix button and clicking it then loads the page");
let browser;
let pageLoaded;
- let tab = yield BrowserTestUtils.openNewForegroundTab(gBrowser, () => {
+ yield BrowserTestUtils.openNewForegroundTab(gBrowser, () => {
gBrowser.selectedTab = gBrowser.addTab(LOW_TLS_VERSION);
browser = gBrowser.selectedBrowser;
pageLoaded = BrowserTestUtils.waitForErrorPage(browser);
}, false);
info("Loading and waiting for the net error");
yield pageLoaded;
@@ -34,9 +34,8 @@ add_task(function* checkReturnToPrevious
content.document.getElementById("prefResetButton").click();
});
yield pageshowPromise;
Assert.equal(content.document.documentURI, LOW_TLS_VERSION, "Should not be showing page");
yield BrowserTestUtils.removeTab(gBrowser.selectedTab);
});
-
--- a/browser/base/content/test/general/browser_aboutTabCrashed_showForm.js
+++ b/browser/base/content/test/general/browser_aboutTabCrashed_showForm.js
@@ -11,18 +11,16 @@ requestLongerTimeout(2);
* Tests that we show the about:tabcrashed additional details form
* if the "submit a crash report" checkbox was checked by default.
*/
add_task(function* test_show_form() {
return BrowserTestUtils.withNewTab({
gBrowser,
url: PAGE,
}, function*(browser) {
- let tab = gBrowser.getTabForBrowser(browser);
-
// Flip the pref so that the checkbox should be checked
// by default.
let pref = TabCrashHandler.prefs.root + "sendReport";
yield pushPrefs([pref, true]);
// Now crash the browser.
yield BrowserTestUtils.crashBrowser(browser);
--- a/browser/base/content/test/general/browser_bug409624.js
+++ b/browser/base/content/test/general/browser_bug409624.js
@@ -21,19 +21,16 @@ add_task(function* test() {
}
},
});
});
let prefService = Cc["@mozilla.org/preferences-service;1"]
.getService(Components.interfaces.nsIPrefService);
- let findBar = gFindBar;
- let textbox = gFindBar.getElement("findbar-textbox");
-
let tempScope = {};
Cc["@mozilla.org/moz/jssubscript-loader;1"].getService(Ci.mozIJSSubScriptLoader)
.loadSubScript("chrome://browser/content/sanitize.js", tempScope);
let Sanitizer = tempScope.Sanitizer;
let s = new Sanitizer();
s.prefDomain = "privacy.cpd.";
let prefBranch = prefService.getBranch(s.prefDomain);
--- a/browser/base/content/test/general/browser_bug431826.js
+++ b/browser/base/content/test/general/browser_bug431826.js
@@ -14,18 +14,16 @@ add_task(function* () {
yield promise;
yield remote(() => {
// Confirm that we are displaying the contributed error page, not the default
let uri = content.document.documentURI;
Assert.ok(uri.startsWith("about:certerror"), "Broken page should go to about:certerror, not about:neterror");
});
- let advancedDiv, advancedDivVisibility, technicalDivCollapsed;
-
yield remote(() => {
let div = content.document.getElementById("badCertAdvancedPanel");
// Confirm that the expert section is collapsed
Assert.ok(div, "Advanced content div should exist");
Assert.equal(div.ownerGlobal.getComputedStyle(div).display,
"none", "Advanced content should not be visible by default");
});
--- a/browser/base/content/test/general/browser_bug460146.js
+++ b/browser/base/content/test/general/browser_bug460146.js
@@ -3,17 +3,16 @@
function test() {
waitForExplicitFinish();
gBrowser.selectedTab = gBrowser.addTab();
gBrowser.selectedBrowser.addEventListener("load", function () {
gBrowser.selectedBrowser.removeEventListener("load", arguments.callee, true);
- var doc = gBrowser.contentDocument;
var pageInfo = BrowserPageInfo(gBrowser.selectedBrowser.currentURI.spec,
"mediaTab");
pageInfo.addEventListener("load", function () {
pageInfo.removeEventListener("load", arguments.callee, true);
pageInfo.onFinished.push(function () {
executeSoon(function () {
var imageTree = pageInfo.document.getElementById("imagetree");
--- a/browser/base/content/test/general/browser_bug553455.js
+++ b/browser/base/content/test/general/browser_bug553455.js
@@ -1020,24 +1020,16 @@ function test_renotifyInstalled() {
Services.perms.remove(makeURI("http://example.com/"), "install");
yield removeTab();
});
},
function test_cancel() {
return Task.spawn(function* () {
- function complete_install(callback) {
- let url = TESTROOT + "slowinstall.sjs?continue=true"
- NetUtil.asyncFetch({
- uri: url,
- loadUsingSystemPrincipal: true
- }, callback || (() => {}));
- }
-
let pm = Services.perms;
pm.add(makeURI("http://example.com/"), "install", pm.ALLOW_ACTION);
let notificationPromise = waitForNotification(PROGRESS_NOTIFICATION);
let triggers = encodeURIComponent(JSON.stringify({
"XPI": "slowinstall.sjs?file=amosigned.xpi"
}));
BrowserTestUtils.openNewForegroundTab(gBrowser, TESTROOT + "installtrigger.html?" + triggers);
--- a/browser/base/content/test/general/browser_bug585830.js
+++ b/browser/base/content/test/general/browser_bug585830.js
@@ -1,16 +1,16 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
function test() {
let tab1 = gBrowser.selectedTab;
let tab2 = gBrowser.addTab("about:blank", {skipAnimation: true});
- let tab3 = gBrowser.addTab();
+ gBrowser.addTab();
gBrowser.selectedTab = tab2;
gBrowser.removeCurrentTab({animate: true});
gBrowser.tabContainer.advanceSelectedTab(-1, true);
is(gBrowser.selectedTab, tab1, "First tab should be selected");
gBrowser.removeTab(tab2);
// test for "null has no properties" fix. See Bug 585830 Comment 13
--- a/browser/base/content/test/general/browser_bug592338.js
+++ b/browser/base/content/test/general/browser_bug592338.js
@@ -52,20 +52,19 @@ function test_install_lwtheme() {
gBrowser.selectedTab = gBrowser.addTab("https://example.com/browser/browser/base/content/test/general/bug592338.html");
gBrowser.selectedBrowser.addEventListener("pageshow", function() {
if (gBrowser.contentDocument.location.href == "about:blank")
return;
gBrowser.selectedBrowser.removeEventListener("pageshow", arguments.callee, false);
BrowserTestUtils.synthesizeMouse("#theme-install", 2, 2, {}, gBrowser.selectedBrowser);
- let notification;
let notificationBox = gBrowser.getNotificationBox(gBrowser.selectedBrowser);
waitForCondition(
- () => (notification = notificationBox.getNotificationWithValue("lwtheme-install-notification")),
+ () => notificationBox.getNotificationWithValue("lwtheme-install-notification"),
() => {
is(LightweightThemeManager.currentTheme.id, "test", "Should have installed the test theme");
LightweightThemeManager.currentTheme = null;
gBrowser.removeTab(gBrowser.selectedTab);
Services.perms.remove(makeURI("http://example.com/"), "install");
runNextTest();
--- a/browser/base/content/test/general/browser_bug676619.js
+++ b/browser/base/content/test/general/browser_bug676619.js
@@ -1,18 +1,18 @@
function test () {
requestLongerTimeout(3);
waitForExplicitFinish();
var isHTTPS = false;
function loadListener() {
function testLocation(link, url, next) {
- var tabOpenListener = new TabOpenListener(url, function () {
- gBrowser.removeTab(this.tab);
+ new TabOpenListener(url, function () {
+ gBrowser.removeTab(this.tab);
}, function () {
next();
});
ContentTask.spawn(gBrowser.selectedBrowser, link, link => {
content.document.getElementById(link).click();
});
}
--- a/browser/base/content/test/general/browser_bug678392.js
+++ b/browser/base/content/test/general/browser_bug678392.js
@@ -152,17 +152,16 @@ function test1() {
});
}
function test2() {
// Test growing of snapshot array across tabs.
let tab = gBrowser.selectedTab;
load(tab, HTTPROOT + "browser_bug678392-1.html", function() {
- var historyIndex = gBrowser.webNavigation.sessionHistory.index - 1;
load(tab, HTTPROOT + "browser_bug678392-2.html", function() {
is(gHistorySwipeAnimation._trackedSnapshots.length, 2, "Length of " +
"snapshot array is equal to 2 after loading two pages");
let prevTab = tab;
tab = gBrowser.addTab("about:newtab");
gBrowser.selectedTab = tab;
load(tab, HTTPROOT + "browser_bug678392-2.html" /* initial page */,
function() {
--- a/browser/base/content/test/general/browser_bug822367.js
+++ b/browser/base/content/test/general/browser_bug822367.js
@@ -120,17 +120,16 @@ function MixedTest4A() {
function MixedTest4B() {
waitForCondition(() => content.document.location == gHttpTestRoot + "file_bug822367_4B.html", MixedTest4C, "Waited too long for mixed script to run in Test 4");
}
function MixedTest4C() {
ok(content.document.location == gHttpTestRoot + "file_bug822367_4B.html", "Location didn't change in test 4");
assertMixedContentBlockingState(gTestBrowser, {activeLoaded: false, activeBlocked: true, passiveLoaded: false});
- let {gIdentityHandler} = gTestBrowser.ownerGlobal;
waitForCondition(() => content.document.getElementById('p1').innerHTML == "", MixedTest4D, "Mixed script loaded in test 4 after location change!");
}
function MixedTest4D() {
ok(content.document.getElementById('p1').innerHTML == "", "p1.innerHTML changed; mixed script loaded after location change in Test 4");
MixedTest5();
}
// Mixed script attempts to load in a document.open()
--- a/browser/base/content/test/general/browser_contentSearchUI.js
+++ b/browser/base/content/test/general/browser_contentSearchUI.js
@@ -577,17 +577,16 @@ add_task(function* search() {
{ str: "xfoo", type: "formHistory" }, "xbar"], 0);
// Mouse over the second suggestion.
state = yield msg("mousemove", 1);
checkState(state, "x", [{ str: "x", type: "formHistory" },
{ str: "xfoo", type: "formHistory" }, "xbar"], 1);
modifiers.button = 0;
- let currentTab = gBrowser.selectedTab;
p = msg("waitForSearch");
yield msg("click", { eltIdx: 1, modifiers: modifiers });
mesg = yield p;
eventData.searchString = "xfoo";
eventData.originalEvent = modifiers;
eventData.selection = {
index: 1,
kind: "mouse",
@@ -755,17 +754,17 @@ function promiseMsg(name, type, msgMan)
function setUpEngines() {
return Task.spawn(function* () {
info("Removing default search engines");
let currentEngineName = Services.search.currentEngine.name;
let currentEngines = Services.search.getVisibleEngines();
info("Adding test search engines");
let engine1 = yield promiseNewSearchEngine(TEST_ENGINE_BASENAME);
- let engine2 = yield promiseNewSearchEngine(TEST_ENGINE_2_BASENAME);
+ yield promiseNewSearchEngine(TEST_ENGINE_2_BASENAME);
Services.search.currentEngine = engine1;
for (let engine of currentEngines) {
Services.search.removeEngine(engine);
}
registerCleanupFunction(() => {
Services.search.restoreDefaultEngines();
Services.search.currentEngine = Services.search.getEngineByName(currentEngineName);
});
--- a/browser/base/content/test/general/browser_contextmenu_childprocess.js
+++ b/browser/base/content/test/general/browser_contextmenu_childprocess.js
@@ -7,17 +7,17 @@ add_task(function *() {
let tab = yield BrowserTestUtils.openNewForegroundTab(gBrowser, gBaseURL + "subtst_contextmenu.html");
let contextMenu = document.getElementById("contentAreaContextMenu");
// Get the point of the element with the page menu (test-pagemenu) and
// synthesize a right mouse click there.
let popupShownPromise = BrowserTestUtils.waitForEvent(contextMenu, "popupshown");
yield BrowserTestUtils.synthesizeMouse("#test-pagemenu", 5, 5, { type : "contextmenu", button : 2 }, tab.linkedBrowser);
- let event = yield popupShownPromise;
+ yield popupShownPromise;
checkMenu(contextMenu);
let popupHiddenPromise = BrowserTestUtils.waitForEvent(contextMenu, "popuphidden");
contextMenu.hidePopup();
yield popupHiddenPromise;
yield BrowserTestUtils.removeTab(tab);
--- a/browser/base/content/test/general/browser_datachoices_notification.js
+++ b/browser/base/content/test/general/browser_datachoices_notification.js
@@ -87,17 +87,17 @@ var checkInfobarButton = Task.async(func
// Add an observer to ensure the "advanced" pane opened (but don't bother
// closing it - we close the entire window when done.)
let paneLoadedPromise = promiseTopicObserved("advanced-pane-loaded");
// Click on the button.
button.click();
// Wait for the preferences panel to open.
- let preferenceWindow = yield paneLoadedPromise;
+ yield paneLoadedPromise;
yield promiseNextTick();
});
add_task(function* setup() {
const bypassNotification = Preferences.get(PREF_BYPASS_NOTIFICATION, true);
const currentPolicyVersion = Preferences.get(PREF_CURRENT_POLICY_VERSION, 1);
// Register a cleanup function to reset our preferences.
--- a/browser/base/content/test/general/browser_double_close_tab.js
+++ b/browser/base/content/test/general/browser_double_close_tab.js
@@ -39,17 +39,17 @@ function waitForDialogDestroyed(node, ca
add_task(function*() {
testTab = gBrowser.selectedTab = gBrowser.addTab();
yield promiseTabLoadEvent(testTab, TEST_PAGE);
//XXXgijs the reason this has nesting and callbacks rather than promises is
// that DOM promises resolve on the next tick. So they're scheduled
// in an event queue. So when we spin a new event queue for a modal dialog...
// everything gets messed up and the promise's .then callbacks never get
// called, despite resolve() being called just fine.
- let dialogNode = yield new Promise(resolveOuter => {
+ yield new Promise(resolveOuter => {
waitForDialog(dialogNode => {
waitForDialogDestroyed(dialogNode, () => {
let doCompletion = () => setTimeout(resolveOuter, 0);
info("Now checking if dialog is destroyed");
ok(!dialogNode.parentNode, "onbeforeunload dialog should be gone.");
if (dialogNode.parentNode) {
// Failed to remove onbeforeunload dialog, so do it ourselves:
let leaveBtn = dialogNode.ui.button0;
@@ -73,10 +73,8 @@ registerCleanupFunction(function() {
if (testTab.parentNode) {
// Remove the handler, or closing this tab will prove tricky:
try {
testTab.linkedBrowser.contentWindow.onbeforeunload = null;
} catch (ex) {}
gBrowser.removeTab(testTab);
}
});
-
-
--- a/browser/base/content/test/general/browser_fullscreen-window-open.js
+++ b/browser/base/content/test/general/browser_fullscreen-window-open.js
@@ -177,17 +177,16 @@ function test_open_from_chrome() {
title: "test_open_from_chrome",
param: "",
},
finalizeFn: function () {}
});
}
function waitForTabOpen(aOptions) {
- let start = Date.now();
let message = aOptions.message;
if (!message.title) {
ok(false, "Can't get message.title.");
aOptions.finalizeFn();
runNextTest();
return;
}
@@ -226,17 +225,16 @@ function waitForTabOpen(aOptions) {
uri: URI,
title: message.title,
option: message.param,
});
}
function waitForWindowOpen(aOptions) {
- let start = Date.now();
let message = aOptions.message;
let url = aOptions.url || "about:blank";
if (!message.title) {
ok(false, "Can't get message.title");
aOptions.finalizeFn();
runNextTest();
return;
@@ -268,17 +266,16 @@ function executeWindowOpenInContent(aPar
ContentTask.spawn(gBrowser.selectedBrowser, JSON.stringify(aParam), function* (dataTestParam) {
let testElm = content.document.getElementById("test");
testElm.setAttribute("data-test-param", dataTestParam);
testElm.click();
});
}
function waitForWindowOpenFromChrome(aOptions) {
- let start = Date.now();
let message = aOptions.message;
let url = aOptions.url || "about:blank";
if (!message.title) {
ok(false, "Can't get message.title");
aOptions.finalizeFn();
runNextTest();
return;
@@ -294,17 +291,17 @@ function waitForWindowOpenFromChrome(aOp
};
let listener = new WindowListener(message.title, getBrowserURL(), {
onSuccess: aOptions.successFn,
onFinalize: onFinalize,
});
Services.wm.addListener(listener);
- let testWindow = window.open(url, message.title, message.option);
+ window.open(url, message.title, message.option);
}
function WindowListener(aTitle, aUrl, aCallBackObj) {
this.test_title = aTitle;
this.test_url = aUrl;
this.callback_onSuccess = aCallBackObj.onSuccess;
this.callBack_onFinalize = aCallBackObj.onFinalize;
}
--- a/browser/base/content/test/general/browser_gestureSupport.js
+++ b/browser/base/content/test/general/browser_gestureSupport.js
@@ -541,17 +541,16 @@ function test_rotateHelperGetImageRotati
function test_rotateHelperOneGesture(aImageElement, aCurrentRotation,
aDirection, aAmount, aStop)
{
if (aAmount <= 0 || aAmount > 90) // Bound to 0 < aAmount <= 90
return;
// easier to type names for the direction constants
let clockwise = SimpleGestureEvent.ROTATION_CLOCKWISE;
- let cclockwise = SimpleGestureEvent.ROTATION_COUNTERCLOCKWISE;
let delta = aAmount * (aDirection == clockwise ? 1 : -1);
// Kill transition time on image so test isn't wrong and doesn't take 10 seconds
aImageElement.style.transitionDuration = "0s";
// Start the gesture, perform an update, and force flush
test_utils.sendSimpleGestureEvent("MozRotateGestureStart", 0, 0, aDirection, .001, 0);
--- a/browser/base/content/test/general/browser_page_style_menu_update.js
+++ b/browser/base/content/test/general/browser_page_style_menu_update.js
@@ -40,17 +40,16 @@ add_task(function*() {
gPageStyleMenu.fillPopup(menupopup);
// page_style_sample.html should default us to selecting the stylesheet
// with the title "6" first.
let selected = menupopup.querySelector("menuitem[checked='true']");
is(selected.getAttribute("label"), "6", "Should have '6' stylesheet selected by default");
// Now select stylesheet "1"
- let targets = menupopup.querySelectorAll("menuitem");
let target = menupopup.querySelector("menuitem[label='1']");
target.click();
// Now we need to wait for the content process to send its stylesheet
// update for the selected tab to the parent. Because messages are
// guaranteed to be sent in order, we'll make sure we do the check
// after the parent has been updated by yielding until the child
// has finished running a ContentTask for us.
--- a/browser/base/content/test/general/browser_parsable_script.js
+++ b/browser/base/content/test/general/browser_parsable_script.js
@@ -43,20 +43,19 @@ function uriIsWhiteListed(uri) {
function parsePromise(uri) {
let promise = new Promise((resolve, reject) => {
let xhr = new XMLHttpRequest();
xhr.open("GET", uri, true);
xhr.onreadystatechange = function() {
if (this.readyState == this.DONE) {
let scriptText = this.responseText;
- let ast;
try {
info("Checking " + uri);
- ast = Reflect.parse(scriptText);
+ Reflect.parse(scriptText);
resolve(true);
} catch (ex) {
let errorMsg = "Script error reading " + uri + ": " + ex;
ok(false, errorMsg);
resolve(false);
}
}
};
@@ -126,9 +125,8 @@ add_task(function* checkAllTheJS() {
continue;
}
allPromises.push(parsePromise(uri.spec));
}
let promiseResults = yield Promise.all(allPromises);
is(promiseResults.filter((x) => !x).length, 0, "There should be 0 parsing errors");
});
-
--- a/browser/base/content/test/general/browser_permissions.js
+++ b/browser/base/content/test/general/browser_permissions.js
@@ -27,17 +27,16 @@ function* openIdentityPopup() {
function* closeIdentityPopup() {
let {gIdentityHandler} = gBrowser.ownerGlobal;
let promise = BrowserTestUtils.waitForEvent(gIdentityHandler._identityPopup, "popuphidden");
gIdentityHandler._identityPopup.hidePopup();
return promise;
}
add_task(function* testMainViewVisible() {
- let {gIdentityHandler} = gBrowser.ownerGlobal;
let tab = gBrowser.selectedTab = gBrowser.addTab();
yield promiseTabLoadEvent(tab, PERMISSIONS_PAGE);
let permissionsList = document.getElementById("identity-popup-permission-list");
let emptyLabel = permissionsList.nextSibling.nextSibling;
yield openIdentityPopup();
@@ -97,17 +96,16 @@ add_task(function* testIdentityIcon() {
"identity-box signals granted permissions");
SitePermissions.remove(gBrowser.currentURI, "geo");
SitePermissions.remove(gBrowser.currentURI, "camera");
SitePermissions.remove(gBrowser.currentURI, "cookie");
});
add_task(function* testCancelPermission() {
- let {gIdentityHandler} = gBrowser.ownerGlobal;
let tab = gBrowser.selectedTab = gBrowser.addTab();
yield promiseTabLoadEvent(tab, PERMISSIONS_PAGE);
let permissionsList = document.getElementById("identity-popup-permission-list");
let emptyLabel = permissionsList.nextSibling.nextSibling;
SitePermissions.set(gBrowser.currentURI, "geo", SitePermissions.ALLOW);
SitePermissions.set(gBrowser.currentURI, "camera", SitePermissions.BLOCK);
@@ -125,17 +123,16 @@ add_task(function* testCancelPermission(
cancelButtons[1].click();
labels = permissionsList.querySelectorAll(".identity-popup-permission-label");
is(labels.length, 0, "One permission should be removed");
yield closeIdentityPopup();
});
add_task(function* testPermissionHints() {
- let {gIdentityHandler} = gBrowser.ownerGlobal;
let tab = gBrowser.selectedTab = gBrowser.addTab();
yield promiseTabLoadEvent(tab, PERMISSIONS_PAGE);
let permissionsList = document.getElementById("identity-popup-permission-list");
let emptyHint = document.getElementById("identity-popup-permission-empty-hint");
let reloadHint = document.getElementById("identity-popup-permission-reload-hint");
yield openIdentityPopup();
--- a/browser/base/content/test/general/browser_purgehistory_clears_sh.js
+++ b/browser/base/content/test/general/browser_purgehistory_clears_sh.js
@@ -1,15 +1,15 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
const url = "http://example.org/browser/browser/base/content/test/general/dummy_page.html";
add_task(function* purgeHistoryTest() {
- let tab = yield BrowserTestUtils.withNewTab({
+ yield BrowserTestUtils.withNewTab({
gBrowser,
url,
}, function* purgeHistoryTestInner(browser) {
let backButton = browser.ownerDocument.getElementById("Browser:Back");
let forwardButton = browser.ownerDocument.getElementById("Browser:Forward");
ok(!browser.webNavigation.canGoBack,
"Initial value for webNavigation.canGoBack");
--- a/browser/base/content/test/general/browser_readerMode.js
+++ b/browser/base/content/test/general/browser_readerMode.js
@@ -108,21 +108,19 @@ add_task(function* test_getOriginalUrl()
add_task(function* test_reader_view_element_attribute_transform() {
registerCleanupFunction(function() {
while (gBrowser.tabs.length > 1) {
gBrowser.removeCurrentTab();
}
});
function observeAttribute(element, attribute, triggerFn, checkFn) {
- let initValue = element.getAttribute(attribute);
return new Promise(resolve => {
let observer = new MutationObserver((mutations) => {
mutations.forEach( mu => {
- let muValue = element.getAttribute(attribute);
if (element.getAttribute(attribute) !== mu.oldValue) {
checkFn();
resolve();
observer.disconnect();
}
});
});
--- a/browser/base/content/test/general/browser_relatedTabs.js
+++ b/browser/base/content/test/general/browser_relatedTabs.js
@@ -5,17 +5,16 @@
add_task(function*() {
is(gBrowser.tabs.length, 1, "one tab is open initially");
// Add several new tabs in sequence, interrupted by selecting a
// different tab, moving a tab around and closing a tab,
// returning a list of opened tabs for verifying the expected order.
// The new tab behaviour is documented in bug 465673
let tabs = [];
- let promises = [];
function addTab(aURL, aReferrer) {
let tab = gBrowser.addTab(aURL, {referrerURI: aReferrer});
tabs.push(tab);
return BrowserTestUtils.browserLoaded(tab.linkedBrowser);
}
yield addTab("http://mochi.test:8888/#0");
gBrowser.selectedTab = tabs[0];
--- a/browser/base/content/test/general/browser_removeTabsToTheEnd.js
+++ b/browser/base/content/test/general/browser_removeTabsToTheEnd.js
@@ -1,17 +1,17 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
function test() {
// Add two new tabs after the original tab. Pin the first one.
let originalTab = gBrowser.selectedTab;
let newTab1 = gBrowser.addTab();
- let newTab2 = gBrowser.addTab();
+ gBrowser.addTab();
gBrowser.pinTab(newTab1);
// Check that there is only one closable tab from originalTab to the end
is(gBrowser.getTabsToTheEndFrom(originalTab).length, 1,
"One unpinned tab to the right");
// Remove tabs to the end
gBrowser.removeTabsToTheEndFrom(originalTab);
--- a/browser/base/content/test/general/browser_sanitizeDialog.js
+++ b/browser/base/content/test/general/browser_sanitizeDialog.js
@@ -131,17 +131,16 @@ add_task(function* test_history_download
for (let i = 0; i < 5; i++) {
pURI = makeURI("http://" + (61 + i) + "-minutes-ago.com/");
places.push({uri: pURI, visitDate: visitTimeForMinutesAgo(61 + i)});
olderURIs.push(pURI);
}
let promiseSanitized = promiseSanitizationComplete();
yield PlacesTestUtils.addVisits(places);
- let totalHistoryVisits = uris.length + olderURIs.length;
let wh = new WindowHelper();
wh.onload = function () {
this.selectDuration(Sanitizer.TIMESPAN_HOUR);
this.checkPrefCheckbox("history", true);
this.acceptDialog();
};
wh.onunload = function* () {
--- a/browser/base/content/test/general/browser_save_video_frame.js
+++ b/browser/base/content/test/general/browser_save_video_frame.js
@@ -99,17 +99,16 @@ add_task(function*() {
let tab = gBrowser.addTab();
gBrowser.selectedTab = tab;
let browser = tab.linkedBrowser;
info("Loading video tab");
yield promiseTabLoadEvent(tab, VIDEO_URL);
info("Video tab loaded.");
- let video = browser.contentDocument.getElementById("video1");
let context = document.getElementById("contentAreaContextMenu");
let popupPromise = promisePopupShown(context);
info("Synthesizing right-click on video element");
rightClickVideo(browser);
info("Waiting for popup to fire popupshown.");
yield popupPromise;
info("Popup fired popupshown");
--- a/browser/base/content/test/general/browser_tabDrop.js
+++ b/browser/base/content/test/general/browser_tabDrop.js
@@ -83,17 +83,16 @@ function* drop(dragData, expectedTabOpen
var event = {
clientX: 0,
clientY: 0,
screenX: 0,
screenY: 0,
};
EventUtils.synthesizeDrop(gBrowser.selectedTab, gBrowser.selectedTab, dragData, "link", window, undefined, event);
let tabsOpened = false;
- let tabOpened = false;
if (awaitTabOpen) {
yield awaitTabOpen;
info("Got TabOpen event");
tabsOpened = true;
for (let tab of openedTabs) {
yield BrowserTestUtils.removeTab(tab);
}
}
--- a/browser/base/content/test/general/browser_tabfocus.js
+++ b/browser/base/content/test/general/browser_tabfocus.js
@@ -141,17 +141,16 @@ add_task(function*() {
var childFocusScript = "data:,(" + focusInChild.toString() + ")();";
browser1.messageManager.loadFrameScript(childFocusScript, true);
browser2.messageManager.loadFrameScript(childFocusScript, true);
gURLBar.focus();
yield SimpleTest.promiseFocus();
- var messages = "";
if (gMultiProcessBrowser) {
messageManager.addMessageListener("Browser:FocusChanged", message => {
actualEvents.push(message.data.details);
compareFocusResults();
});
}
_lastfocus = "urlbar";
@@ -560,9 +559,8 @@ function* expectFocusShift(callback, exp
// No events are expected, so resolve the promise immediately.
if (expectedEvents["main-window"].length + expectedEvents["window1"].length + expectedEvents["window2"].length == 0) {
currentPromiseResolver();
currentPromiseResolver = null;
}
});
}
-
--- a/browser/base/content/test/general/browser_tabkeynavigation.js
+++ b/browser/base/content/test/general/browser_tabkeynavigation.js
@@ -135,17 +135,16 @@ add_task(function* test() {
gBrowser.selectedTab = tab2;
EventUtils.synthesizeKey("VK_F4", { type: "keydown", ctrlKey: true });
isnot(gBrowser.selectedTab, tab2,
"Tab2 should be closed by pressing Ctrl+F4 on Tab2");
is(gBrowser.tabs.length, 3,
"The count of tabs should be 3 since tab2 should be closed");
- let activeWindow = gBrowser.getBrowserForTab(gBrowser.selectedTab).contentWindow;
// NOTE: keypress event shouldn't be fired since the keydown event should
// be consumed by tab2.
EventUtils.synthesizeKey("VK_F4", { type: "keyup", ctrlKey: true });
is(gBrowser.tabs.length, 3,
"The count of tabs should be 3 since renaming key events shouldn't close other tabs");
}
gBrowser.selectedTab = tab3;
--- a/browser/base/content/test/general/head.js
+++ b/browser/base/content/test/general/head.js
@@ -1052,17 +1052,17 @@ function getPropertyBagValue(bag, key) {
* in expectedExtra. It's possible that the crash report
* will contain other extra information that is not
* compared against.
* @returns Promise
*/
function promiseCrashReport(expectedExtra={}) {
return Task.spawn(function*() {
info("Starting wait on crash-report-status");
- let [subject, data] =
+ let [subject, ] =
yield TestUtils.topicObserved("crash-report-status", (subject, data) => {
return data == "success";
});
info("Topic observed!");
if (!(subject instanceof Ci.nsIPropertyBag2)) {
throw new Error("Subject was not a Ci.nsIPropertyBag2");
}
--- a/browser/base/content/test/newtab/browser_newtab_bug991111.js
+++ b/browser/base/content/test/newtab/browser_newtab_bug991111.js
@@ -8,17 +8,16 @@ add_task(function* () {
yield* addNewTabPageTab();
// we need a second newtab to honor max rows
yield* addNewTabPageTab();
yield ContentTask.spawn(gBrowser.selectedBrowser, {index: 0}, function* (args) {
let {site} = content.wrappedJSObject.gGrid.cells[args.index];
let origOnClick = site.onClick;
- let clicked = false;
site.onClick = e => {
origOnClick.call(site, e);
sendAsyncMessage("test:clicked-on-cell", {});
};
});
let mm = gBrowser.selectedBrowser.messageManager;
let messagePromise = new Promise(resolve => {
--- a/browser/base/content/test/newtab/browser_newtab_bug991210.js
+++ b/browser/base/content/test/newtab/browser_newtab_bug991210.js
@@ -10,17 +10,17 @@ add_task(function* () {
getLinks: function(callback) {
this.callback = callback;
},
addObserver: function() {},
};
NewTabUtils.links.addProvider(afterLoadProvider);
// wait until about:newtab loads before calling provider callback
- let tab = yield BrowserTestUtils.openNewForegroundTab(gBrowser, "about:newtab");
+ yield BrowserTestUtils.openNewForegroundTab(gBrowser, "about:newtab");
afterLoadProvider.callback([]);
yield ContentTask.spawn(gBrowser.selectedBrowser, {}, function* () {
let {_cellMargin, _cellHeight, _cellWidth, node} = content.gGrid;
Assert.notEqual(_cellMargin, null, "grid has a computed cell margin");
Assert.notEqual(_cellHeight, null, "grid has a computed cell height");
Assert.notEqual(_cellWidth, null, "grid has a computed cell width");
--- a/browser/base/content/test/newtab/browser_newtab_bug998387.js
+++ b/browser/base/content/test/newtab/browser_newtab_bug998387.js
@@ -8,17 +8,16 @@ add_task(function* () {
yield* addNewTabPageTab();
// we need a second newtab to honor max rows
yield* addNewTabPageTab();
yield ContentTask.spawn(gBrowser.selectedBrowser, {index: 0}, function* (args) {
let {site} = content.wrappedJSObject.gGrid.cells[args.index];
let origOnClick = site.onClick;
- let clicked = false;
site.onClick = e => {
origOnClick.call(site, e);
sendAsyncMessage("test:clicked-on-cell", {});
};
});
let mm = gBrowser.selectedBrowser.messageManager;
let messagePromise = new Promise(resolve => {
@@ -33,9 +32,8 @@ add_task(function* () {
{button: 1}, gBrowser.selectedBrowser);
yield messagePromise;
ok(true, "middle click triggered click listener");
// Make sure the cell didn't actually get blocked
yield* checkGrid("0");
});
-
--- a/browser/base/content/test/newtab/browser_newtab_enhanced.js
+++ b/browser/base/content/test/newtab/browser_newtab_enhanced.js
@@ -116,17 +116,16 @@ add_task(function* () {
data = yield getData(1);
is(data, null, "directory link still pushed out by pinned history link");
yield unpinCell(0);
// Test that a suggested tile is not enhanced by a directory tile
- let origIsTopPlacesSite = NewTabUtils.isTopPlacesSite;
NewTabUtils.isTopPlacesSite = () => true;
yield setLinks("-1,2,3,4,5,6,7,8");
// Test with enhanced = false
yield* addNewTabPageTab();
({type, enhanced, title, suggested} = yield getData(0));
isnot(type, "enhanced", "history link is not enhanced");
is(enhanced, "", "history link has no enhanced image");
--- a/browser/base/content/test/newtab/head.js
+++ b/browser/base/content/test/newtab/head.js
@@ -146,17 +146,17 @@ add_task(function* setup() {
* @param aIndex index of cell
* @param aFn function to call in child process or tab.
* @returns result of calling the function.
*/
function performOnCell(aIndex, aFn) {
return ContentTask.spawn(gWindow.gBrowser.selectedBrowser,
{ index: aIndex, fn: aFn.toString() }, function* (args) {
let cell = content.gGrid.cells[args.index];
- return eval("(" + args.fn + ")(cell)");
+ return eval(args.fn)(cell);
});
}
/**
* Allows to provide a list of links that is used to construct the grid.
* @param aLinksPattern the pattern (see below)
*
* Example: setLinks("-1,0,1,2,3")
@@ -409,18 +409,16 @@ function* simulateExternalDrop(aDestInde
return new Promise(resolve => {
const url = "data:text/html;charset=utf-8," +
"<a id='link' href='http://example99.com/'>link</a>";
let doc = content.document;
let iframe = doc.createElement("iframe");
function iframeLoaded() {
- let link = iframe.contentDocument.getElementById("link");
-
let dataTransfer = new iframe.contentWindow.DataTransfer("dragstart", false);
dataTransfer.mozSetDataAt("text/x-moz-url", "http://example99.com/", 0);
let event = content.document.createEvent("DragEvent");
event.initDragEvent("drop", true, true, content, 0, 0, 0, 0, 0,
false, false, false, false, 0, null, dataTransfer);
let target = content.gGrid.cells[dropIndex].node;
--- a/browser/base/content/test/plugins/browser_CTP_crashreporting.js
+++ b/browser/base/content/test/plugins/browser_CTP_crashreporting.js
@@ -134,17 +134,17 @@ add_task(function*() {
// And wait for the parent to say that the crash report was submitted
// successfully.
yield ContentTaskUtils.waitForCondition(() => {
return statusDiv.getAttribute("status") == "success";
}, "Timed out waiting for plugin binding to be in success state");
});
- let [subject, data] = yield crashReportPromise;
+ let [subject, ] = yield crashReportPromise;
ok(subject instanceof Ci.nsIPropertyBag,
"The crash report subject should be an nsIPropertyBag.");
let crashData = convertPropertyBag(subject);
ok(crashData.serverCrashID, "Should have a serverCrashID set.");
// Remove the submitted report file after ensuring it exists.
@@ -206,17 +206,17 @@ add_task(function*() {
// Then click the button to submit the crash report.
let buttons = notification.querySelectorAll(".notification-button");
is(buttons.length, 2, "Should have two buttons.");
// The "Submit Crash Report" button should be the second one.
let submitButton = buttons[1];
submitButton.click();
- let [subject, data] = yield crashReportPromise;
+ let [subject, ] = yield crashReportPromise;
ok(subject instanceof Ci.nsIPropertyBag,
"The crash report subject should be an nsIPropertyBag.");
let crashData = convertPropertyBag(subject);
ok(crashData.serverCrashID, "Should have a serverCrashID set.");
// Remove the submitted report file after ensuring it exists.
--- a/browser/base/content/test/plugins/browser_pageInfo_plugins.js
+++ b/browser/base/content/test/plugins/browser_pageInfo_plugins.js
@@ -75,17 +75,16 @@ function testPart1a() {
doOnOpenPageInfo(testPart1b);
}
function testPart1b() {
let testRadioGroup = gPageInfo.document.getElementById(gTestPermissionString + "RadioGroup");
let testRadioDefault = gPageInfo.document.getElementById(gTestPermissionString + "#0");
- var qString = "#" + gTestPermissionString.replace(':', '\\:') + "\\#0";
is(testRadioGroup.selectedItem, testRadioDefault, "part 1b: Test radio group should be set to 'Default'");
let testRadioAllow = gPageInfo.document.getElementById(gTestPermissionString + "#1");
testRadioGroup.selectedItem = testRadioAllow;
testRadioAllow.doCommand();
let secondtestRadioGroup = gPageInfo.document.getElementById(gSecondTestPermissionString + "RadioGroup");
let secondtestRadioDefault = gPageInfo.document.getElementById(gSecondTestPermissionString + "#0");
is(secondtestRadioGroup.selectedItem, secondtestRadioDefault, "part 1b: Second Test radio group should be set to 'Default'");
--- a/browser/base/content/test/plugins/browser_pluginnotification.js
+++ b/browser/base/content/test/plugins/browser_pluginnotification.js
@@ -282,18 +282,16 @@ add_task(function* () {
let pluginInfo = yield promiseForPluginInfo("test");
ok(!pluginInfo.activated, "Test 18g, Plugin should not be activated");
ok(PopupNotifications.getNotification("click-to-play-plugins", gTestBrowser).dismissed,
"Test 19e, Doorhanger should start out dismissed");
yield ContentTask.spawn(gTestBrowser, null, function* () {
- let doc = content.document;
- let plugin = doc.getElementById("test");
let utils = content.QueryInterface(Components.interfaces.nsIInterfaceRequestor)
.getInterface(Components.interfaces.nsIDOMWindowUtils);
utils.sendMouseEvent("mousedown", 50, 50, 0, 1, 0, false, 0, 0);
utils.sendMouseEvent("mouseup", 50, 50, 0, 1, 0, false, 0, 0);
});
let condition = () => !PopupNotifications.getNotification("click-to-play-plugins", gTestBrowser).dismissed &&
PopupNotifications.panel.firstChild;
--- a/browser/base/content/test/plugins/head.js
+++ b/browser/base/content/test/plugins/head.js
@@ -10,18 +10,18 @@ XPCOMUtils.defineLazyModuleGetter(this,
// The blocklist shim running in the content process does not initialize at
// start up, so it's not active until we load content that needs to do a
// check. This helper bypasses the delay to get the svc up and running
// immediately. Note, call this after remote content has loaded.
function promiseInitContentBlocklistSvc(aBrowser)
{
return ContentTask.spawn(aBrowser, {}, function* () {
try {
- let bls = Cc["@mozilla.org/extensions/blocklist;1"]
- .getService(Ci.nsIBlocklistService);
+ Cc["@mozilla.org/extensions/blocklist;1"]
+ .getService(Ci.nsIBlocklistService);
} catch (ex) {
return ex.message;
}
return null;
});
}
/**
@@ -203,17 +203,16 @@ function promisePlayObject(aId, aBrowser
objLoadingContent.playPlugin();
});
}
function promiseCrashObject(aId, aBrowser) {
let browser = aBrowser || gTestBrowser;
return ContentTask.spawn(browser, aId, function* (aId) {
let plugin = content.document.getElementById(aId);
- let objLoadingContent = plugin.QueryInterface(Ci.nsIObjectLoadingContent);
Components.utils.waiveXrays(plugin).crash();
});
}
// Return a promise and call the plugin's getObjectValue() method.
function promiseObjectValueResult(aId, aBrowser) {
let browser = aBrowser || gTestBrowser;
return ContentTask.spawn(browser, aId, function* (aId) {
--- a/browser/base/content/test/popupNotifications/browser_popupNotification_4.js
+++ b/browser/base/content/test/popupNotifications/browser_popupNotification_4.js
@@ -98,17 +98,16 @@ var tests = [
// Moving a tab to a new window should remove non-swappable notifications.
{ id: "Test#5",
run: function() {
gBrowser.selectedTab = gBrowser.addTab("about:blank");
let notifyObj = new BasicNotification(this.id);
showNotification(notifyObj);
let win = gBrowser.replaceTabWithWindow(gBrowser.selectedTab);
whenDelayedStartupFinished(win, function() {
- let [tab] = win.gBrowser.tabs;
let anchor = win.document.getElementById("default-notification-icon");
win.PopupNotifications._reshowNotifications(anchor);
ok(win.PopupNotifications.panel.childNodes.length == 0,
"no notification displayed in new window");
ok(notifyObj.swappingCallbackTriggered, "the swapping callback was triggered");
ok(notifyObj.removedCallbackTriggered, "the removed callback was triggered");
win.close();
goNext();
@@ -127,18 +126,16 @@ var tests = [
notifyObj.options.eventCallback = function (eventName) {
originalCallback(eventName);
return eventName == "swapping";
};
let notification = showNotification(notifyObj);
let win = gBrowser.replaceTabWithWindow(gBrowser.selectedTab);
yield whenDelayedStartupFinished(win);
- let [tab] = win.gBrowser.tabs;
- let anchor = win.document.getElementById("default-notification-icon");
yield new Promise(resolve => {
let originalCallback = notification.options.eventCallback;
notification.options.eventCallback = function (eventName) {
originalCallback(eventName);
if (eventName == "shown") {
resolve();
}
--- a/browser/base/content/test/social/browser_addons.js
+++ b/browser/base/content/test/social/browser_addons.js
@@ -194,17 +194,16 @@ var tests = {
AddonManager.addAddonListener(installListener(next, manifest2));
BrowserTestUtils.waitForEvent(PopupNotifications.panel, "popupshown").then(() => {
let panel = document.getElementById("servicesInstall-notification");
info("servicesInstall-notification panel opened");
panel.button.click();
});
- let activationURL = manifest2.origin + "/browser/browser/base/content/test/social/social_activate.html"
Services.prefs.setCharPref("social.directories", manifest2.origin);
is(SocialService.getOriginActivationType(manifest2.origin), "directory", "testing directory install");
let data = {
origin: manifest2.origin,
url: manifest2.origin + "/directory",
manifest: manifest2,
window: window
}
--- a/browser/base/content/test/social/browser_share.js
+++ b/browser/base/content/test/social/browser_share.js
@@ -113,17 +113,16 @@ var corpus = [
previews: ["http://example.com/1234/56789.jpg"],
url: "http://www.example.com/photos/56789/",
shortUrl: "http://imshort/p/abcde"
}
}
];
function hasoptions(testOptions, options) {
- let msg;
for (let option in testOptions) {
let data = testOptions[option];
info("data: "+JSON.stringify(data));
let message_data = options[option];
info("message_data: "+JSON.stringify(message_data));
if (Array.isArray(data)) {
// the message may have more array elements than we are testing for, this
// is ok since some of those are hard to test. So we just test that
@@ -177,18 +176,16 @@ var tests = {
ok(!shareButton.hasAttribute("disabled"), "share button is enabled");
// button should be visible
is(shareButton.hidden, false, "share button is visible");
BrowserTestUtils.removeTab(tab).then(next);
});
});
},
testSharePage: function(next) {
- let provider = Social._getProviderFromOrigin(manifest.origin);
-
let testTab;
let testIndex = 0;
let testData = corpus[testIndex++];
// initialize the button into the navbar
CustomizableUI.addWidgetToArea("social-share-button", CustomizableUI.AREA_NAVBAR);
// ensure correct state
SocialUI.onCustomizeEnd(window);
--- a/browser/base/content/test/social/head.js
+++ b/browser/base/content/test/social/head.js
@@ -105,17 +105,16 @@ function runSocialTestWithProvider(manif
removeProvider(m.origin, callback);
});
}
function finishSocialTest(cleanup) {
removeAddedProviders(cleanup);
}
let providersAdded = 0;
- let firstProvider;
manifests.forEach(function (m) {
SocialService.addProvider(m, function(provider) {
providersAdded++;
info("runSocialTestWithProvider: provider added");
// we want to set the first specified provider as the UI's provider
--- a/browser/base/content/test/urlbar/browser_autocomplete_a11y_label.js
+++ b/browser/base/content/test/urlbar/browser_autocomplete_a11y_label.js
@@ -4,17 +4,16 @@
const SUGGEST_ALL_PREF = "browser.search.suggest.enabled";
const SUGGEST_URLBAR_PREF = "browser.urlbar.suggest.searches";
const TEST_ENGINE_BASENAME = "searchSuggestionEngine.xml";
add_task(function* switchToTab() {
let tab = gBrowser.addTab("about:about");
yield promiseTabLoaded(tab);
- let actionURL = makeActionURI("switchtab", {url: "about:about"}).spec;
yield promiseAutocompleteResultPopup("% about");
ok(gURLBar.popup.richlistbox.children.length > 1, "Should get at least 2 results");
let result = gURLBar.popup.richlistbox.children[1];
is(result.getAttribute("type"), "switchtab", "Expect right type attribute");
is(result.label, "about:about about:about Tab", "Result a11y label should be: <title> <url> Tab");
gURLBar.popup.hidePopup();
--- a/browser/base/content/test/urlbar/browser_bug1104165-switchtab-decodeuri.js
+++ b/browser/base/content/test/urlbar/browser_bug1104165-switchtab-decodeuri.js
@@ -1,15 +1,15 @@
add_task(function* test_switchtab_decodeuri() {
info("Opening first tab");
let tab = gBrowser.addTab("http://example.org/browser/browser/base/content/test/urlbar/dummy_page.html#test%7C1");
yield promiseTabLoadEvent(tab);
info("Opening and selecting second tab");
- let newTab = gBrowser.selectedTab = gBrowser.addTab();
+ gBrowser.selectedTab = gBrowser.addTab();
info("Wait for autocomplete")
yield promiseAutocompleteResultPopup("dummy_page");
info("Select autocomplete popup entry");
EventUtils.synthesizeKey("VK_DOWN", {});
ok(gURLBar.value.startsWith("moz-action:switchtab"), "switch to tab entry found");
--- a/browser/base/content/test/urlbar/browser_search_favicon.js
+++ b/browser/base/content/test/urlbar/browser_search_favicon.js
@@ -20,17 +20,17 @@ add_task(function*() {
gEngine = Services.search.getEngineByName("SearchEngine");
gEngine.addParam("q", "{searchTerms}", null);
gOriginalEngine = Services.search.currentEngine;
Services.search.currentEngine = gEngine;
let uri = NetUtil.newURI("http://s.example.com/search?q=foo&client=1");
yield PlacesTestUtils.addVisits({ uri: uri, title: "Foo - SearchEngine Search" });
- let tab = gBrowser.selectedTab = gBrowser.addTab("about:mozilla", {animate: false});
+ gBrowser.selectedTab = gBrowser.addTab("about:mozilla", {animate: false});
yield promiseTabLoaded(gBrowser.selectedTab);
// The first autocomplete result has the action searchengine, while
// the second result is the "search favicon" element.
yield promiseAutocompleteResultPopup("foo");
let result = gURLBar.popup.richlistbox.children[1];
isnot(result, null, "Expect a search result");
--- a/browser/base/content/test/urlbar/browser_tabMatchesInAwesomebar_perwindowpb.js
+++ b/browser/base/content/test/urlbar/browser_tabMatchesInAwesomebar_perwindowpb.js
@@ -18,17 +18,17 @@ add_task(function*() {
yield BrowserTestUtils.closeWindow(privateWindow);
normalWindow = yield BrowserTestUtils.openNewBrowserWindow();
yield runTest(normalWindow, normalWindow, true);
yield BrowserTestUtils.closeWindow(normalWindow);
});
function* runTest(aSourceWindow, aDestWindow, aExpectSwitch, aCallback) {
- let baseTab = yield BrowserTestUtils.openNewForegroundTab(aSourceWindow.gBrowser, testURL);
+ yield BrowserTestUtils.openNewForegroundTab(aSourceWindow.gBrowser, testURL);
let testTab = yield BrowserTestUtils.openNewForegroundTab(aDestWindow.gBrowser);
info("waiting for focus on the window");
yield SimpleTest.promiseFocus(aDestWindow);
info("got focus on the window");
// Select the testTab
aDestWindow.gBrowser.selectedTab = testTab;
--- a/browser/base/content/test/urlbar/browser_urlbarDecode.js
+++ b/browser/base/content/test/urlbar/browser_urlbarDecode.js
@@ -45,17 +45,17 @@ add_task(function* actionURILosslessDeco
// simply `url`. Key down and back around until the heuristic result is
// selected again, and at that point the urlbar's value should be a visiturl
// moz-action.
do {
gURLBar.controller.handleKeyNavigation(KeyEvent.DOM_VK_DOWN);
} while (gURLBar.popup.selectedIndex != 0);
- let [, type, params] = gURLBar.value.match(/^moz-action:([^,]+),(.*)$/);
+ let [, type, ] = gURLBar.value.match(/^moz-action:([^,]+),(.*)$/);
Assert.equal(type, "visiturl",
"visiturl action URI should be in the urlbar");
Assert.equal(gURLBar.inputField.value, urlNoScheme,
"The string displayed in the textbox should not be escaped");
gURLBar.value = "";
gURLBar.handleRevert();
--- a/browser/base/content/test/urlbar/browser_urlbarEnterAfterMouseOver.js
+++ b/browser/base/content/test/urlbar/browser_urlbarEnterAfterMouseOver.js
@@ -18,17 +18,16 @@ function is_selected(index) {
let gMaxResults;
add_task(function*() {
registerCleanupFunction(function* () {
yield PlacesTestUtils.clearHistory();
});
yield PlacesTestUtils.clearHistory();
- let tabCount = gBrowser.tabs.length;
gMaxResults = Services.prefs.getIntPref("browser.urlbar.maxRichResults");
let visits = [];
repeat(gMaxResults, i => {
visits.push({
uri: makeURI("http://example.com/autocomplete/?" + i),
});
--- a/browser/base/content/test/urlbar/browser_urlbarPrivateBrowsingWindowChange.js
+++ b/browser/base/content/test/urlbar/browser_urlbarPrivateBrowsingWindowChange.js
@@ -2,18 +2,16 @@
/**
* Test that when opening a private browsing window and typing in it before about:privatebrowsing
* loads, we don't clear the URL bar.
*/
add_task(function*() {
let urlbarTestValue = "Mary had a little lamb";
let win = OpenBrowserWindow({private: true});
- let delayedStartupFinished = TestUtils.topicObserved("browser-delayed-startup-finished",
- subject => subject == win);
yield BrowserTestUtils.waitForEvent(win, "load");
let urlbar = win.document.getElementById("urlbar");
urlbar.value = urlbarTestValue;
// Need this so the autocomplete controller attaches:
let focusEv = new FocusEvent("focus", {});
urlbar.dispatchEvent(focusEv);
// And so we know input happened:
let inputEv = new InputEvent("input", {data: "", view: win, bubbles: true});
--- a/browser/base/content/test/urlbar/browser_urlbarSearchSuggestions.js
+++ b/browser/base/content/test/urlbar/browser_urlbarSearchSuggestions.js
@@ -37,17 +37,16 @@ add_task(function* clickSuggestion() {
Assert.ok(uri.equals(gBrowser.currentURI),
"The search results page should have loaded");
gBrowser.removeTab(gBrowser.selectedTab);
});
function getFirstSuggestion() {
let controller = gURLBar.popup.input.controller;
let matchCount = controller.matchCount;
- let present = false;
for (let i = 0; i < matchCount; i++) {
let url = controller.getValueAt(i);
let mozActionMatch = url.match(/^moz-action:([^,]+),(.*)$/);
if (mozActionMatch) {
let [, type, paramStr] = mozActionMatch;
let params = JSON.parse(paramStr);
if (type == "searchengine" && "searchSuggestion" in params) {
return [i, params.searchSuggestion, params.engineName];
--- a/browser/base/content/test/urlbar/browser_urlbarSearchSuggestionsNotification.js
+++ b/browser/base/content/test/urlbar/browser_urlbarSearchSuggestionsNotification.js
@@ -216,17 +216,16 @@ function setUserMadeChoicePref(userMadeC
resolve();
}
});
}
function suggestionsPresent() {
let controller = gURLBar.popup.input.controller;
let matchCount = controller.matchCount;
- let present = false;
for (let i = 0; i < matchCount; i++) {
let url = controller.getValueAt(i);
let mozActionMatch = url.match(/^moz-action:([^,]+),(.*)$/);
if (mozActionMatch) {
let [, type, paramStr] = mozActionMatch;
let params = JSON.parse(paramStr);
if (type == "searchengine" && "searchSuggestion" in params) {
return true;
--- a/browser/base/content/urlbarBindings.xml
+++ b/browser/base/content/urlbarBindings.xml
@@ -72,17 +72,16 @@ file, You can obtain one at http://mozil
this.inputField.controllers.insertControllerAt(0, this._copyCutController);
this.inputField.addEventListener("paste", this, false);
this.inputField.addEventListener("mousedown", this, false);
this.inputField.addEventListener("mousemove", this, false);
this.inputField.addEventListener("mouseout", this, false);
this.inputField.addEventListener("overflow", this, false);
this.inputField.addEventListener("underflow", this, false);
- const kXULNS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
var textBox = document.getAnonymousElementByAttribute(this,
"anonid", "textbox-input-box");
var cxmenu = document.getAnonymousElementByAttribute(textBox,
"anonid", "input-box-contextmenu");
var pasteAndGo;
cxmenu.addEventListener("popupshowing", function() {
if (!pasteAndGo)
return;
@@ -2323,17 +2322,17 @@ file, You can obtain one at http://mozil
</method>
<method name="_setupSingleState">
<body><![CDATA[
var action = this._items[0].action;
var prePath = action.pluginPermissionPrePath;
let chromeWin = window.QueryInterface(Ci.nsIDOMChromeWindow);
let isWindowPrivate = PrivateBrowsingUtils.isWindowPrivate(chromeWin);
- let label, linkLabel, linkUrl, button1, button2;
+ let label, linkLabel, button1, button2;
if (action.fallbackType == Ci.nsIObjectLoadingContent.PLUGIN_ACTIVE) {
button1 = {
label: "pluginBlockNow.label",
accesskey: "pluginBlockNow.accesskey",
action: "_singleBlock"
};
button2 = {
@@ -2450,17 +2449,16 @@ file, You can obtain one at http://mozil
}
]]></body>
</method>
<method name="_setupDescription">
<parameter name="baseString" />
<parameter name="pluginName" /> <!-- null for the multiple-plugin case -->
<parameter name="prePath" />
<body><![CDATA[
- var bsn = this._brandShortName;
var span = document.getAnonymousElementByAttribute(this, "anonid", "click-to-play-plugins-notification-description");
while (span.lastChild) {
span.removeChild(span.lastChild);
}
var args = ["__prepath__", this._brandShortName];
if (pluginName) {
args.unshift(pluginName);