Bug 1348068 - Enable the key-spacing rule for eslint and fix the related issues. r=standard8

Running eslint with --fix didn't fix many of the issues. The majority here had to be fixed by hand but a significant majority of the issues were related to a few files that I was able to use find-and-replace with. I regret not making this in to separate commits of the hand-fixes and the fixes from --fix but I don't recall --fix fixing any of the issues.

MozReview-Commit-ID: ANyg2qfo3Qx

--HG--
extra : rebase_source : 61d2aa91bf9474af3d72a5dea41b25dca442c1b7
This commit is contained in:
Jared Wein 2017-03-21 14:29:43 -04:00
Родитель 3d91da8726
Коммит a54eda04ca
184 изменённых файлов: 2078 добавлений и 2076 удалений

Просмотреть файл

@ -96,7 +96,7 @@
panel.style.display = "block";
document.getElementById("netErrorButtonContainer").style.display = "none";
document.getElementById("prefResetButton").addEventListener("click", function resetPreferences(e) {
const event = new CustomEvent("AboutNetErrorResetPreferences", {bubbles:true});
const event = new CustomEvent("AboutNetErrorResetPreferences", {bubbles: true});
document.dispatchEvent(event);
});
addAutofocus("prefResetButton", "beforeend");
@ -127,7 +127,7 @@
if (panel.style.display == "block") {
// send event to trigger telemetry ping
var event = new CustomEvent("AboutNetErrorUIExpanded", {bubbles:true});
var event = new CustomEvent("AboutNetErrorUIExpanded", {bubbles: true});
document.dispatchEvent(event);
}
});
@ -292,7 +292,7 @@
}
}, true, true);
var event = new CustomEvent("AboutNetErrorLoad", {bubbles:true});
var event = new CustomEvent("AboutNetErrorLoad", {bubbles: true});
document.dispatchEvent(event);
if (err == "inadequateSecurityError") {
@ -315,7 +315,7 @@
document.getElementById("openPortalLoginPageButton")
.addEventListener("click", () => {
let event = new CustomEvent("AboutNetErrorOpenCaptivePortal", {bubbles:true});
let event = new CustomEvent("AboutNetErrorOpenCaptivePortal", {bubbles: true});
document.dispatchEvent(event);
});
@ -362,7 +362,7 @@
}
}, true, true);
let event = new CustomEvent("AboutNetErrorLoad", {bubbles:true});
let event = new CustomEvent("AboutNetErrorLoad", {bubbles: true});
document.getElementById("advancedButton").dispatchEvent(event);
addDomainErrorLinks();

Просмотреть файл

@ -105,7 +105,7 @@ var AboutTabCrashed = {
document.getElementById("email").addEventListener("input", this);
// Error pages are loaded as LOAD_BACKGROUND, so they don't get load events.
let event = new CustomEvent("AboutTabCrashedLoad", {bubbles:true});
let event = new CustomEvent("AboutTabCrashedLoad", {bubbles: true});
document.dispatchEvent(event);
sendAsyncMessage("Load");
@ -202,7 +202,7 @@ var AboutTabCrashed = {
document.getElementById("requestAutoSubmit").hidden = false;
}
let event = new CustomEvent("AboutTabCrashedReady", {bubbles:true});
let event = new CustomEvent("AboutTabCrashedReady", {bubbles: true});
document.dispatchEvent(event);
},

Просмотреть файл

@ -53,7 +53,7 @@ window.addEventListener("pageshow", function() {
window.addEventListener("resize", fitToWidth);
// Ask chrome to update snippets.
var event = new CustomEvent("AboutHomeLoad", {bubbles:true});
var event = new CustomEvent("AboutHomeLoad", {bubbles: true});
document.dispatchEvent(event);
});
@ -241,7 +241,7 @@ function setupSearch() {
* Inform the test harness that we're done loading the page.
*/
function loadCompleted() {
var event = new CustomEvent("AboutHomeLoadSnippetsCompleted", {bubbles:true});
var event = new CustomEvent("AboutHomeLoadSnippetsCompleted", {bubbles: true});
document.dispatchEvent(event);
}
@ -254,7 +254,7 @@ function loadSnippets() {
throw new Error("Snippets map has not properly been initialized");
// Allow tests to modify the snippets map before using it.
var event = new CustomEvent("AboutHomeLoadSnippets", {bubbles:true});
var event = new CustomEvent("AboutHomeLoadSnippets", {bubbles: true});
document.dispatchEvent(event);
// Check cached snippets version.

Просмотреть файл

@ -135,7 +135,7 @@
}
// Inform the test harness that we're done loading the page
var event = new CustomEvent("AboutBlockedLoaded", {bubbles:true});
var event = new CustomEvent("AboutBlockedLoaded", {bubbles: true});
document.dispatchEvent(event);
}
]]></script>

Просмотреть файл

@ -798,13 +798,13 @@ var gPopupBlockerObserver = {
} catch (e) { }
var bundlePreferences = document.getElementById("bundle_preferences");
var params = { blockVisible : false,
sessionVisible : false,
allowVisible : true,
prefilledHost : prefillValue,
permissionType : "popup",
windowTitle : bundlePreferences.getString("popuppermissionstitle"),
introText : bundlePreferences.getString("popuppermissionstext") };
var params = { blockVisible: false,
sessionVisible: false,
allowVisible: true,
prefilledHost: prefillValue,
permissionType: "popup",
windowTitle: bundlePreferences.getString("popuppermissionstitle"),
introText: bundlePreferences.getString("popuppermissionstext") };
var existingWindow = Services.wm.getMostRecentWindow("Browser:Permissions");
if (existingWindow) {
existingWindow.initWithParams(params);
@ -3056,7 +3056,7 @@ var BrowserOnClick = {
securityInfo = getSecurityInfo(securityInfoAsString);
let sslStatus = securityInfo.QueryInterface(Ci.nsISSLStatusProvider)
.SSLStatus;
let params = { exceptionAdded : false,
let params = { exceptionAdded: false,
sslStatus };
try {
@ -3611,7 +3611,7 @@ function openHomeDialog(aURL) {
var pressedVal = Services.prompt.confirmEx(window, promptTitle, promptMsg,
Services.prompt.STD_YES_NO_BUTTONS,
null, null, null, null, {value:0});
null, null, null, null, {value: 0});
if (pressedVal == 0) {
try {
@ -6232,7 +6232,7 @@ var OfflineApps = {
let options = {
persistent: true,
hideClose: true,
controlledItems : [[Cu.getWeakReference(browser), docId, uri]]
controlledItems: [[Cu.getWeakReference(browser), docId, uri]]
};
notification = PopupNotifications.show(browser, notificationID, message,
anchorID, mainAction,

Просмотреть файл

@ -55,15 +55,15 @@ var security = {
var retval = {
hostName,
cAName : issuerName,
encryptionAlgorithm : undefined,
encryptionStrength : undefined,
cAName: issuerName,
encryptionAlgorithm: undefined,
encryptionStrength: undefined,
version: undefined,
isBroken,
isMixed,
isEV,
cert,
certificateTransparency : undefined
certificateTransparency: undefined
};
var version;
@ -111,15 +111,15 @@ var security = {
}
return {
hostName,
cAName : "",
encryptionAlgorithm : "",
encryptionStrength : 0,
cAName: "",
encryptionAlgorithm: "",
encryptionStrength: 0,
version: "",
isBroken,
isMixed,
isEV,
cert : null,
certificateTransparency : null
cert: null,
certificateTransparency: null
};
},
@ -165,7 +165,7 @@ var security = {
win.focus();
} else
window.openDialog("chrome://browser/content/preferences/cookies.xul",
"Browser:Cookies", "", {filterString : eTLD});
"Browser:Cookies", "", {filterString: eTLD});
},
/**
@ -175,7 +175,7 @@ var security = {
LoginHelper.openPasswordManager(window, this._getSecurityInfo().hostName);
},
_cert : null
_cert: null
};
function securityOnLoad(uri, windowInfo) {

Просмотреть файл

@ -189,8 +189,8 @@ Sanitizer.prototype = {
// and can optionally specify a specific range. If timespan is not ignored,
// and range is not set, sanitize() will use the value of the timespan
// pref to determine a range
ignoreTimespan : true,
range : null,
ignoreTimespan: true,
range: null,
items: {
cache: {

Просмотреть файл

@ -46,7 +46,7 @@ add_task(function*() {
});
yield BrowserTestUtils.synthesizeMouseAtCenter(`#${id} > input`,
{ type : "contextmenu", button : 2 },
{ type: "contextmenu", button: 2 },
tab.linkedBrowser);
let target = yield contextMenuPromise;

Просмотреть файл

@ -13,7 +13,7 @@ function checkPopupHide() {
}
var gObserver = {
QueryInterface : XPCOMUtils.generateQI([Ci.nsIFormSubmitObserver]),
QueryInterface: XPCOMUtils.generateQI([Ci.nsIFormSubmitObserver]),
notifyInvalidSubmit(aFormElement, aInvalidElements) {
}

Просмотреть файл

@ -11,7 +11,7 @@ add_task(function *() {
// 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);
yield BrowserTestUtils.synthesizeMouse("#test-pagemenu", 5, 5, { type: "contextmenu", button: 2 }, tab.linkedBrowser);
yield popupShownPromise;
checkMenu(contextMenu);

Просмотреть файл

@ -46,7 +46,7 @@ function* expectFocusOnF6(backward, expectedDocument, expectedElement, onContent
if (!contentExpectedElement) {
sendSyncMessage("BrowserTest:FocusChanged",
{ details : "expected element " + arg.expectedElementId + " not found" });
{ details: "expected element " + arg.expectedElementId + " not found" });
return;
}

Просмотреть файл

@ -11,14 +11,14 @@ function test() {
var urlString = value + "\n" + content.document.title;
var htmlString = "<a href=\"" + value + "\">" + value + "</a>";
var expected = [ [
{ type : "text/x-moz-url",
data : urlString },
{ type : "text/uri-list",
data : value },
{ type : "text/plain",
data : value },
{ type : "text/html",
data : htmlString }
{ type: "text/x-moz-url",
data: urlString },
{ type: "text/uri-list",
data: value },
{ type: "text/plain",
data: value },
{ type: "text/html",
data: htmlString }
] ];
// set the valid attribute so dropping is allowed
var oldstate = gURLBar.getAttribute("pageproxystate");

Просмотреть файл

@ -519,41 +519,41 @@ function* setupFormHistory() {
op: "remove"
},
{
op : "add",
fieldname : "10minutes",
value : "10m"
op: "add",
fieldname: "10minutes",
value: "10m"
}, {
op : "add",
fieldname : "1hour",
value : "1h"
op: "add",
fieldname: "1hour",
value: "1h"
}, {
op : "add",
fieldname : "1hour10minutes",
value : "1h10m"
op: "add",
fieldname: "1hour10minutes",
value: "1h10m"
}, {
op : "add",
fieldname : "2hour",
value : "2h"
op: "add",
fieldname: "2hour",
value: "2h"
}, {
op : "add",
fieldname : "2hour10minutes",
value : "2h10m"
op: "add",
fieldname: "2hour10minutes",
value: "2h10m"
}, {
op : "add",
fieldname : "4hour",
value : "4h"
op: "add",
fieldname: "4hour",
value: "4h"
}, {
op : "add",
fieldname : "4hour10minutes",
value : "4h10m"
op: "add",
fieldname: "4hour10minutes",
value: "4h10m"
}, {
op : "add",
fieldname : "today",
value : "1d"
op: "add",
fieldname: "today",
value: "1d"
}, {
op : "add",
fieldname : "b4today",
value : "1y"
op: "add",
fieldname: "b4today",
value: "1y"
}]);
// Artifically age the entries to the proper vintage.

Просмотреть файл

@ -78,7 +78,7 @@ function focusInChild() {
id = getWindowDocId(event.originalTarget) + "-document";
else
id = event.originalTarget.id;
sendSyncMessage("Browser:FocusChanged", { details : event.type + ": " + id });
sendSyncMessage("Browser:FocusChanged", { details: event.type + ": " + id });
}
addEventListener("focus", eventListener, true);

Просмотреть файл

@ -12,7 +12,7 @@ function openContextMenuFor(element, shiftkey, waitForSpellCheck) {
// run on them.
function actuallyOpenContextMenuFor() {
lastElement = element;
var eventDetails = { type : "contextmenu", button : 2, shiftKey : shiftkey };
var eventDetails = { type: "contextmenu", button: 2, shiftKey: shiftkey };
synthesizeMouse(element, 2, 2, eventDetails, element.ownerGlobal);
}

Просмотреть файл

@ -77,7 +77,7 @@ var corpus = [
url: "https://www.mozilla.org/",
// shortUrl: this.getShortURL(),
// og:image
previews:["https://www.mozilla.org/favicon.png"],
previews: ["https://www.mozilla.org/favicon.png"],
// og:site_name
siteName: ">My simple test page<"
}

Просмотреть файл

@ -790,7 +790,7 @@ function openPreferences(paneID, extraArgs) {
}
function openAdvancedPreferences(tabID) {
openPreferences("paneAdvanced", { "advancedTab" : tabID });
openPreferences("paneAdvanced", { "advancedTab": tabID });
}
/**

Просмотреть файл

@ -222,7 +222,7 @@ add_task(function* test_datareporting_many() {
Assert.ok(ok, "callback should have been true");
checkDirectoryContains(targetDir, {
"datareporting" : {
"datareporting": {
"state.json": shouldBeCopied,
"session-state.json": shouldBeCopied,
}
@ -241,7 +241,7 @@ add_task(function* test_no_session_state() {
Assert.ok(ok, "callback should have been true");
checkDirectoryContains(targetDir, {
"datareporting" : {
"datareporting": {
"state.json": stateContent,
}
});
@ -259,7 +259,7 @@ add_task(function* test_no_state() {
Assert.ok(ok, "callback should have been true");
checkDirectoryContains(targetDir, {
"datareporting" : {
"datareporting": {
"session-state.json": sessionStateContent,
}
});

Просмотреть файл

@ -283,7 +283,7 @@ nsBrowserContentHandler.prototype = {
/* helper functions */
mChromeURL : null,
mChromeURL: null,
get chromeURL() {
if (this.mChromeURL) {
@ -296,13 +296,13 @@ nsBrowserContentHandler.prototype = {
},
/* nsISupports */
QueryInterface : XPCOMUtils.generateQI([nsICommandLineHandler,
nsIBrowserHandler,
nsIContentHandler,
nsICommandLineValidator]),
QueryInterface: XPCOMUtils.generateQI([nsICommandLineHandler,
nsIBrowserHandler,
nsIContentHandler,
nsICommandLineValidator]),
/* nsICommandLineHandler */
handle : function bch_handle(cmdLine) {
handle: function bch_handle(cmdLine) {
if (cmdLine.handleFlag("browser", false)) {
// Passing defaultArgs, so use NO_EXTERNAL_URIS
openWindow(null, this.chromeURL, "_blank",
@ -558,9 +558,9 @@ nsBrowserContentHandler.prototype = {
return uri;
},
mFeatures : null,
mFeatures: null,
getFeatures : function bch_features(cmdLine) {
getFeatures: function bch_features(cmdLine) {
if (this.mFeatures === null) {
this.mFeatures = "";
@ -587,7 +587,7 @@ nsBrowserContentHandler.prototype = {
/* nsIContentHandler */
handleContent : function bch_handleContent(contentType, context, request) {
handleContent: function bch_handleContent(contentType, context, request) {
try {
var webNavInfo = Components.classes["@mozilla.org/webnavigation-info;1"]
.getService(nsIWebNavigationInfo);
@ -605,7 +605,7 @@ nsBrowserContentHandler.prototype = {
},
/* nsICommandLineValidator */
validate : function bch_validate(cmdLine) {
validate: function bch_validate(cmdLine) {
// Other handlers may use osint so only handle the osint flag if the url
// flag is also present and the command line is valid.
var osintFlagIdx = cmdLine.findFlag("osint", false);
@ -669,7 +669,7 @@ nsDefaultCommandLineHandler.prototype = {
classID: Components.ID("{47cd0651-b1be-4a0f-b5c4-10e5a573ef71}"),
/* nsISupports */
QueryInterface : function dch_QI(iid) {
QueryInterface: function dch_QI(iid) {
if (!iid.equals(nsISupports) &&
!iid.equals(nsICommandLineHandler))
throw Components.results.NS_ERROR_NO_INTERFACE;
@ -680,7 +680,7 @@ nsDefaultCommandLineHandler.prototype = {
_haveProfile: false,
/* nsICommandLineHandler */
handle : function dch_handle(cmdLine) {
handle: function dch_handle(cmdLine) {
var urilist = [];
if (AppConstants.platform == "win") {
@ -765,7 +765,7 @@ nsDefaultCommandLineHandler.prototype = {
}
},
helpInfo : "",
helpInfo: "",
};
var components = [nsBrowserContentHandler, nsDefaultCommandLineHandler];

Просмотреть файл

@ -512,18 +512,18 @@ var BookmarkPropertiesPanel = {
var childTransactions = [];
if (this._description) {
let annoObj = { name : PlacesUIUtils.DESCRIPTION_ANNO,
type : Ci.nsIAnnotationService.TYPE_STRING,
flags : 0,
value : this._description,
let annoObj = { name: PlacesUIUtils.DESCRIPTION_ANNO,
type: Ci.nsIAnnotationService.TYPE_STRING,
flags: 0,
value: this._description,
expires: Ci.nsIAnnotationService.EXPIRE_NEVER };
let editItemTxn = new PlacesSetItemAnnotationTransaction(-1, annoObj);
childTransactions.push(editItemTxn);
}
if (this._loadInSidebar) {
let annoObj = { name : PlacesUIUtils.LOAD_IN_SIDEBAR_ANNO,
value : true };
let annoObj = { name: PlacesUIUtils.LOAD_IN_SIDEBAR_ANNO,
value: true };
let setLoadTxn = new PlacesSetItemAnnotationTransaction(-1, annoObj);
childTransactions.push(setLoadTxn);
}

Просмотреть файл

@ -671,7 +671,7 @@ var gEditItemOverlay = {
if (!this.initialized || !this._paneInfo.isBookmark)
return;
let annotation = { name : PlacesUIUtils.LOAD_IN_SIDEBAR_ANNO };
let annotation = { name: PlacesUIUtils.LOAD_IN_SIDEBAR_ANNO };
if (this._loadInSidebarCheckbox.checked)
annotation.value = true;

Просмотреть файл

@ -13,7 +13,7 @@ const UPDATE_TIME_PREF = "browser.safebrowsing.provider.mozilla.nextupdatetime";
var gBlocklistManager = {
_type: "",
_blockLists: [],
_brandShortName : null,
_brandShortName: null,
_bundle: null,
_tree: null,

Просмотреть файл

@ -16,12 +16,12 @@ XPCOMUtils.defineLazyModuleGetter(this, "ContextualIdentityService",
"resource://gre/modules/ContextualIdentityService.jsm");
var gCookiesWindow = {
_cm : Components.classes["@mozilla.org/cookiemanager;1"]
.getService(Components.interfaces.nsICookieManager),
_hosts : {},
_hostOrder : [],
_tree : null,
_bundle : null,
_cm: Components.classes["@mozilla.org/cookiemanager;1"]
.getService(Components.interfaces.nsICookieManager),
_hosts: {},
_hostOrder: [],
_tree: null,
_bundle: null,
init() {
var os = Components.classes["@mozilla.org/observer-service;1"]
@ -194,12 +194,12 @@ var gCookiesWindow = {
},
_view: {
_filtered : false,
_filterSet : [],
_filtered: false,
_filterSet: [],
_filterValue: "",
_rowCount : 0,
_cacheValid : 0,
_cacheItems : [],
_rowCount: 0,
_cacheValid: 0,
_cacheItems: [],
get rowCount() {
return this._rowCount;
},
@ -225,7 +225,7 @@ var gCookiesWindow = {
return currHost;
hostIndex = count;
var cacheEntry = { "start" : i, "count" : count };
var cacheEntry = { "start": i, "count": count };
var cacheStart = count;
if (currHost.open) {
@ -446,11 +446,11 @@ var gCookiesWindow = {
_addCookie(aStrippedHost, aCookie, aHostCount) {
if (!(aStrippedHost in this._hosts) || !this._hosts[aStrippedHost]) {
this._hosts[aStrippedHost] = { cookies : [],
rawHost : aStrippedHost,
level : 0,
open : false,
container : true };
this._hosts[aStrippedHost] = { cookies: [],
rawHost: aStrippedHost,
level: 0,
open: false,
container: true };
this._hostOrder.push(aStrippedHost);
++aHostCount.value;
}
@ -460,16 +460,16 @@ var gCookiesWindow = {
},
_makeCookieObject(aStrippedHost, aCookie) {
var c = { name : aCookie.name,
value : aCookie.value,
isDomain : aCookie.isDomain,
host : aCookie.host,
rawHost : aStrippedHost,
path : aCookie.path,
isSecure : aCookie.isSecure,
expires : aCookie.expires,
level : 1,
container : false,
var c = { name: aCookie.name,
value: aCookie.value,
isDomain: aCookie.isDomain,
host: aCookie.host,
rawHost: aStrippedHost,
path: aCookie.path,
isSecure: aCookie.isSecure,
expires: aCookie.expires,
level: 1,
container: false,
originAttributes: aCookie.originAttributes };
return c;
},
@ -736,7 +736,7 @@ var gCookiesWindow = {
}
},
_lastSortProperty : "",
_lastSortProperty: "",
_lastSortAscending: false,
sort(aProperty) {
var ascending = (aProperty == this._lastSortProperty) ? !this._lastSortAscending : true;

Просмотреть файл

@ -512,14 +512,14 @@ var gAdvancedPane = {
showOfflineExceptions() {
var bundlePreferences = document.getElementById("bundlePreferences");
var params = { blockVisible : false,
sessionVisible : false,
allowVisible : false,
prefilledHost : "",
permissionType : "offline-app",
manageCapability : Components.interfaces.nsIPermissionManager.DENY_ACTION,
windowTitle : bundlePreferences.getString("offlinepermissionstitle"),
introText : bundlePreferences.getString("offlinepermissionstext") };
var params = { blockVisible: false,
sessionVisible: false,
allowVisible: false,
prefilledHost: "",
permissionType: "offline-app",
manageCapability: Components.interfaces.nsIPermissionManager.DENY_ACTION,
windowTitle: bundlePreferences.getString("offlinepermissionstitle"),
introText: bundlePreferences.getString("offlinepermissionstext") };
gSubDialog.open("chrome://browser/content/preferences/permissions.xul",
null, params);
},

Просмотреть файл

@ -847,25 +847,25 @@ var gApplicationsPane = {
// Convenience & Performance Shortcuts
// These get defined by init().
_brandShortName : null,
_prefsBundle : null,
_list : null,
_filter : null,
_brandShortName: null,
_prefsBundle: null,
_list: null,
_filter: null,
_prefSvc : Cc["@mozilla.org/preferences-service;1"].
getService(Ci.nsIPrefBranch),
_prefSvc: Cc["@mozilla.org/preferences-service;1"].
getService(Ci.nsIPrefBranch),
_mimeSvc : Cc["@mozilla.org/mime;1"].
getService(Ci.nsIMIMEService),
_mimeSvc: Cc["@mozilla.org/mime;1"].
getService(Ci.nsIMIMEService),
_helperAppSvc : Cc["@mozilla.org/uriloader/external-helper-app-service;1"].
getService(Ci.nsIExternalHelperAppService),
_helperAppSvc: Cc["@mozilla.org/uriloader/external-helper-app-service;1"].
getService(Ci.nsIExternalHelperAppService),
_handlerSvc : Cc["@mozilla.org/uriloader/handler-service;1"].
getService(Ci.nsIHandlerService),
_handlerSvc: Cc["@mozilla.org/uriloader/handler-service;1"].
getService(Ci.nsIHandlerService),
_ioSvc : Cc["@mozilla.org/network/io-service;1"].
getService(Ci.nsIIOService),
_ioSvc: Cc["@mozilla.org/network/io-service;1"].
getService(Ci.nsIIOService),
// Initialization & Destruction

Просмотреть файл

@ -182,18 +182,18 @@ var gContentPane = {
const kFontSizeFmtVariable = "font.size.variable.%LANG%";
var preferences = document.getElementById("contentPreferences");
var prefs = [{ format : aIsSerif ? kFontNameFmtSerif : kFontNameFmtSansSerif,
type : "fontname",
element : "defaultFont",
fonttype : aIsSerif ? "serif" : "sans-serif" },
{ format : aIsSerif ? kFontNameListFmtSerif : kFontNameListFmtSansSerif,
type : "unichar",
element : null,
fonttype : aIsSerif ? "serif" : "sans-serif" },
{ format : kFontSizeFmtVariable,
type : "int",
element : "defaultFontSize",
fonttype : null }];
var prefs = [{ format: aIsSerif ? kFontNameFmtSerif : kFontNameFmtSansSerif,
type: "fontname",
element: "defaultFont",
fonttype: aIsSerif ? "serif" : "sans-serif" },
{ format: aIsSerif ? kFontNameListFmtSerif : kFontNameListFmtSansSerif,
type: "unichar",
element: null,
fonttype: aIsSerif ? "serif" : "sans-serif" },
{ format: kFontSizeFmtVariable,
type: "int",
element: "defaultFontSize",
fonttype: null }];
for (var i = 0; i < prefs.length; ++i) {
var preference = document.getElementById(prefs[i].format.replace(/%LANG%/, aLanguageGroup));
if (!preference) {

Просмотреть файл

@ -607,13 +607,13 @@ var gPrivacyPane = {
*/
showCookieExceptions() {
var bundlePreferences = document.getElementById("bundlePreferences");
var params = { blockVisible : true,
sessionVisible : true,
allowVisible : true,
prefilledHost : "",
permissionType : "cookie",
windowTitle : bundlePreferences.getString("cookiepermissionstitle"),
introText : bundlePreferences.getString("cookiepermissionstext") };
var params = { blockVisible: true,
sessionVisible: true,
allowVisible: true,
prefilledHost: "",
permissionType: "cookie",
windowTitle: bundlePreferences.getString("cookiepermissionstitle"),
introText: bundlePreferences.getString("cookiepermissionstext") };
gSubDialog.open("chrome://browser/content/preferences/permissions.xul",
null, params);
},

Просмотреть файл

@ -5,10 +5,10 @@
var gLanguagesDialog = {
_availableLanguagesList : [],
_acceptLanguages : { },
_availableLanguagesList: [],
_acceptLanguages: { },
_selectedItemID : null,
_selectedItemID: null,
init() {
if (!this._availableLanguagesList.length)

Просмотреть файл

@ -21,13 +21,13 @@ function Permission(principal, type, capability) {
}
var gPermissionManager = {
_type : "",
_permissions : [],
_permissionsToAdd : new Map(),
_permissionsToDelete : new Map(),
_bundle : null,
_tree : null,
_observerRemoved : false,
_type: "",
_permissions: [],
_permissionsToAdd: new Map(),
_permissionsToDelete: new Map(),
_bundle: null,
_tree: null,
_observerRemoved: false,
_view: {
_rowCount: 0,

Просмотреть файл

@ -80,7 +80,7 @@ document.addEventListener("DOMContentLoaded", function() {
function openPrivateWindow() {
// Ask chrome to open a private window
document.dispatchEvent(
new CustomEvent("AboutPrivateBrowsingOpenWindow", {bubbles:true}));
new CustomEvent("AboutPrivateBrowsingOpenWindow", {bubbles: true}));
}
function toggleTrackingProtection() {

Просмотреть файл

@ -21,7 +21,7 @@ function test() {
// Test the certificate exceptions dialog
function doTest() {
let params = {
exceptionAdded : false,
exceptionAdded: false,
location: INVALID_CERT_LOCATION,
prefetchCert: true,
};

Просмотреть файл

@ -31,7 +31,7 @@ add_task(function* test() {
// Step 2
let private_window = yield BrowserTestUtils.openNewBrowserWindow({ private : true });
let private_window = yield BrowserTestUtils.openNewBrowserWindow({ private: true });
let private_browser = private_window.getBrowser().selectedBrowser;
private_browser.loadURI(prefix + "?action=set&name=test2&value=value2");
yield BrowserTestUtils.browserLoaded(private_browser);
@ -56,7 +56,7 @@ add_task(function* test() {
// Reopen the private window again, without privateBrowsing, which should clear the
// the private storage.
private_window.close();
private_window = yield BrowserTestUtils.openNewBrowserWindow({ private : false });
private_window = yield BrowserTestUtils.openNewBrowserWindow({ private: false });
private_browser = null;
yield new Promise(resolve => Cu.schedulePreciseGC(resolve));
private_browser = private_window.getBrowser().selectedBrowser;
@ -71,7 +71,7 @@ add_task(function* test() {
// Making it private again should clear the storage and it shouldn't
// be able to see the old private storage as well.
private_window.close();
private_window = yield BrowserTestUtils.openNewBrowserWindow({ private : true });
private_window = yield BrowserTestUtils.openNewBrowserWindow({ private: true });
private_browser = null;
yield new Promise(resolve => Cu.schedulePreciseGC(resolve));
private_browser = private_window.getBrowser().selectedBrowser;

Просмотреть файл

@ -59,7 +59,7 @@ add_task(function* test() {
yield waitForTitleChanged();
is(PlacesUtils.history.getPageTitle(TEST_URI), TITLE_2, "The title matches the updated title after updating visit");
let privateWin = yield BrowserTestUtils.openNewBrowserWindow({private:true});
let privateWin = yield BrowserTestUtils.openNewBrowserWindow({private: true});
yield BrowserTestUtils.browserLoaded(privateWin.gBrowser.addTab(TEST_URL).linkedBrowser);
is(PlacesUtils.history.getPageTitle(TEST_URI), TITLE_2, "The title remains the same after visiting in private window");

Просмотреть файл

@ -426,9 +426,9 @@
// Save the current value in the form history
if (aData && !PrivateBrowsingUtils.isWindowPrivate(window) && this.FormHistory.enabled) {
this.FormHistory.update(
{ op : "bump",
fieldname : textBox.getAttribute("autocompletesearchparam"),
value : aData },
{ op: "bump",
fieldname: textBox.getAttribute("autocompletesearchparam"),
value: aData },
{ handleError(aError) {
Components.utils.reportError("Saving search to form history failed: " + aError.message);
}});
@ -843,7 +843,7 @@
case "cmd_clearhistory":
var param = this._self.getAttribute("autocompletesearchparam");
BrowserSearch.searchBar.FormHistory.update({ op : "remove", fieldname : param }, null);
BrowserSearch.searchBar.FormHistory.update({ op: "remove", fieldname: param }, null);
this._self.value = "";
break;
case "cmd_togglesuggest":

Просмотреть файл

@ -34,7 +34,7 @@ function test() {
wrappedJSObject: {
queryCharset: "UTF-8",
"_iconURL": "resource://search-plugins/images/amazon.ico",
_urls : [
_urls: [
{
type: "application/x-suggestions+json",
method: "GET",

Просмотреть файл

@ -44,7 +44,7 @@ function test() {
wrappedJSObject: {
queryCharset: "UTF-8",
"_iconURL": "data:image/x-icon;base64,AAABAAIAICAAAAEACACoCAAAJgAAABAQAAABAAgAaAUAAM4IAAAoAAAAIAAAAEAAAAABAAgAAAAAAIAEAAAAAAAAAAAAAAABAAAAAAAAhIQMAI+PIwCXlzEAn59BAKioUwCurl8AtbVuAL6+fwDJyZMA0tKlANjYsgDe3r4A5eXMAOzs2QDy8uUA+fnzAP///wAAGi8AAC1QAAA/cAAAUZAAAGOwAAB2zwAAiPAAEZj/ADGm/wBRs/8AccH/AJHP/wCx3f8A0ev/AP///wAAAAAAACwvAABLUAAAaHAAAIaQAAClsAAAw88AAOHwABHv/wAx8f8AUfP/AHH1/wCR9/8Asfn/ANH7/wD///8AAAAAAAAvIQAAUDcAAHBMAACQYwAAsHkAAM+PAADwpgAR/7QAMf++AFH/yABx/9MAkf/cALH/5QDR//AA////AAAAAAAALw4AAFAYAABwIgAAkCwAALA2AADPQAAA8EoAEf9bADH/cQBR/4cAcf+dAJH/sgCx/8kA0f/fAP///wAAAAAAAi8AAARQAAAGcAAACJAAAAqwAAALzwAADvAAACD/EgA9/zEAW/9RAHn/cQCY/5EAtf+xANT/0QD///8AAAAAABQvAAAiUAAAMHAAAD2QAABMsAAAWc8AAGfwAAB4/xEAiv8xAJz/UQCu/3EAwP+RANL/sQDk/9EA////AAAAAAAmLwAAQFAAAFpwAAB0kAAAjrAAAKnPAADC8AAA0f8RANj/MQDe/1EA4/9xAOn/kQDv/7EA9v/RAP///wAAAAAALyYAAFBBAABwWwAAkHQAALCOAADPqQAA8MMAAP/SEQD/2DEA/91RAP/kcQD/6pEA//CxAP/20QD///8AAAAAAC8UAABQIgAAcDAAAJA+AACwTQAAz1sAAPBpAAD/eREA/4oxAP+dUQD/r3EA/8GRAP/SsQD/5dEA////AAAAAAAvAwAAUAQAAHAGAACQCQAAsAoAAM8MAADwDgAA/yASAP8+MQD/XFEA/3pxAP+XkQD/trEA/9TRAP///wAAAAAALwAOAFAAFwBwACEAkAArALAANgDPAEAA8ABJAP8RWgD/MXAA/1GGAP9xnAD/kbIA/7HIAP/R3wD///8AAAAAAC8AIABQADYAcABMAJAAYgCwAHgAzwCOAPAApAD/EbMA/zG+AP9RxwD/cdEA/5HcAP+x5QD/0fAA////AAAAAAAsAC8ASwBQAGkAcACHAJAApQCwAMQAzwDhAPAA8BH/APIx/wD0Uf8A9nH/APeR/wD5sf8A+9H/AP///wAAAAAAGwAvAC0AUAA/AHAAUgCQAGMAsAB2AM8AiADwAJkR/wCmMf8AtFH/AMJx/wDPkf8A3LH/AOvR/wD///8AAAAAAAgALwAOAFAAFQBwABsAkAAhALAAJgDPACwA8AA+Ef8AWDH/AHFR/wCMcf8AppH/AL+x/wDa0f8A////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABBggCAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAsQEA0HAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwkPEBAQEBALBAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEMEBAQEBAQEBAPCQMAAAAAAAAAAAAAAAAAAAAAAAAAAQ0QEBAQEBAQEBAQDQgBAAAAAAAAAAAAAAAAAAAAAAABDRAQEBAQEBAQEBAQEA0GAQAAAAAAAAAAAAAAAAAAAAENEBAQDgcLEBAQEBAQEBALBAAAAAAAAAAAAAAAAAAAAQ0QEBANAQEHDRAQEBAQEBAOCAAAAAAAAAAAAAAAAAABDRAQEA4BAAACCA4QEBAQEBANAQAAAAAAAAAAAAAAAAENEBAQDgEAAAAABAsQEBAQEA0BAAAAAAAAAAAAAAAAAQ0QEBAOAQAAAAABBw4QEBAQDQEAAAAAAAAAAAAAAAABDRAQEA4BAAABBw0QEBAQEBANAQAAAAAAAAAAAAAAAAENEBAQDgEAAAcQEBAQEBAQEA0BAAAAAAAAAAAAAAAAAQ0QEBAOAQABCxAQEBAQEBANBwAAAAAAAAAAAAAAAAABDRAQEA4BAAQPEBAQEA0IBAEAAAAAAAAAAAAAAAAAAAENEBAQDgEACRAQDQkGAQAAAAAAAAAAAAAAAAAAAAAAAQ0QEBAOAQILCgYCAAAAAAAAAAAAAAAAAAAAAAAAAAABDRAQEA4BAQIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAENEBAQDgEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQ0QEBAOAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABDRAQEA4BAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAENEBAQDgEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQ0QEBAOAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABDRAQEA0BAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAENEA0IBAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQcFAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACgAAAAQAAAAIAAAAAEACAAAAAAAQAEAAAAAAAAAAAAAAAEAAAAAAACEhAAAjIwAAJKSFgCZmSgAqqpRALKyYgC+vnsAxsaKAM3NmQDU1KgA4ODBAOjozwDw8OEA+fnyAP///wD///8AAAAAAAAaLwAALVAAAD9wAABRkAAAY7AAAHbPAACI8AARmP8AMab/AFGz/wBxwf8Akc//ALHd/wDR6/8A////AAAAAAAALC8AAEtQAABocAAAhpAAAKWwAADDzwAA4fAAEe//ADHx/wBR8/8AcfX/AJH3/wCx+f8A0fv/AP///wAAAAAAAC8hAABQNwAAcEwAAJBjAACweQAAz48AAPCmABH/tAAx/74AUf/IAHH/0wCR/9wAsf/lANH/8AD///8AAAAAAAAvDgAAUBgAAHAiAACQLAAAsDYAAM9AAADwSgAR/1sAMf9xAFH/hwBx/50Akf+yALH/yQDR/98A////AAAAAAACLwAABFAAAAZwAAAIkAAACrAAAAvPAAAO8AAAIP8SAD3/MQBb/1EAef9xAJj/kQC1/7EA1P/RAP///wAAAAAAFC8AACJQAAAwcAAAPZAAAEywAABZzwAAZ/AAAHj/EQCK/zEAnP9RAK7/cQDA/5EA0v+xAOT/0QD///8AAAAAACYvAABAUAAAWnAAAHSQAACOsAAAqc8AAMLwAADR/xEA2P8xAN7/UQDj/3EA6f+RAO//sQD2/9EA////AAAAAAAvJgAAUEEAAHBbAACQdAAAsI4AAM+pAADwwwAA/9IRAP/YMQD/3VEA/+RxAP/qkQD/8LEA//bRAP///wAAAAAALxQAAFAiAABwMAAAkD4AALBNAADPWwAA8GkAAP95EQD/ijEA/51RAP+vcQD/wZEA/9KxAP/l0QD///8AAAAAAC8DAABQBAAAcAYAAJAJAACwCgAAzwwAAPAOAAD/IBIA/z4xAP9cUQD/enEA/5eRAP+2sQD/1NEA////AAAAAAAvAA4AUAAXAHAAIQCQACsAsAA2AM8AQADwAEkA/xFaAP8xcAD/UYYA/3GcAP+RsgD/scgA/9HfAP///wAAAAAALwAgAFAANgBwAEwAkABiALAAeADPAI4A8ACkAP8RswD/Mb4A/1HHAP9x0QD/kdwA/7HlAP/R8AD///8AAAAAACwALwBLAFAAaQBwAIcAkAClALAAxADPAOEA8ADwEf8A8jH/APRR/wD2cf8A95H/APmx/wD70f8A////AAAAAAAbAC8ALQBQAD8AcABSAJAAYwCwAHYAzwCIAPAAmRH/AKYx/wC0Uf8AwnH/AM+R/wDcsf8A69H/AP///wAAAAAACAAvAA4AUAAVAHAAGwCQACEAsAAmAM8ALADwAD4R/wBYMf8AcVH/AIxx/wCmkf8Av7H/ANrR/wD///8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwMAAAAAAAAAAAAAAAACBgwMBwIAAAAAAAAAAAAABg4ODg4MBgIAAAAAAAAAAAYODQoODg4KBAAAAAAAAAAGDgwDBQsODg4FAAAAAAAABg4MAgADCg4OBgAAAAAAAAYODAICCg4ODgYAAAAAAAAGDgwCBg4OCwcCAAAAAAAABg4MAwkIBAIAAAAAAAAAAAYODAICAAAAAAAAAAAAAAAGDgwCAAAAAAAAAAAAAAAABg4MAgAAAAAAAAAAAAAAAAYMCAEAAAAAAAAAAAAAAAACAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=",
_urls : [
_urls: [
{
type: "application/x-suggestions+json",
method: "GET",
@ -100,7 +100,7 @@ function test() {
{
name: "form",
value: "MOZLBR",
purpose:"keyword",
purpose: "keyword",
},
{
name: "form",

Различия файлов скрыты, потому что одна или несколько строк слишком длинны

Различия файлов скрыты, потому что одна или несколько строк слишком длинны

Просмотреть файл

@ -48,7 +48,7 @@ function test() {
wrappedJSObject: {
queryCharset: "UTF-8",
"_iconURL": "resource://search-plugins/images/yahoo.ico",
_urls : [
_urls: [
{
type: "application/x-suggestions+json",
method: "GET",

Просмотреть файл

@ -4458,7 +4458,7 @@ var SessionStoreInternal = {
*
* @returns aString that has been updated with the new title
*/
_replaceLoadingTitle : function ssi_replaceLoadingTitle(aString, aTabbrowser, aTab) {
_replaceLoadingTitle: function ssi_replaceLoadingTitle(aString, aTabbrowser, aTab) {
if (aString == aTabbrowser.mStringBundle.getString("tabs.connecting")) {
aTabbrowser.setTabTitle(aTab);
[aString, aTab.label] = [aTab.label, aString];
@ -4471,7 +4471,7 @@ var SessionStoreInternal = {
* where we don't have any non-popup windows on Windows and Linux. Then we must
* resize such that we have at least one non-popup window.
*/
_capClosedWindows : function ssi_capClosedWindows() {
_capClosedWindows: function ssi_capClosedWindows() {
if (this._closedWindows.length <= this._max_windows_undo)
return;
let spliceTo = this._max_windows_undo;

Просмотреть файл

@ -339,10 +339,10 @@ SessionStartup.prototype = {
},
/* ........ QueryInterface .............. */
QueryInterface : XPCOMUtils.generateQI([Ci.nsIObserver,
Ci.nsISupportsWeakReference,
Ci.nsISessionStartup]),
classID: Components.ID("{ec7a6c20-e081-11da-8ad9-0800200c9a66}")
QueryInterface: XPCOMUtils.generateQI([Ci.nsIObserver,
Ci.nsISupportsWeakReference,
Ci.nsISessionStartup]),
classID: Components.ID("{ec7a6c20-e081-11da-8ad9-0800200c9a66}")
};
this.NSGetFactory = XPCOMUtils.generateNSGetFactory([SessionStartup]);

Просмотреть файл

@ -35,7 +35,7 @@ function test() {
const REMEMBER = Date.now(), FORGET = Math.random();
let testState = {
windows: [ { tabs: [{ entries: [{ url: "http://example.com/", triggeringPrincipal_base64 }] }], selected: 1 } ],
_closedWindows : [
_closedWindows: [
// _closedWindows[0]
{
tabs: [

Просмотреть файл

@ -18,7 +18,7 @@ function test() {
promiseWindowLoaded(newWin).then(() => {
ss.setWindowValue(newWin, uniqueKey1, uniqueValue1);
let newState = { windows: [{ tabs:[{ entries: [] }], extData: {} }] };
let newState = { windows: [{ tabs: [{ entries: [] }], extData: {} }] };
newState.windows[0].extData[uniqueKey2] = uniqueValue2;
ss.setWindowState(newWin, JSON.stringify(newState), false);

Просмотреть файл

@ -11,7 +11,7 @@ function test() {
const REMEMBER = Date.now(), FORGET = Math.random();
let test_state = {
windows: [ { tabs: [{ entries: [{ url: "http://example.com/", triggeringPrincipal_base64 }] }], selected: 1 } ],
_closedWindows : [
_closedWindows: [
// _closedWindows[0]
{
tabs: [

Просмотреть файл

@ -24,7 +24,7 @@ let checkState = Task.async(function*(browser) {
ContentTask.spawn(browser, null, function() {
is(content.testState, "foo",
"testState after going back");
is(JSON.stringify(content.history.state), JSON.stringify({obj1:1}),
is(JSON.stringify(content.history.state), JSON.stringify({obj1: 1}),
"first popstate object.");
// Add a node with id "new-elem" to the document.
@ -95,9 +95,9 @@ add_task(function* test() {
// testURL?page2 (state object: {obj3:/^a$/}) <-- newest
function contentTest() {
let history = content.window.history;
history.pushState({obj1:1}, "title-obj1");
history.pushState({obj2:2}, "title-obj2", "?page2");
history.replaceState({obj3:/^a$/}, "title-obj3");
history.pushState({obj1: 1}, "title-obj1");
history.pushState({obj2: 2}, "title-obj2", "?page2");
history.replaceState({obj3: /^a$/}, "title-obj3");
}
yield ContentTask.spawn(browser, null, contentTest);
yield TabStateFlusher.flush(browser);

Просмотреть файл

@ -1,15 +1,15 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
var windowState = {windows:[{tabs:[
{entries:[{url:"http://example.com#1", triggeringPrincipal_base64}]},
{entries:[{url:"http://example.com#2", triggeringPrincipal_base64}]},
{entries:[{url:"http://example.com#3", triggeringPrincipal_base64}]},
{entries:[{url:"http://example.com#4", triggeringPrincipal_base64}]},
{entries:[{url:"http://example.com#5", triggeringPrincipal_base64}], hidden: true},
{entries:[{url:"http://example.com#6", triggeringPrincipal_base64}], hidden: true},
{entries:[{url:"http://example.com#7", triggeringPrincipal_base64}], hidden: true},
{entries:[{url:"http://example.com#8", triggeringPrincipal_base64}], hidden: true}
var windowState = {windows: [{tabs: [
{entries: [{url: "http://example.com#1", triggeringPrincipal_base64}]},
{entries: [{url: "http://example.com#2", triggeringPrincipal_base64}]},
{entries: [{url: "http://example.com#3", triggeringPrincipal_base64}]},
{entries: [{url: "http://example.com#4", triggeringPrincipal_base64}]},
{entries: [{url: "http://example.com#5", triggeringPrincipal_base64}], hidden: true},
{entries: [{url: "http://example.com#6", triggeringPrincipal_base64}], hidden: true},
{entries: [{url: "http://example.com#7", triggeringPrincipal_base64}], hidden: true},
{entries: [{url: "http://example.com#8", triggeringPrincipal_base64}], hidden: true}
]}]};
function test() {

Просмотреть файл

@ -31,7 +31,7 @@ function testBug600545() {
let state = { windows: [
{
tabs: [
{ entries: [{ url: "http://example.org#0", triggeringPrincipal_base64 }], pinned:true },
{ entries: [{ url: "http://example.org#0", triggeringPrincipal_base64 }], pinned: true },
{ entries: [{ url: "http://example.com#1", triggeringPrincipal_base64 }] },
{ entries: [{ url: "http://example.com#2", triggeringPrincipal_base64 }] },
],

Просмотреть файл

@ -3,15 +3,15 @@
var stateBackup = ss.getBrowserState();
var statePinned = {windows:[{tabs:[
{entries:[{url:"http://example.com#1", triggeringPrincipal_base64}], pinned: true}
var statePinned = {windows: [{tabs: [
{entries: [{url: "http://example.com#1", triggeringPrincipal_base64}], pinned: true}
]}]};
var state = {windows:[{tabs:[
{entries:[{url:"http://example.com#1", triggeringPrincipal_base64}]},
{entries:[{url:"http://example.com#2", triggeringPrincipal_base64}]},
{entries:[{url:"http://example.com#3", triggeringPrincipal_base64}]},
{entries:[{url:"http://example.com#4", triggeringPrincipal_base64}]},
var state = {windows: [{tabs: [
{entries: [{url: "http://example.com#1", triggeringPrincipal_base64}]},
{entries: [{url: "http://example.com#2", triggeringPrincipal_base64}]},
{entries: [{url: "http://example.com#3", triggeringPrincipal_base64}]},
{entries: [{url: "http://example.com#4", triggeringPrincipal_base64}]},
]}]};
function test() {

Просмотреть файл

@ -19,19 +19,19 @@ function test() {
// new format
// index doesn't match value (testing an option in between (two))
{ id:{ "select_id": {"selectedIndex":0, "value":"val2"} } },
{ id: { "select_id": {"selectedIndex": 0, "value": "val2"} } },
// index doesn't match value (testing an invalid value)
{ id:{ "select_id": {"selectedIndex":4, "value":"val8"} } },
{ id: { "select_id": {"selectedIndex": 4, "value": "val8"} } },
// index doesn't match value (testing an invalid index)
{ id:{ "select_id": {"selectedIndex":8, "value":"val5"} } },
{ id: { "select_id": {"selectedIndex": 8, "value": "val5"} } },
// index and value match position zero
{ id:{ "select_id": {"selectedIndex":0, "value":"val0"} }, xpath: {} },
{ id: { "select_id": {"selectedIndex": 0, "value": "val0"} }, xpath: {} },
// index doesn't match value (testing the last option (seven))
{ id:{}, "xpath":{ "/xhtml:html/xhtml:body/xhtml:select[@name='select_name']": {"selectedIndex":1, "value":"val7"} } },
{ id: {}, "xpath": { "/xhtml:html/xhtml:body/xhtml:select[@name='select_name']": {"selectedIndex": 1, "value": "val7"} } },
// index and value match the default option "selectedIndex":3,"value":"val3"
{ xpath: { "/xhtml:html/xhtml:body/xhtml:select[@name='select_name']" : {"selectedIndex":3, "value":"val3"} } },
{ xpath: { "/xhtml:html/xhtml:body/xhtml:select[@name='select_name']": {"selectedIndex": 3, "value": "val3"} } },
// index matches default option however it doesn't match value
{ id:{ "select_id": {"selectedIndex":3, "value":"val4"} } },
{ id: { "select_id": {"selectedIndex": 3, "value": "val4"} } },
];
let expectedValues = [

Просмотреть файл

@ -10,7 +10,7 @@
var stateBackup = ss.getBrowserState();
var state = {windows:[{tabs:[{entries:[
var state = {windows: [{tabs: [{entries: [
{
docIdentifier: 1,
url: "http://example.com",

Просмотреть файл

@ -7,7 +7,7 @@
var stateBackup = ss.getBrowserState();
var state = {entries:[
var state = {entries: [
{
docIdentifier: 1,
url: "http://example.com?1",

Просмотреть файл

@ -1,9 +1,9 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
var state = {windows:[{tabs:[
{entries:[{url:"http://example.com#1", triggeringPrincipal_base64}]},
{entries:[{url:"http://example.com#2", triggeringPrincipal_base64}], hidden: true}
var state = {windows: [{tabs: [
{entries: [{url: "http://example.com#1", triggeringPrincipal_base64}]},
{entries: [{url: "http://example.com#2", triggeringPrincipal_base64}], hidden: true}
]}]};
function test() {

Просмотреть файл

@ -10,25 +10,25 @@ function test() {
let formData = [
{ },
// old format
{ "#input1" : "value0" },
{ "#input1" : "value1", "/xhtml:html/xhtml:body/xhtml:input[@name='input2']" : "value2" },
{ "/xhtml:html/xhtml:body/xhtml:input[@name='input2']" : "value3" },
{ "#input1": "value0" },
{ "#input1": "value1", "/xhtml:html/xhtml:body/xhtml:input[@name='input2']": "value2" },
{ "/xhtml:html/xhtml:body/xhtml:input[@name='input2']": "value3" },
// new format
{ id: { "input1" : "value4" } },
{ id: { "input1" : "value5" }, xpath: {} },
{ id: { "input1" : "value6" }, xpath: { "/xhtml:html/xhtml:body/xhtml:input[@name='input2']" : "value7" } },
{ id: {}, xpath: { "/xhtml:html/xhtml:body/xhtml:input[@name='input2']" : "value8" } },
{ xpath: { "/xhtml:html/xhtml:body/xhtml:input[@name='input2']" : "value9" } },
{ id: { "input1": "value4" } },
{ id: { "input1": "value5" }, xpath: {} },
{ id: { "input1": "value6" }, xpath: { "/xhtml:html/xhtml:body/xhtml:input[@name='input2']": "value7" } },
{ id: {}, xpath: { "/xhtml:html/xhtml:body/xhtml:input[@name='input2']": "value8" } },
{ xpath: { "/xhtml:html/xhtml:body/xhtml:input[@name='input2']": "value9" } },
// combinations
{ "#input1" : "value10", id: { "input1" : "value11" } },
{ "#input1" : "value12", id: { "input1" : "value13" }, xpath: { "/xhtml:html/xhtml:body/xhtml:input[@name='input2']" : "value14" } },
{ "#input1" : "value15", xpath: { "/xhtml:html/xhtml:body/xhtml:input[@name='input2']" : "value16" } },
{ "/xhtml:html/xhtml:body/xhtml:input[@name='input2']" : "value17", id: { "input1" : "value18" } },
{ "/xhtml:html/xhtml:body/xhtml:input[@name='input2']" : "value19", id: { "input1" : "value20" }, xpath: { "/xhtml:html/xhtml:body/xhtml:input[@name='input2']" : "value21" } },
{ "/xhtml:html/xhtml:body/xhtml:input[@name='input2']" : "value22", xpath: { "/xhtml:html/xhtml:body/xhtml:input[@name='input2']" : "value23" } },
{ "#input1" : "value24", "/xhtml:html/xhtml:body/xhtml:input[@name='input2']" : "value25", id: { "input1" : "value26" } },
{ "#input1" : "value27", "/xhtml:html/xhtml:body/xhtml:input[@name='input2']" : "value28", id: { "input1" : "value29" }, xpath: { "/xhtml:html/xhtml:body/xhtml:input[@name='input2']" : "value30" } },
{ "#input1" : "value31", "/xhtml:html/xhtml:body/xhtml:input[@name='input2']" : "value32", xpath: { "/xhtml:html/xhtml:body/xhtml:input[@name='input2']" : "value33" } }
{ "#input1": "value10", id: { "input1": "value11" } },
{ "#input1": "value12", id: { "input1": "value13" }, xpath: { "/xhtml:html/xhtml:body/xhtml:input[@name='input2']": "value14" } },
{ "#input1": "value15", xpath: { "/xhtml:html/xhtml:body/xhtml:input[@name='input2']": "value16" } },
{ "/xhtml:html/xhtml:body/xhtml:input[@name='input2']": "value17", id: { "input1": "value18" } },
{ "/xhtml:html/xhtml:body/xhtml:input[@name='input2']": "value19", id: { "input1": "value20" }, xpath: { "/xhtml:html/xhtml:body/xhtml:input[@name='input2']": "value21" } },
{ "/xhtml:html/xhtml:body/xhtml:input[@name='input2']": "value22", xpath: { "/xhtml:html/xhtml:body/xhtml:input[@name='input2']": "value23" } },
{ "#input1": "value24", "/xhtml:html/xhtml:body/xhtml:input[@name='input2']": "value25", id: { "input1": "value26" } },
{ "#input1": "value27", "/xhtml:html/xhtml:body/xhtml:input[@name='input2']": "value28", id: { "input1": "value29" }, xpath: { "/xhtml:html/xhtml:body/xhtml:input[@name='input2']": "value30" } },
{ "#input1": "value31", "/xhtml:html/xhtml:body/xhtml:input[@name='input2']": "value32", xpath: { "/xhtml:html/xhtml:body/xhtml:input[@name='input2']": "value33" } }
]
let expectedValues = [
[ "", "" ],

Просмотреть файл

@ -23,12 +23,12 @@ add_task(function*() {
// We're going to click on the first link, so listen for another load event
info("Clicking on link 1, 1 load should take place");
let promise = waitForLoadsInBrowser(tab.linkedBrowser, 1);
EventUtils.sendMouseEvent({type:"click"}, links[0], browser_b.contentWindow);
EventUtils.sendMouseEvent({type: "click"}, links[0], browser_b.contentWindow);
yield promise;
info("Clicking on link 2, 1 load should take place");
promise = waitForLoadsInBrowser(tab.linkedBrowser, 1);
EventUtils.sendMouseEvent({type:"click"}, links[1], browser_b.contentWindow);
EventUtils.sendMouseEvent({type: "click"}, links[1], browser_b.contentWindow);
yield promise;
info("Close then un-close page, 4 loads should take place");
@ -68,12 +68,12 @@ add_task(function*() {
// We're going to click on the first link, so listen for another load event
info("iframe: Clicking on link 1, 1 load should take place");
let promise = waitForLoadsInBrowser(tab.linkedBrowser, 1);
EventUtils.sendMouseEvent({type:"click"}, links[0], browser_b.contentWindow);
EventUtils.sendMouseEvent({type: "click"}, links[0], browser_b.contentWindow);
yield promise;
info("iframe: Clicking on link 2, 1 load should take place");
promise = waitForLoadsInBrowser(tab.linkedBrowser, 1);
EventUtils.sendMouseEvent({type:"click"}, links[1], browser_b.contentWindow);
EventUtils.sendMouseEvent({type: "click"}, links[1], browser_b.contentWindow);
yield promise;
info("iframe: Close then un-close page, 5 loads should take place");
@ -131,12 +131,12 @@ add_task(function*() {
// We're going to click on the first link, so listen for another load event
info("dynamic: Clicking on link 1, 1 load should take place");
let promise = waitForLoadsInBrowser(tab.linkedBrowser, 1);
EventUtils.sendMouseEvent({type:"click"}, links[0], browser_b.contentWindow);
EventUtils.sendMouseEvent({type: "click"}, links[0], browser_b.contentWindow);
yield promise;
info("dynamic: Clicking on link 2, 1 load should take place");
promise = waitForLoadsInBrowser(tab.linkedBrowser, 1);
EventUtils.sendMouseEvent({type:"click"}, links[1], browser_b.contentWindow);
EventUtils.sendMouseEvent({type: "click"}, links[1], browser_b.contentWindow);
yield promise;
info("Check in the state that we have not stored this history");

Просмотреть файл

@ -95,7 +95,7 @@ add_task(function* () {
let win2 = yield BrowserTestUtils.openNewBrowserWindow();
let tab2 = win2.gBrowser.addTab("http://example.com/", { userContextId : 1 });
let tab2 = win2.gBrowser.addTab("http://example.com/", { userContextId: 1 });
yield promiseBrowserLoaded(tab2.linkedBrowser);
yield TabStateFlusher.flush(tab2.linkedBrowser);

Просмотреть файл

@ -73,7 +73,7 @@ add_task(function* test_one_file_valid() {
let invalidSession = "data/sessionstore_invalid.js";
let validSession = "data/sessionstore_valid.js";
reset_session({
clean : invalidSession,
clean: invalidSession,
cleanBackup: validSession,
recovery: invalidSession,
recoveryBackup: invalidSession
@ -95,7 +95,7 @@ add_task(function* test_all_files_corrupt() {
// Corrupting all backup files.
let invalidSession = "data/sessionstore_invalid.js";
reset_session({
clean : invalidSession,
clean: invalidSession,
cleanBackup: invalidSession,
recovery: invalidSession,
recoveryBackup: invalidSession

Просмотреть файл

@ -7,12 +7,12 @@ Components.utils.import("resource://gre/modules/AppConstants.jsm");
var Ci = Components.interfaces;
var gSetBackground = {
_position : AppConstants.platform == "macosx" ? "STRETCH" : "",
_backgroundColor : AppConstants.platform != "macosx" ? 0 : undefined,
_screenWidth : 0,
_screenHeight : 0,
_image : null,
_canvas : null,
_position: AppConstants.platform == "macosx" ? "STRETCH" : "",
_backgroundColor: AppConstants.platform != "macosx" ? 0 : undefined,
_screenWidth: 0,
_screenHeight: 0,
_image: null,
_canvas: null,
get _shell() {
return Components.classes["@mozilla.org/browser/shell-service;1"]

Просмотреть файл

@ -86,8 +86,8 @@ this.Translation = {
* The list of translation engines and their attributions.
*/
supportedEngines: {
"bing" : "http://aka.ms/MicrosoftTranslatorAttribution",
"yandex" : "http://translate.yandex.com/"
"bing": "http://aka.ms/MicrosoftTranslatorAttribution",
"yandex": "http://translate.yandex.com/"
},
/**
@ -301,18 +301,18 @@ this.TranslationTelemetry = {
const plain = (id) => Services.telemetry.getHistogramById(id);
const keyed = (id) => Services.telemetry.getKeyedHistogramById(id);
this.HISTOGRAMS = {
OPPORTUNITIES : () => plain("TRANSLATION_OPPORTUNITIES"),
OPPORTUNITIES_BY_LANG : () => keyed("TRANSLATION_OPPORTUNITIES_BY_LANGUAGE"),
PAGES : () => plain("TRANSLATED_PAGES"),
PAGES_BY_LANG : () => keyed("TRANSLATED_PAGES_BY_LANGUAGE"),
CHARACTERS : () => plain("TRANSLATED_CHARACTERS"),
DENIED : () => plain("DENIED_TRANSLATION_OFFERS"),
AUTO_REJECTED : () => plain("AUTO_REJECTED_TRANSLATION_OFFERS"),
SHOW_ORIGINAL : () => plain("REQUESTS_OF_ORIGINAL_CONTENT"),
TARGET_CHANGES : () => plain("CHANGES_OF_TARGET_LANGUAGE"),
DETECTION_CHANGES : () => plain("CHANGES_OF_DETECTED_LANGUAGE"),
SHOW_UI : () => plain("SHOULD_TRANSLATION_UI_APPEAR"),
DETECT_LANG : () => plain("SHOULD_AUTO_DETECT_LANGUAGE"),
OPPORTUNITIES: () => plain("TRANSLATION_OPPORTUNITIES"),
OPPORTUNITIES_BY_LANG: () => keyed("TRANSLATION_OPPORTUNITIES_BY_LANGUAGE"),
PAGES: () => plain("TRANSLATED_PAGES"),
PAGES_BY_LANG: () => keyed("TRANSLATED_PAGES_BY_LANGUAGE"),
CHARACTERS: () => plain("TRANSLATED_CHARACTERS"),
DENIED: () => plain("DENIED_TRANSLATION_OFFERS"),
AUTO_REJECTED: () => plain("AUTO_REJECTED_TRANSLATION_OFFERS"),
SHOW_ORIGINAL: () => plain("REQUESTS_OF_ORIGINAL_CONTENT"),
TARGET_CHANGES: () => plain("CHANGES_OF_TARGET_LANGUAGE"),
DETECTION_CHANGES: () => plain("CHANGES_OF_DETECTED_LANGUAGE"),
SHOW_UI: () => plain("SHOULD_TRANSLATION_UI_APPEAR"),
DETECT_LANG: () => plain("SHOULD_AUTO_DETECT_LANGUAGE"),
};
// Capturing the values of flags at the startup.

Просмотреть файл

@ -10,18 +10,18 @@ const Telemetry = Services.telemetry;
var MetricsChecker = {
HISTOGRAMS: {
OPPORTUNITIES : Services.telemetry.getHistogramById("TRANSLATION_OPPORTUNITIES"),
OPPORTUNITIES_BY_LANG : Services.telemetry.getKeyedHistogramById("TRANSLATION_OPPORTUNITIES_BY_LANGUAGE"),
PAGES : Services.telemetry.getHistogramById("TRANSLATED_PAGES"),
PAGES_BY_LANG : Services.telemetry.getKeyedHistogramById("TRANSLATED_PAGES_BY_LANGUAGE"),
CHARACTERS : Services.telemetry.getHistogramById("TRANSLATED_CHARACTERS"),
DENIED : Services.telemetry.getHistogramById("DENIED_TRANSLATION_OFFERS"),
AUTO_REJECTED : Services.telemetry.getHistogramById("AUTO_REJECTED_TRANSLATION_OFFERS"),
SHOW_ORIGINAL : Services.telemetry.getHistogramById("REQUESTS_OF_ORIGINAL_CONTENT"),
TARGET_CHANGES : Services.telemetry.getHistogramById("CHANGES_OF_TARGET_LANGUAGE"),
DETECTION_CHANGES : Services.telemetry.getHistogramById("CHANGES_OF_DETECTED_LANGUAGE"),
SHOW_UI : Services.telemetry.getHistogramById("SHOULD_TRANSLATION_UI_APPEAR"),
DETECT_LANG : Services.telemetry.getHistogramById("SHOULD_AUTO_DETECT_LANGUAGE"),
OPPORTUNITIES: Services.telemetry.getHistogramById("TRANSLATION_OPPORTUNITIES"),
OPPORTUNITIES_BY_LANG: Services.telemetry.getKeyedHistogramById("TRANSLATION_OPPORTUNITIES_BY_LANGUAGE"),
PAGES: Services.telemetry.getHistogramById("TRANSLATED_PAGES"),
PAGES_BY_LANG: Services.telemetry.getKeyedHistogramById("TRANSLATED_PAGES_BY_LANGUAGE"),
CHARACTERS: Services.telemetry.getHistogramById("TRANSLATED_CHARACTERS"),
DENIED: Services.telemetry.getHistogramById("DENIED_TRANSLATION_OFFERS"),
AUTO_REJECTED: Services.telemetry.getHistogramById("AUTO_REJECTED_TRANSLATION_OFFERS"),
SHOW_ORIGINAL: Services.telemetry.getHistogramById("REQUESTS_OF_ORIGINAL_CONTENT"),
TARGET_CHANGES: Services.telemetry.getHistogramById("CHANGES_OF_TARGET_LANGUAGE"),
DETECTION_CHANGES: Services.telemetry.getHistogramById("CHANGES_OF_DETECTED_LANGUAGE"),
SHOW_UI: Services.telemetry.getHistogramById("SHOULD_TRANSLATION_UI_APPEAR"),
DETECT_LANG: Services.telemetry.getHistogramById("SHOULD_AUTO_DETECT_LANGUAGE"),
},
reset() {
@ -180,9 +180,9 @@ add_task(function* test_telemetry() {
yield translate("<h1>Hallo Welt!</h1><h1>Bratwurst!</h1>", "de");
yield MetricsChecker.checkAdditions({
opportunitiesCount: 2,
opportunitiesCountByLang: { "ru" : 1, "de" : 1 },
opportunitiesCountByLang: { "ru": 1, "de": 1 },
pageCount: 1,
pageCountByLang: { "de -> en" : 1 },
pageCountByLang: { "de -> en": 1 },
charCount: 21,
deniedOffers: 0
});
@ -276,11 +276,11 @@ add_task(function* test_never_offer_translation() {
add_task(function* test_translation_preferences() {
let preferenceChecks = {
"browser.translation.ui.show" : [
"browser.translation.ui.show": [
{value: false, expected: {showUI: 0}},
{value: true, expected: {showUI: 1}}
],
"browser.translation.detectLanguage" : [
"browser.translation.detectLanguage": [
{value: false, expected: {detectLang: 0}},
{value: true, expected: {detectLang: 1}}
],

Просмотреть файл

@ -18,14 +18,14 @@ MockShellService.prototype = {
},
shouldCheckDefaultBrowser: false,
canSetDesktopBackground: false,
BACKGROUND_TILE : 1,
BACKGROUND_STRETCH : 2,
BACKGROUND_CENTER : 3,
BACKGROUND_FILL : 4,
BACKGROUND_FIT : 5,
BACKGROUND_TILE: 1,
BACKGROUND_STRETCH: 2,
BACKGROUND_CENTER: 3,
BACKGROUND_FILL: 4,
BACKGROUND_FIT: 5,
setDesktopBackground(aElement, aPosition) {},
APPLICATION_MAIL : 0,
APPLICATION_NEWS : 1,
APPLICATION_MAIL: 0,
APPLICATION_NEWS: 1,
openApplication(aApplication) {},
desktopBackgroundColor: 0,
openApplicationWithURI(aApplication, aURI) {},

12
browser/extensions/e10srollout/bootstrap.js поставляемый
Просмотреть файл

@ -12,15 +12,15 @@ Cu.import("resource://gre/modules/UpdateUtils.jsm");
// The amount of people to be part of e10s
const TEST_THRESHOLD = {
"beta" : 0.5, // 50%
"release" : 1.0, // 100%
"esr" : 1.0, // 100%
"beta": 0.5, // 50%
"release": 1.0, // 100%
"esr": 1.0, // 100%
};
const ADDON_ROLLOUT_POLICY = {
"beta" : "51alladdons", // Any WebExtension or addon except with mpc = false
"release" : "50allmpc",
"esr" : "esrA", // WebExtensions and Addons with mpc=true
"beta": "51alladdons", // Any WebExtension or addon except with mpc = false
"release": "50allmpc",
"esr": "esrA", // WebExtensions and Addons with mpc=true
};
const PREF_COHORT_SAMPLE = "e10s.rollout.cohortSample";

Просмотреть файл

@ -397,12 +397,12 @@ var pktUI = (function() {
pktUIMessaging.addMessageListener(iframe, "collapseSavePanel", function(panelId, data) {
if (!pktApi.isPremiumUser() && !isInOverflowMenu())
resizePanel({width:savePanelWidth, height:savePanelHeights.collapsed});
resizePanel({width: savePanelWidth, height: savePanelHeights.collapsed});
});
pktUIMessaging.addMessageListener(iframe, "expandSavePanel", function(panelId, data) {
if (!isInOverflowMenu())
resizePanel({width:savePanelWidth, height:savePanelHeights.expanded});
resizePanel({width: savePanelWidth, height: savePanelHeights.expanded});
});
// Ask for recently accessed/used tags for auto complete

Просмотреть файл

@ -159,7 +159,7 @@ var PKT_SAVED_OVERLAY = function(options) {
var r = new RegExp("^" + term);
for (var i = 0; i < myself.userTags.length; i++) {
if (r.test(myself.userTags[i]) && limit > 0) {
returnlist.push({name:myself.userTags[i]});
returnlist.push({name: myself.userTags[i]});
limit--;
}
}
@ -182,7 +182,7 @@ var PKT_SAVED_OVERLAY = function(options) {
return null;
}
myself.hideTagsError();
return {name:myself.sanitizeText(text.toLowerCase())};
return {name: myself.sanitizeText(text.toLowerCase())};
},
onReady() {
$(".token-input-dropdown").addClass("token-input-dropdown-tag");
@ -195,7 +195,7 @@ var PKT_SAVED_OVERLAY = function(options) {
return;
}
myself.justaddedsuggested = true;
inputwrapper.find(".pkt_ext_tag_input").tokenInput("add", {id:inputwrapper.find(".token-input-token").length, name:tag.text()});
inputwrapper.find(".pkt_ext_tag_input").tokenInput("add", {id: inputwrapper.find(".token-input-token").length, name: tag.text()});
tag.addClass("token-suggestedtag-inactive");
$(".token-input-input-token input").focus();
});
@ -242,7 +242,7 @@ var PKT_SAVED_OVERLAY = function(options) {
if (selected.length) {
e.preventDefault();
e.stopImmediatePropagation();
inputwrapper.find(".pkt_ext_tag_input").tokenInput("remove", {name:selected.find("p").text()});
inputwrapper.find(".pkt_ext_tag_input").tokenInput("remove", {name: selected.find("p").text()});
}
} else if ($(e.target).parent().hasClass("token-input-input-token")) {
e.stopImmediatePropagation();

Просмотреть файл

@ -35,7 +35,7 @@ function setPreviewBG(backgroundData) {
}
function sendReceivedEvent() {
window.dispatchEvent(new CustomEvent("ScreenshotReceived", {bubbles:true}));
window.dispatchEvent(new CustomEvent("ScreenshotReceived", {bubbles: true}));
}
window.addEventListener("message", function(event) {

Просмотреть файл

@ -236,5 +236,5 @@ FormSubmitObserver.prototype =
(target.ownerDocument && target.ownerDocument == this._content.document));
},
QueryInterface : XPCOMUtils.generateQI([Ci.nsIFormSubmitObserver])
QueryInterface: XPCOMUtils.generateQI([Ci.nsIFormSubmitObserver])
};

Просмотреть файл

@ -30,7 +30,7 @@ do_get_profile();
const DIRECTORY_LINKS_FILE = "directoryLinks.json";
const DIRECTORY_FRECENCY = 1000;
const SUGGESTED_FRECENCY = Infinity;
const kURLData = {"directory": [{"url":"http://example.com", "title":"LocalSource"}]};
const kURLData = {"directory": [{"url": "http://example.com", "title": "LocalSource"}]};
const kTestURL = "data:application/json," + JSON.stringify(kURLData);
// DirectoryLinksProvider preferences
@ -57,7 +57,7 @@ Services.prefs.setCharPref(kPingUrlPref, kPingUrl);
Services.prefs.setBoolPref(kNewtabEnhancedPref, true);
const kHttpHandlerData = {};
kHttpHandlerData[kExamplePath] = {"directory": [{"url":"http://example.com", "title":"RemoteSource"}]};
kHttpHandlerData[kExamplePath] = {"directory": [{"url": "http://example.com", "title": "RemoteSource"}]};
const BinaryInputStream = CC("@mozilla.org/binaryinputstream;1",
"nsIBinaryInputStream",
@ -1107,10 +1107,10 @@ add_task(function* test_DirectoryLinksProvider_enhancedURIs() {
let data = {
"suggested": [
{url: "http://example.net", enhancedImageURI: "data:,net1", title:"SuggestedTitle", adgroup_name: "Test", frecent_sites: ["test.com"]}
{url: "http://example.net", enhancedImageURI: "data:,net1", title: "SuggestedTitle", adgroup_name: "Test", frecent_sites: ["test.com"]}
],
"directory": [
{url: "http://example.net", enhancedImageURI: "data:,net2", title:"DirectoryTitle"}
{url: "http://example.net", enhancedImageURI: "data:,net2", title: "DirectoryTitle"}
]
};
let dataURI = "data:application/json," + JSON.stringify(data);

Просмотреть файл

@ -60,7 +60,7 @@ function MapEntries() {
}
_SetCanonicalName(MapEntries, "entries");
var iteratorTemp = { mapIterationResultPair : null };
var iteratorTemp = { mapIterationResultPair: null };
function MapIteratorNext() {
// Step 1.

Просмотреть файл

@ -62,7 +62,7 @@ function SetSpecies() {
_SetCanonicalName(SetSpecies, "get [Symbol.species]");
var setIteratorTemp = { setIterationResult : null };
var setIteratorTemp = { setIterationResult: null };
function SetIteratorNext() {
// Step 1.

Просмотреть файл

@ -1242,11 +1242,11 @@ function MapTypedSeqImpl(inArray, depth, outputType, func) {
// Compute iteration space for input and output and check for compatibility.
var inputType = TypeOfTypedObject(inArray);
var {iterationSpace:inIterationSpace, grainType:inGrainType} =
var {iterationSpace: inIterationSpace, grainType: inGrainType} =
ComputeIterationSpace(inputType, depth, inArray.length);
if (!IsObject(inGrainType) || !ObjectIsTypeDescr(inGrainType))
ThrowTypeError(JSMSG_TYPEDOBJECT_BAD_ARGS);
var {iterationSpace, grainType:outGrainType, totalLength} =
var {iterationSpace, grainType: outGrainType, totalLength} =
ComputeIterationSpace(outputType, depth, outputType.length);
for (var i = 0; i < depth; i++)
if (inIterationSpace[i] !== iterationSpace[i])

Просмотреть файл

@ -103,7 +103,7 @@ let tabFinder = {
return null;
}
let tabbrowser = browser.getTabBrowser();
return {tabbrowser, tab:tabbrowser.getTabForBrowser(browser)};
return {tabbrowser, tab: tabbrowser.getTabForBrowser(browser)};
},
getAny(ids) {

Просмотреть файл

@ -9,7 +9,7 @@ function AppPicker() {}
AppPicker.prototype =
{
// Class members
_incomingParams:null,
_incomingParams: null,
/**
* Init the dialog and populate the application list

Просмотреть файл

@ -186,8 +186,8 @@ nsAsyncShutdownClient.prototype = {
},
/* ........ QueryInterface .............. */
QueryInterface : XPCOMUtils.generateQI([Ci.nsIAsyncShutdownBarrier]),
classID: Components.ID("{314e9e96-cc37-4d5c-843b-54709ce11426}"),
QueryInterface: XPCOMUtils.generateQI([Ci.nsIAsyncShutdownBarrier]),
classID: Components.ID("{314e9e96-cc37-4d5c-843b-54709ce11426}"),
};
/**
@ -218,8 +218,8 @@ nsAsyncShutdownBarrier.prototype = {
},
/* ........ QueryInterface .............. */
QueryInterface : XPCOMUtils.generateQI([Ci.nsIAsyncShutdownBarrier]),
classID: Components.ID("{29a0e8b5-9111-4c09-a0eb-76cd02bf20fa}"),
QueryInterface: XPCOMUtils.generateQI([Ci.nsIAsyncShutdownBarrier]),
classID: Components.ID("{29a0e8b5-9111-4c09-a0eb-76cd02bf20fa}"),
};
function nsAsyncShutdownService() {
@ -265,8 +265,8 @@ nsAsyncShutdownService.prototype = {
},
/* ........ QueryInterface .............. */
QueryInterface : XPCOMUtils.generateQI([Ci.nsIAsyncShutdownService]),
classID: Components.ID("{35c496de-a115-475d-93b5-ffa3f3ae6fe3}"),
QueryInterface: XPCOMUtils.generateQI([Ci.nsIAsyncShutdownService]),
classID: Components.ID("{35c496de-a115-475d-93b5-ffa3f3ae6fe3}"),
};

Просмотреть файл

@ -39,21 +39,21 @@ function test_conversions() {
a: 1,
b: true,
c: "string",
d:.5,
d: .5,
e: [2, false, "another string", .3],
f: [],
g: {
a2: 1,
b2: true,
c2: "string",
d2:.5,
d2: .5,
e2: [2, false, "another string", .3],
f2: [],
g2: [{
a3: 1,
b3: true,
c3: "string",
d3:.5,
d3: .5,
e3: [2, false, "another string", .3],
f3: [],
g3: {}

Просмотреть файл

@ -156,7 +156,7 @@ AutoCompleteSearch.prototype = {
name: null,
// AutoCompleteResult
_result:null,
_result: null,
/**

Просмотреть файл

@ -154,7 +154,7 @@ AutoCompleteSearch.prototype = {
name: null,
// AutoCompleteResult
_result:null,
_result: null,
/**

Просмотреть файл

@ -143,7 +143,7 @@ AutoCompleteSearch.prototype = {
name: null,
// AutoCompleteResult
_result:null,
_result: null,
/**

Просмотреть файл

@ -173,7 +173,7 @@ function LoginObserver(captivePortalDetector) {
/*
* Check if login activity is finished according to HTTP burst.
*/
notify : function notify() {
notify: function notify() {
switch (state) {
case LOGIN_OBSERVER_STATE_BURST:
// Wait while network stays idle for a short period

Просмотреть файл

@ -12,7 +12,7 @@ function run_test() {
do_check_eq(0, statement.getInt32(0));
// These are the different types of aGroup arguments we'll test.
var anObject = {"foo":"bar"}; // a simple object
var anObject = {"foo": "bar"}; // a simple object
var uri = ContentPrefTest.getURI("http://www.example.com/"); // nsIURI
var stringURI = "www.example.com"; // typeof = "string"
var stringObjectURI = new String("www.example.com"); // typeof = "object"

Просмотреть файл

@ -136,10 +136,10 @@ function run_test() {
}
);
const rect_t = new ctypes.StructType("myRECT",
[{ top : ctypes.int32_t },
{ left : ctypes.int32_t },
[{ top: ctypes.int32_t },
{ left: ctypes.int32_t },
{ bottom: ctypes.int32_t },
{ right : ctypes.int32_t }]);
{ right: ctypes.int32_t }]);
samples.push(
{
name: "struct",

Просмотреть файл

@ -1341,7 +1341,7 @@ function run_StructType_tests() {
// Check that malformed descriptors are an error.
do_check_throws(function() {
ctypes.StructType("a", [{"x":ctypes.int32_t}, {"x":ctypes.int8_t}]);
ctypes.StructType("a", [{"x": ctypes.int32_t}, {"x": ctypes.int8_t}]);
}, TypeError);
do_check_throws(function() {
ctypes.StructType("a", [5]);
@ -1350,16 +1350,16 @@ function run_StructType_tests() {
ctypes.StructType("a", [{}]);
}, TypeError);
do_check_throws(function() {
ctypes.StructType("a", [{5:ctypes.int32_t}]);
ctypes.StructType("a", [{5: ctypes.int32_t}]);
}, TypeError);
do_check_throws(function() {
ctypes.StructType("a", [{"5":ctypes.int32_t}]);
ctypes.StructType("a", [{"5": ctypes.int32_t}]);
}, TypeError);
do_check_throws(function() {
ctypes.StructType("a", [{"x":5}]);
ctypes.StructType("a", [{"x": 5}]);
}, TypeError);
do_check_throws(function() {
ctypes.StructType("a", [{"x":ctypes.int32_t()}]);
ctypes.StructType("a", [{"x": ctypes.int32_t()}]);
}, TypeError);
// Check that opaque structs work.
@ -2106,7 +2106,7 @@ function run_type_toString_tests() {
do_check_eq(c.voidptr_t.toString(), "type void*");
do_check_eq(c.char16_t.toString(), "type char16_t");
var simplestruct = c.StructType("simplestruct", [{"smitty":c.voidptr_t}]);
var simplestruct = c.StructType("simplestruct", [{"smitty": c.voidptr_t}]);
do_check_eq(simplestruct.toString(), "type simplestruct");
// One type modifier, int base type.
@ -2401,10 +2401,10 @@ function run_struct_tests(library) {
[{ x: ctypes.int32_t },
{ y: ctypes.int32_t }]);
const rect_t = new ctypes.StructType("myRECT",
[{ top : ctypes.int32_t },
{ left : ctypes.int32_t },
[{ top: ctypes.int32_t },
{ left: ctypes.int32_t },
{ bottom: ctypes.int32_t },
{ right : ctypes.int32_t }]);
{ right: ctypes.int32_t }]);
let test_pt_in_rect = library.declare("test_pt_in_rect", ctypes.default_abi, ctypes.int32_t, rect_t, point_t);
let rect = new rect_t(10, 5, 5, 10);
@ -2418,11 +2418,11 @@ function run_struct_tests(library) {
{ i2: ctypes.int64_t },
{ i3: ctypes.uint8_t }]);
const nested_t = new ctypes.StructType("NESTED",
[{ n1 : ctypes.int32_t },
{ n2 : ctypes.int16_t },
[{ n1: ctypes.int32_t },
{ n2: ctypes.int16_t },
{ inner: inner_t },
{ n3 : ctypes.int64_t },
{ n4 : ctypes.int32_t }]);
{ n3: ctypes.int64_t },
{ n4: ctypes.int32_t }]);
let test_nested_struct = library.declare("test_nested_struct", ctypes.default_abi, ctypes.int32_t, nested_t);
let inner = new inner_t(161, 523412, 43);
@ -2703,10 +2703,10 @@ function run_variadic_tests(library) {
function run_static_data_tests(library) {
const rect_t = new ctypes.StructType("myRECT",
[{ top : ctypes.int32_t },
{ left : ctypes.int32_t },
[{ top: ctypes.int32_t },
{ left: ctypes.int32_t },
{ bottom: ctypes.int32_t },
{ right : ctypes.int32_t }]);
{ right: ctypes.int32_t }]);
let data_rect = library.declare("data_rect", rect_t);

Просмотреть файл

@ -413,7 +413,7 @@ SessionStorage.prototype = {
return this.has(aName) ? this._storage[aName] : aDefaultValue;
},
QueryInterface : XPCOMUtils.generateQI([Ci.extISessionStorage])
QueryInterface: XPCOMUtils.generateQI([Ci.extISessionStorage])
};
// =================================================

Просмотреть файл

@ -162,31 +162,31 @@ function makePropGetter(key) {
const RDF_NS = "http://www.w3.org/1999/02/22-rdf-syntax-ns#";
// namespace map
var gNamespaces = {
"http://webns.net/mvcb/":"admin",
"http://backend.userland.com/rss":"",
"http://blogs.law.harvard.edu/tech/rss":"",
"http://www.w3.org/2005/Atom":"atom",
"http://purl.org/atom/ns#":"atom03",
"http://purl.org/rss/1.0/modules/content/":"content",
"http://purl.org/dc/elements/1.1/":"dc",
"http://purl.org/dc/terms/":"dcterms",
"http://www.w3.org/1999/02/22-rdf-syntax-ns#":"rdf",
"http://purl.org/rss/1.0/":"rss1",
"http://my.netscape.com/rdf/simple/0.9/":"rss1",
"http://wellformedweb.org/CommentAPI/":"wfw",
"http://purl.org/rss/1.0/modules/wiki/":"wiki",
"http://www.w3.org/XML/1998/namespace":"xml",
"http://search.yahoo.com/mrss/":"media",
"http://search.yahoo.com/mrss":"media"
"http://webns.net/mvcb/": "admin",
"http://backend.userland.com/rss": "",
"http://blogs.law.harvard.edu/tech/rss": "",
"http://www.w3.org/2005/Atom": "atom",
"http://purl.org/atom/ns#": "atom03",
"http://purl.org/rss/1.0/modules/content/": "content",
"http://purl.org/dc/elements/1.1/": "dc",
"http://purl.org/dc/terms/": "dcterms",
"http://www.w3.org/1999/02/22-rdf-syntax-ns#": "rdf",
"http://purl.org/rss/1.0/": "rss1",
"http://my.netscape.com/rdf/simple/0.9/": "rss1",
"http://wellformedweb.org/CommentAPI/": "wfw",
"http://purl.org/rss/1.0/modules/wiki/": "wiki",
"http://www.w3.org/XML/1998/namespace": "xml",
"http://search.yahoo.com/mrss/": "media",
"http://search.yahoo.com/mrss": "media"
}
// We allow a very small set of namespaces in XHTML content,
// for attributes only
var gAllowedXHTMLNamespaces = {
"http://www.w3.org/XML/1998/namespace":"xml",
"http://www.w3.org/XML/1998/namespace": "xml",
// if someone ns qualifies XHTML, we have to prefix it to avoid an
// attribute collision.
"http://www.w3.org/1999/xhtml":"xhtml"
"http://www.w3.org/1999/xhtml": "xhtml"
}
function FeedResult() {}
@ -229,7 +229,7 @@ Feed.prototype = {
items: ["items", "atom03_entries", "entries"],
id: ["atom:id", "rdf:about"],
generator: ["generator"],
authors : ["authors"],
authors: ["authors"],
contributors: ["contributors"],
link: [["link", strToURI], ["rss1:link", strToURI]],
categories: ["categories", "dc:subject"],
@ -404,7 +404,7 @@ Entry.prototype = {
link: [["link", strToURI], ["rss1:link", strToURI]],
id: [["guid", makePropGetter("guid")], "rdf:about",
"atom03:id", "atom:id"],
authors : ["authors"],
authors: ["authors"],
contributors: ["contributors"],
summary: ["description", "rss1:description", "dc:description",
"atom03:summary", "atom:summary"],
@ -1054,21 +1054,21 @@ function FeedProcessor() {
// These elements can contain (X)HTML or plain text.
// We keep a table here that contains their default treatment
this._textConstructs = {"atom:title":"text",
"atom:summary":"text",
"atom:rights":"text",
"atom:content":"text",
"atom:subtitle":"text",
"description":"html",
"rss1:description":"html",
"dc:description":"html",
"content:encoded":"html",
"title":"text",
"rss1:title":"text",
"atom03:title":"text",
"atom03:tagline":"text",
"atom03:summary":"text",
"atom03:content":"text"};
this._textConstructs = {"atom:title": "text",
"atom:summary": "text",
"atom:rights": "text",
"atom:content": "text",
"atom:subtitle": "text",
"description": "html",
"rss1:description": "html",
"dc:description": "html",
"content:encoded": "html",
"title": "text",
"rss1:title": "text",
"atom03:title": "text",
"atom03:tagline": "text",
"atom03:summary": "text",
"atom03:content": "text"};
this._stack = [];
this._trans = {
@ -1133,7 +1133,7 @@ function FeedProcessor() {
"day": new ElementInfo("days", null, rssArrayElement, true)
},
"IN_SKIPHOURS":{
"IN_SKIPHOURS": {
"hour": new ElementInfo("hours", null, rssArrayElement, true)
},
@ -1610,10 +1610,10 @@ FeedProcessor.prototype = {
// Only for RSS2esque formats
_findRSSVersion: function FP__findRSSVersion(attributes) {
var versionAttr = attributes.getValueFromName("", "version").trim();
var versions = { "0.91":"rss091",
"0.92":"rss092",
"0.93":"rss093",
"0.94":"rss094" }
var versions = { "0.91": "rss091",
"0.92": "rss092",
"0.93": "rss093",
"0.94": "rss094" }
if (versions[versionAttr])
return versions[versionAttr];
if (versionAttr.substr(0, 2) != "2.")

Просмотреть файл

@ -628,7 +628,7 @@ function newDir() {
gFilePickerBundle.getString("promptNewDirTitle");
var dialogMsg =
gFilePickerBundle.getString("promptNewDirMessage");
var ret = promptService.prompt(window, dialogTitle, dialogMsg, gNewDirName, null, {value:0});
var ret = promptService.prompt(window, dialogTitle, dialogMsg, gNewDirName, null, {value: 0});
if (ret) {
file = processPath(gNewDirName.value);

Просмотреть файл

@ -33,7 +33,7 @@ function* test_download_state_complete(aTab, aDownload, aPrivate, aCanceled) {
}
function* test_createDownload_common(aPrivate, aType) {
let win = yield BrowserTestUtils.openNewBrowserWindow({ private : aPrivate});
let win = yield BrowserTestUtils.openNewBrowserWindow({ private: aPrivate});
let tab = yield BrowserTestUtils.openNewForegroundTab(win.gBrowser, getRootDirectory(gTestPath) + "testFile.html");
let download = yield Downloads.createDownload({

Просмотреть файл

@ -263,9 +263,9 @@ add_task(function* test_save_reload_unknownProperties() {
target: { path: getTempFile(TEST_TARGET_FILE_NAME).path,
target1: "download3target1",
target2: "download3target2" },
saver : { type: "copy",
saver1: "download3saver1",
saver2: "download3saver2" },
saver: { type: "copy",
saver1: "download3saver1",
saver2: "download3saver2" },
});
listForSave.add(download3);

Просмотреть файл

@ -27,7 +27,7 @@ function do_check_eq(a, b) {
}
function do_test_complete() {
self.postMessage({kind: "do_test_complete", args:[]});
self.postMessage({kind: "do_test_complete", args: []});
}
self.onmessage = function() {

Просмотреть файл

@ -37,11 +37,11 @@ nsDefaultCLH.prototype = {
/* nsISupports */
QueryInterface : XPCOMUtils.generateQI([nsICommandLineHandler]),
QueryInterface: XPCOMUtils.generateQI([nsICommandLineHandler]),
/* nsICommandLineHandler */
handle : function clh_handle(cmdLine) {
handle: function clh_handle(cmdLine) {
var printDir;
while ((printDir = cmdLine.handleFlagWithParam("print-xpcom-dir", false))) {
var out = "print-xpcom-dir(\"" + printDir + "\"): ";
@ -110,7 +110,7 @@ nsDefaultCLH.prototype = {
} catch (e) { }
},
helpInfo : "",
helpInfo: "",
};
this.NSGetFactory = XPCOMUtils.generateNSGetFactory([nsDefaultCLH]);

Просмотреть файл

@ -44,7 +44,7 @@ var gEnabled, gAutofillForms, gStoreWhenAutocompleteOff;
var gLastContextMenuEventTimeStamp = Number.NEGATIVE_INFINITY;
var observer = {
QueryInterface : XPCOMUtils.generateQI([Ci.nsIObserver,
QueryInterface: XPCOMUtils.generateQI([Ci.nsIObserver,
Ci.nsIFormSubmitObserver,
Ci.nsIWebProgressListener,
Ci.nsIDOMEventListener,
@ -161,7 +161,7 @@ function messageManagerFromWindow(win) {
// This object maps to the "child" process (even in the single-process case).
var LoginManagerContent = {
__formFillService : null, // FormFillController, for username autocompleting
__formFillService: null, // FormFillController, for username autocompleting
get _formFillService() {
if (!this.__formFillService)
this.__formFillService =
@ -693,7 +693,7 @@ var LoginManagerContent = {
}
pwFields[pwFields.length] = {
index : i,
index: i,
element
};
}
@ -744,8 +744,8 @@ var LoginManagerContent = {
// The field from the password override may be in a different FormLike.
let formLike = LoginFormFactory.createFromField(pwOverrideField);
pwFields = [{
index : [...formLike.elements].indexOf(pwOverrideField),
element : pwOverrideField,
index: [...formLike.elements].indexOf(pwOverrideField),
element: pwOverrideField,
}];
}
@ -1446,11 +1446,11 @@ function UserAutoCompleteResult(aSearchString, matchingLogins, {isSecure, messag
}
UserAutoCompleteResult.prototype = {
QueryInterface : XPCOMUtils.generateQI([Ci.nsIAutoCompleteResult,
QueryInterface: XPCOMUtils.generateQI([Ci.nsIAutoCompleteResult,
Ci.nsISupportsWeakReference]),
// private
logins : null,
logins: null,
// Allow autoCompleteSearch to get at the JS object so it can
// modify some readonly properties for internal use.
@ -1459,11 +1459,11 @@ UserAutoCompleteResult.prototype = {
},
// Interfaces from idl...
searchString : null,
searchResult : Ci.nsIAutoCompleteResult.RESULT_NOMATCH,
defaultIndex : -1,
errorDescription : "",
matchCount : 0,
searchString: null,
searchResult: Ci.nsIAutoCompleteResult.RESULT_NOMATCH,
defaultIndex: -1,
errorDescription: "",
matchCount: 0,
getValueAt(index) {
if (index < 0 || index >= this.matchCount) {

Просмотреть файл

@ -641,7 +641,7 @@ function CopyPassword() {
let clipboard = Cc["@mozilla.org/widget/clipboardhelper;1"].
getService(Ci.nsIClipboardHelper);
let row = signonsTree.currentIndex;
let password = signonsTreeView.getCellText(row, {id : "passwordCol" });
let password = signonsTreeView.getCellText(row, {id: "passwordCol" });
clipboard.copyString(password);
Services.telemetry.getHistogramById("PWMGR_MANAGE_COPIED_PASSWORD").add(1);
}
@ -651,7 +651,7 @@ function CopyUsername() {
let clipboard = Cc["@mozilla.org/widget/clipboardhelper;1"].
getService(Ci.nsIClipboardHelper);
let row = signonsTree.currentIndex;
let username = signonsTreeView.getCellText(row, {id : "userCol" });
let username = signonsTreeView.getCellText(row, {id: "userCol" });
clipboard.copyString(username);
Services.telemetry.getHistogramById("PWMGR_MANAGE_COPIED_USERNAME").add(1);
}

Просмотреть файл

@ -16,10 +16,10 @@ function LoginManagerCrypto_SDR() {
LoginManagerCrypto_SDR.prototype = {
classID : Components.ID("{dc6c2976-0f73-4f1f-b9ff-3d72b4e28309}"),
QueryInterface : XPCOMUtils.generateQI([Ci.nsILoginManagerCrypto]),
classID: Components.ID("{dc6c2976-0f73-4f1f-b9ff-3d72b4e28309}"),
QueryInterface: XPCOMUtils.generateQI([Ci.nsILoginManagerCrypto]),
__decoderRing : null, // nsSecretDecoderRing service
__decoderRing: null, // nsSecretDecoderRing service
get _decoderRing() {
if (!this.__decoderRing)
this.__decoderRing = Cc["@mozilla.org/security/sdr;1"].
@ -27,7 +27,7 @@ LoginManagerCrypto_SDR.prototype = {
return this.__decoderRing;
},
__utfConverter : null, // UCS2 <--> UTF8 string conversion
__utfConverter: null, // UCS2 <--> UTF8 string conversion
get _utfConverter() {
if (!this.__utfConverter) {
this.__utfConverter = Cc["@mozilla.org/intl/scriptableunicodeconverter"].
@ -41,7 +41,7 @@ LoginManagerCrypto_SDR.prototype = {
this.__utfConverter = null;
},
_uiBusy : false,
_uiBusy: false,
init() {

Просмотреть файл

@ -14,20 +14,20 @@ function nsLoginInfo() {}
nsLoginInfo.prototype = {
classID : Components.ID("{0f2f347c-1e4f-40cc-8efd-792dea70a85e}"),
classID: Components.ID("{0f2f347c-1e4f-40cc-8efd-792dea70a85e}"),
QueryInterface: XPCOMUtils.generateQI([Ci.nsILoginInfo, Ci.nsILoginMetaInfo]),
//
// nsILoginInfo interfaces...
//
hostname : null,
formSubmitURL : null,
httpRealm : null,
username : null,
password : null,
usernameField : null,
passwordField : null,
hostname: null,
formSubmitURL: null,
httpRealm: null,
username: null,
password: null,
usernameField: null,
passwordField: null,
init(aHostname, aFormSubmitURL, aHttpRealm,
aUsername, aPassword,
@ -82,11 +82,11 @@ nsLoginInfo.prototype = {
// nsILoginMetaInfo interfaces...
//
guid : null,
timeCreated : null,
timeLastUsed : null,
timePasswordChanged : null,
timesUsed : null
guid: null,
timeCreated: null,
timeLastUsed: null,
timePasswordChanged: null,
timesUsed: null
}; // end of nsLoginInfo implementation

Просмотреть файл

@ -40,11 +40,11 @@ function LoginManagerPromptFactory() {
LoginManagerPromptFactory.prototype = {
classID : Components.ID("{749e62f4-60ae-4569-a8a2-de78b649660e}"),
QueryInterface : XPCOMUtils.generateQI([Ci.nsIPromptFactory, Ci.nsIObserver, Ci.nsISupportsWeakReference]),
classID: Components.ID("{749e62f4-60ae-4569-a8a2-de78b649660e}"),
QueryInterface: XPCOMUtils.generateQI([Ci.nsIPromptFactory, Ci.nsIObserver, Ci.nsISupportsWeakReference]),
_asyncPrompts : {},
_asyncPromptInProgress : false,
_asyncPrompts: {},
_asyncPromptInProgress: false,
observe(subject, topic, data) {
this.log("Observed: " + topic);
@ -241,17 +241,17 @@ function LoginManagerPrompter() {}
LoginManagerPrompter.prototype = {
classID : Components.ID("{8aa66d77-1bbb-45a6-991e-b8f47751c291}"),
QueryInterface : XPCOMUtils.generateQI([Ci.nsIAuthPrompt,
classID: Components.ID("{8aa66d77-1bbb-45a6-991e-b8f47751c291}"),
QueryInterface: XPCOMUtils.generateQI([Ci.nsIAuthPrompt,
Ci.nsIAuthPrompt2,
Ci.nsILoginManagerPrompter]),
_factory : null,
_chromeWindow : null,
_browser : null,
_opener : null,
_factory: null,
_chromeWindow: null,
_browser: null,
_opener: null,
__pwmgr : null, // Password Manager service
__pwmgr: null, // Password Manager service
get _pwmgr() {
if (!this.__pwmgr)
this.__pwmgr = Cc["@mozilla.org/login-manager;1"].
@ -259,7 +259,7 @@ LoginManagerPrompter.prototype = {
return this.__pwmgr;
},
__promptService : null, // Prompt service for user interaction
__promptService: null, // Prompt service for user interaction
get _promptService() {
if (!this.__promptService)
this.__promptService =
@ -269,7 +269,7 @@ LoginManagerPrompter.prototype = {
},
__strBundle : null, // String bundle for L10N
__strBundle: null, // String bundle for L10N
get _strBundle() {
if (!this.__strBundle) {
var bunService = Cc["@mozilla.org/intl/stringbundle;1"].
@ -284,7 +284,7 @@ LoginManagerPrompter.prototype = {
},
__ellipsis : null,
__ellipsis: null,
get _ellipsis() {
if (!this.__ellipsis) {
this.__ellipsis = "\u2026";
@ -351,7 +351,7 @@ LoginManagerPrompter.prototype = {
Cr.NS_ERROR_NOT_IMPLEMENTED);
var selectedLogin = null;
var checkBox = { value : false };
var checkBox = { value: false };
var checkBoxLabel = null;
var [hostname, realm, unused] = this._getRealmInfo(aPasswordRealm);
@ -451,7 +451,7 @@ LoginManagerPrompter.prototype = {
throw new Components.Exception("promptPassword doesn't support SAVE_PASSWORD_FOR_SESSION",
Cr.NS_ERROR_NOT_IMPLEMENTED);
var checkBox = { value : false };
var checkBox = { value: false };
var checkBoxLabel = null;
var [hostname, realm, username] = this._getRealmInfo(aPasswordRealm);
@ -549,7 +549,7 @@ LoginManagerPrompter.prototype = {
*/
promptAuth(aChannel, aLevel, aAuthInfo) {
var selectedLogin = null;
var checkbox = { value : false };
var checkbox = { value: false };
var checkboxLabel = null;
var epicfail = false;
var canAutologin = false;
@ -708,7 +708,7 @@ LoginManagerPrompter.prototype = {
channel: aChannel,
authInfo: aAuthInfo,
level: aLevel,
inProgress : false,
inProgress: false,
prompter: this
};

Просмотреть файл

@ -47,8 +47,8 @@ function LoginManagerStorage_mozStorage() { }
LoginManagerStorage_mozStorage.prototype = {
classID : Components.ID("{8c2023b9-175c-477e-9761-44ae7b549756}"),
QueryInterface : XPCOMUtils.generateQI([Ci.nsILoginManagerStorage,
classID: Components.ID("{8c2023b9-175c-477e-9761-44ae7b549756}"),
QueryInterface: XPCOMUtils.generateQI([Ci.nsILoginManagerStorage,
Ci.nsIInterfaceRequestor]),
getInterface(aIID) {
if (aIID.equals(Ci.nsIVariant)) {
@ -63,7 +63,7 @@ LoginManagerStorage_mozStorage.prototype = {
throw new Components.Exception("Interface not available", Cr.NS_ERROR_NO_INTERFACE);
},
__crypto : null, // nsILoginManagerCrypto service
__crypto: null, // nsILoginManagerCrypto service
get _crypto() {
if (!this.__crypto)
this.__crypto = Cc["@mozilla.org/login-manager/crypto/SDR;1"].
@ -145,10 +145,10 @@ LoginManagerStorage_mozStorage.prototype = {
}
}
},
_dbConnection : null, // The database connection
_dbStmts : null, // Database statements for memoization
_dbConnection: null, // The database connection
_dbStmts: null, // Database statements for memoization
_signonsFile : null, // nsIFile for "signons.sqlite"
_signonsFile: null, // nsIFile for "signons.sqlite"
/*

Просмотреть файл

@ -96,23 +96,23 @@ add_task(function* setup() {
add_task(function* test_prompt_accept() {
state = {
msg : "the message",
title : "the title",
textValue : "abc",
passValue : "",
iconClass : "question-icon",
titleHidden : true,
textHidden : false,
passHidden : true,
checkHidden : true,
checkMsg : "",
checked : false,
focused : "textField",
defButton : "button0",
msg: "the message",
title: "the title",
textValue: "abc",
passValue: "",
iconClass: "question-icon",
titleHidden: true,
textHidden: false,
passHidden: true,
checkHidden: true,
checkMsg: "",
checked: false,
focused: "textField",
defButton: "button0",
};
action = {
buttonClick : "ok",
textField : "xyz",
buttonClick: "ok",
textField: "xyz",
};
promptDone = handlePrompt(state, action);
isOk = prompter1.prompt(defaultTitle, defaultMsg, "http://example.com",
@ -125,22 +125,22 @@ add_task(function* test_prompt_accept() {
add_task(function* test_prompt_cancel() {
state = {
msg : "the message",
title : "the title",
textValue : "abc",
passValue : "",
iconClass : "question-icon",
titleHidden : true,
textHidden : false,
passHidden : true,
checkHidden : true,
checkMsg : "",
checked : false,
focused : "textField",
defButton : "button0",
msg: "the message",
title: "the title",
textValue: "abc",
passValue: "",
iconClass: "question-icon",
titleHidden: true,
textHidden: false,
passHidden: true,
checkHidden: true,
checkMsg: "",
checked: false,
focused: "textField",
defButton: "button0",
};
action = {
buttonClick : "cancel",
buttonClick: "cancel",
};
promptDone = handlePrompt(state, action);
isOk = prompter1.prompt(defaultTitle, defaultMsg, "http://example.com",
@ -152,23 +152,23 @@ add_task(function* test_prompt_cancel() {
add_task(function* test_promptPassword_defaultAccept() {
// Default password provided, existing logins are ignored.
state = {
msg : "the message",
title : "the title",
textValue : "",
passValue : "inputpw",
iconClass : "authentication-icon question-icon",
titleHidden : true,
textHidden : true,
passHidden : false,
checkHidden : true,
checkMsg : "",
checked : false,
focused : "passField",
defButton : "button0",
msg: "the message",
title: "the title",
textValue: "",
passValue: "inputpw",
iconClass: "authentication-icon question-icon",
titleHidden: true,
textHidden: true,
passHidden: false,
checkHidden: true,
checkMsg: "",
checked: false,
focused: "passField",
defButton: "button0",
};
action = {
buttonClick : "ok",
passField : "secret",
buttonClick: "ok",
passField: "secret",
};
pword.value = "inputpw";
promptDone = handlePrompt(state, action);
@ -182,22 +182,22 @@ add_task(function* test_promptPassword_defaultAccept() {
add_task(function* test_promptPassword_defaultCancel() {
// Default password provided, existing logins are ignored.
state = {
msg : "the message",
title : "the title",
textValue : "",
passValue : "inputpw",
iconClass : "authentication-icon question-icon",
titleHidden : true,
textHidden : true,
passHidden : false,
checkHidden : true,
checkMsg : "",
checked : false,
focused : "passField",
defButton : "button0",
msg: "the message",
title: "the title",
textValue: "",
passValue: "inputpw",
iconClass: "authentication-icon question-icon",
titleHidden: true,
textHidden: true,
passHidden: false,
checkHidden: true,
checkMsg: "",
checked: false,
focused: "passField",
defButton: "button0",
};
action = {
buttonClick : "cancel",
buttonClick: "cancel",
};
pword.value = "inputpw";
promptDone = handlePrompt(state, action);
@ -210,23 +210,23 @@ add_task(function* test_promptPassword_defaultCancel() {
add_task(function* test_promptPassword_emptyAccept() {
// No default password provided, realm does not match existing login.
state = {
msg : "the message",
title : "the title",
textValue : "",
passValue : "",
iconClass : "authentication-icon question-icon",
titleHidden : true,
textHidden : true,
passHidden : false,
checkHidden : true,
checkMsg : "",
checked : false,
focused : "passField",
defButton : "button0",
msg: "the message",
title: "the title",
textValue: "",
passValue: "",
iconClass: "authentication-icon question-icon",
titleHidden: true,
textHidden: true,
passHidden: false,
checkHidden: true,
checkMsg: "",
checked: false,
focused: "passField",
defButton: "button0",
};
action = {
buttonClick : "ok",
passField : "secret",
buttonClick: "ok",
passField: "secret",
};
pword.value = null;
promptDone = handlePrompt(state, action);
@ -250,23 +250,23 @@ add_task(function* test_promptPassword_noMatchingPasswordForEmptyUN() {
// No default password provided, none of the logins from this host are
// password-only so the user is prompted.
state = {
msg : "the message",
title : "the title",
textValue : "",
passValue : "",
iconClass : "authentication-icon question-icon",
titleHidden : true,
textHidden : true,
passHidden : false,
checkHidden : true,
checkMsg : "",
checked : false,
focused : "passField",
defButton : "button0",
msg: "the message",
title: "the title",
textValue: "",
passValue: "",
iconClass: "authentication-icon question-icon",
titleHidden: true,
textHidden: true,
passHidden: false,
checkHidden: true,
checkMsg: "",
checked: false,
focused: "passField",
defButton: "button0",
};
action = {
buttonClick : "ok",
passField : "secret",
buttonClick: "ok",
passField: "secret",
};
pword.value = null;
promptDone = handlePrompt(state, action);
@ -327,23 +327,23 @@ add_task(function* test_promptPassword_usernameEncoding() {
add_task(function* test_promptPassword_realm() {
// We don't pre-fill or save for NS_GetAuthKey-generated realms, but we should still prompt
state = {
msg : "the message",
title : "the title",
textValue : "",
passValue : "",
iconClass : "authentication-icon question-icon",
titleHidden : true,
textHidden : true,
passHidden : false,
checkHidden : true,
checkMsg : "",
checked : false,
focused : "passField",
defButton : "button0",
msg: "the message",
title: "the title",
textValue: "",
passValue: "",
iconClass: "authentication-icon question-icon",
titleHidden: true,
textHidden: true,
passHidden: false,
checkHidden: true,
checkMsg: "",
checked: false,
focused: "passField",
defButton: "button0",
};
action = {
buttonClick : "ok",
passField : "fill2pass",
buttonClick: "ok",
passField: "fill2pass",
};
pword.value = null;
promptDone = handlePrompt(state, action);
@ -357,23 +357,23 @@ add_task(function* test_promptPassword_realm() {
add_task(function* test_promptPassword_realm2() {
// We don't pre-fill or save for NS_GetAuthKey-generated realms, but we should still prompt
state = {
msg : "the message",
title : "the title",
textValue : "",
passValue : "",
iconClass : "authentication-icon question-icon",
titleHidden : true,
textHidden : true,
passHidden : false,
checkHidden : true,
checkMsg : "",
checked : false,
focused : "passField",
defButton : "button0",
msg: "the message",
title: "the title",
textValue: "",
passValue: "",
iconClass: "authentication-icon question-icon",
titleHidden: true,
textHidden: true,
passHidden: false,
checkHidden: true,
checkMsg: "",
checked: false,
focused: "passField",
defButton: "button0",
};
action = {
buttonClick : "ok",
passField : "fill2pass",
buttonClick: "ok",
passField: "fill2pass",
};
pword.value = null;
promptDone = handlePrompt(state, action);
@ -386,24 +386,24 @@ add_task(function* test_promptPassword_realm2() {
add_task(function* test_promptUsernameAndPassword_accept() {
state = {
msg : "the message",
title : "the title",
textValue : "inuser",
passValue : "inpass",
iconClass : "authentication-icon question-icon",
titleHidden : true,
textHidden : false,
passHidden : false,
checkHidden : true,
checkMsg : "",
checked : false,
focused : "textField",
defButton : "button0",
msg: "the message",
title: "the title",
textValue: "inuser",
passValue: "inpass",
iconClass: "authentication-icon question-icon",
titleHidden: true,
textHidden: false,
passHidden: false,
checkHidden: true,
checkMsg: "",
checked: false,
focused: "textField",
defButton: "button0",
};
action = {
buttonClick : "ok",
textField : "outuser",
passField : "outpass",
buttonClick: "ok",
textField: "outuser",
passField: "outpass",
};
uname.value = "inuser";
pword.value = "inpass";
@ -418,22 +418,22 @@ add_task(function* test_promptUsernameAndPassword_accept() {
add_task(function* test_promptUsernameAndPassword_cancel() {
state = {
msg : "the message",
title : "the title",
textValue : "inuser",
passValue : "inpass",
iconClass : "authentication-icon question-icon",
titleHidden : true,
textHidden : false,
passHidden : false,
checkHidden : true,
checkMsg : "",
checked : false,
focused : "textField",
defButton : "button0",
msg: "the message",
title: "the title",
textValue: "inuser",
passValue: "inpass",
iconClass: "authentication-icon question-icon",
titleHidden: true,
textHidden: false,
passHidden: false,
checkHidden: true,
checkMsg: "",
checked: false,
focused: "textField",
defButton: "button0",
};
action = {
buttonClick : "cancel",
buttonClick: "cancel",
};
uname.value = "inuser";
pword.value = "inpass";
@ -447,22 +447,22 @@ add_task(function* test_promptUsernameAndPassword_cancel() {
add_task(function* test_promptUsernameAndPassword_autofill() {
// test filling in existing password-only login
state = {
msg : "the message",
title : "the title",
textValue : "",
passValue : "examplepass",
iconClass : "authentication-icon question-icon",
titleHidden : true,
textHidden : false,
passHidden : false,
checkHidden : false,
checkMsg : "Use Password Manager to remember this password.",
checked : true,
focused : "textField",
defButton : "button0",
msg: "the message",
title: "the title",
textValue: "",
passValue: "examplepass",
iconClass: "authentication-icon question-icon",
titleHidden: true,
textHidden: false,
passHidden: false,
checkHidden: false,
checkMsg: "Use Password Manager to remember this password.",
checked: true,
focused: "textField",
defButton: "button0",
};
action = {
buttonClick : "ok",
buttonClick: "ok",
};
uname.value = null;
pword.value = null;
@ -479,22 +479,22 @@ add_task(function* test_promptUsernameAndPassword_multipleExisting() {
// test filling in existing login (undetermined from multiple selection)
// user2name/user2pass would also be valid to fill here.
state = {
msg : "the message",
title : "the title",
textValue : "user1name",
passValue : "user1pass",
iconClass : "authentication-icon question-icon",
titleHidden : true,
textHidden : false,
passHidden : false,
checkHidden : false,
checkMsg : "Use Password Manager to remember this password.",
checked : true,
focused : "textField",
defButton : "button0",
msg: "the message",
title: "the title",
textValue: "user1name",
passValue: "user1pass",
iconClass: "authentication-icon question-icon",
titleHidden: true,
textHidden: false,
passHidden: false,
checkHidden: false,
checkMsg: "Use Password Manager to remember this password.",
checked: true,
focused: "textField",
defButton: "button0",
};
action = {
buttonClick : "ok",
buttonClick: "ok",
};
uname.value = null;
pword.value = null;
@ -510,22 +510,22 @@ add_task(function* test_promptUsernameAndPassword_multipleExisting() {
add_task(function* test_promptUsernameAndPassword_multipleExisting1() {
// test filling in existing login (user1 from multiple selection)
state = {
msg : "the message",
title : "the title",
textValue : "user1name",
passValue : "user1pass",
iconClass : "authentication-icon question-icon",
titleHidden : true,
textHidden : false,
passHidden : false,
checkHidden : false,
checkMsg : "Use Password Manager to remember this password.",
checked : true,
focused : "textField",
defButton : "button0",
msg: "the message",
title: "the title",
textValue: "user1name",
passValue: "user1pass",
iconClass: "authentication-icon question-icon",
titleHidden: true,
textHidden: false,
passHidden: false,
checkHidden: false,
checkMsg: "Use Password Manager to remember this password.",
checked: true,
focused: "textField",
defButton: "button0",
};
action = {
buttonClick : "ok",
buttonClick: "ok",
};
uname.value = "user1name";
pword.value = null;
@ -541,22 +541,22 @@ add_task(function* test_promptUsernameAndPassword_multipleExisting1() {
add_task(function* test_promptUsernameAndPassword_multipleExisting2() {
// test filling in existing login (user2 from multiple selection)
state = {
msg : "the message",
title : "the title",
textValue : "user2name",
passValue : "user2pass",
iconClass : "authentication-icon question-icon",
titleHidden : true,
textHidden : false,
passHidden : false,
checkHidden : false,
checkMsg : "Use Password Manager to remember this password.",
checked : true,
focused : "textField",
defButton : "button0",
msg: "the message",
title: "the title",
textValue: "user2name",
passValue: "user2pass",
iconClass: "authentication-icon question-icon",
titleHidden: true,
textHidden: false,
passHidden: false,
checkHidden: false,
checkMsg: "Use Password Manager to remember this password.",
checked: true,
focused: "textField",
defButton: "button0",
};
action = {
buttonClick : "ok",
buttonClick: "ok",
};
uname.value = "user2name";
pword.value = null;
@ -572,23 +572,23 @@ add_task(function* test_promptUsernameAndPassword_multipleExisting2() {
add_task(function* test_promptUsernameAndPassword_passwordChange() {
// test changing password
state = {
msg : "the message",
title : "the title",
textValue : "user2name",
passValue : "user2pass",
iconClass : "authentication-icon question-icon",
titleHidden : true,
textHidden : false,
passHidden : false,
checkHidden : false,
checkMsg : "Use Password Manager to remember this password.",
checked : true,
focused : "textField",
defButton : "button0",
msg: "the message",
title: "the title",
textValue: "user2name",
passValue: "user2pass",
iconClass: "authentication-icon question-icon",
titleHidden: true,
textHidden: false,
passHidden: false,
checkHidden: false,
checkMsg: "Use Password Manager to remember this password.",
checked: true,
focused: "textField",
defButton: "button0",
};
action = {
buttonClick : "ok",
passField : "NEWuser2pass",
buttonClick: "ok",
passField: "NEWuser2pass",
};
uname.value = "user2name";
pword.value = null;
@ -604,23 +604,23 @@ add_task(function* test_promptUsernameAndPassword_passwordChange() {
add_task(function* test_promptUsernameAndPassword_changePasswordBack() {
// test changing password (back to original value)
state = {
msg : "the message",
title : "the title",
textValue : "user2name",
passValue : "NEWuser2pass",
iconClass : "authentication-icon question-icon",
titleHidden : true,
textHidden : false,
passHidden : false,
checkHidden : false,
checkMsg : "Use Password Manager to remember this password.",
checked : true,
focused : "textField",
defButton : "button0",
msg: "the message",
title: "the title",
textValue: "user2name",
passValue: "NEWuser2pass",
iconClass: "authentication-icon question-icon",
titleHidden: true,
textHidden: false,
passHidden: false,
checkHidden: false,
checkMsg: "Use Password Manager to remember this password.",
checked: true,
focused: "textField",
defButton: "button0",
};
action = {
buttonClick : "ok",
passField : "user2pass",
buttonClick: "ok",
passField: "user2pass",
};
uname.value = "user2name";
pword.value = null;
@ -636,24 +636,24 @@ add_task(function* test_promptUsernameAndPassword_changePasswordBack() {
add_task(function* test_promptUsernameAndPassword_realm() {
// We don't pre-fill or save for NS_GetAuthKey-generated realms, but we should still prompt
state = {
msg : "the message",
title : "the title",
textValue : "",
passValue : "",
iconClass : "authentication-icon question-icon",
titleHidden : true,
textHidden : false,
passHidden : false,
checkHidden : true,
checkMsg : "",
checked : false,
focused : "textField",
defButton : "button0",
msg: "the message",
title: "the title",
textValue: "",
passValue: "",
iconClass: "authentication-icon question-icon",
titleHidden: true,
textHidden: false,
passHidden: false,
checkHidden: true,
checkMsg: "",
checked: false,
focused: "textField",
defButton: "button0",
};
action = {
buttonClick : "ok",
textField : "fill2user",
passField : "fill2pass",
buttonClick: "ok",
textField: "fill2user",
passField: "fill2pass",
};
uname.value = null;
pword.value = null;
@ -669,24 +669,24 @@ add_task(function* test_promptUsernameAndPassword_realm() {
add_task(function* test_promptUsernameAndPassword_realm2() {
// We don't pre-fill or save for NS_GetAuthKey-generated realms, but we should still prompt
state = {
msg : "the message",
title : "the title",
textValue : "",
passValue : "",
iconClass : "authentication-icon question-icon",
titleHidden : true,
textHidden : false,
passHidden : false,
checkHidden : true,
checkMsg : "",
checked : false,
focused : "textField",
defButton : "button0",
msg: "the message",
title: "the title",
textValue: "",
passValue: "",
iconClass: "authentication-icon question-icon",
titleHidden: true,
textHidden: false,
passHidden: false,
checkHidden: true,
checkMsg: "",
checked: false,
focused: "textField",
defButton: "button0",
};
action = {
buttonClick : "ok",
textField : "fill2user",
passField : "fill2pass",
buttonClick: "ok",
textField: "fill2user",
passField: "fill2pass",
};
uname.value = null;
pword.value = null;

Просмотреть файл

@ -80,22 +80,22 @@ runInParent(() => {
add_task(function* test_iframe() {
let state = {
msg : "http://mochi.test:8888 is requesting your username and password. The site says: “mochitest”",
title : "Authentication Required",
textValue : "mochiuser1",
passValue : "mochipass1",
iconClass : "authentication-icon question-icon",
titleHidden : true,
textHidden : false,
passHidden : false,
checkHidden : true,
checkMsg : "",
checked : false,
focused : "textField",
defButton : "button0",
msg: "http://mochi.test:8888 is requesting your username and password. The site says: “mochitest”",
title: "Authentication Required",
textValue: "mochiuser1",
passValue: "mochipass1",
iconClass: "authentication-icon question-icon",
titleHidden: true,
textHidden: false,
passHidden: false,
checkHidden: true,
checkMsg: "",
checked: false,
focused: "textField",
defButton: "button0",
};
let action = {
buttonClick : "ok",
buttonClick: "ok",
};
promptDone = handlePrompt(state, action);
@ -109,22 +109,22 @@ add_task(function* test_iframe() {
iframe.contentDocument);
state = {
msg : "http://mochi.test:8888 is requesting your username and password. The site says: “mochitest2”",
title : "Authentication Required",
textValue : "mochiuser2",
passValue : "mochipass2",
iconClass : "authentication-icon question-icon",
titleHidden : true,
textHidden : false,
passHidden : false,
checkHidden : true,
checkMsg : "",
checked : false,
focused : "textField",
defButton : "button0",
msg: "http://mochi.test:8888 is requesting your username and password. The site says: “mochitest2”",
title: "Authentication Required",
textValue: "mochiuser2",
passValue: "mochipass2",
iconClass: "authentication-icon question-icon",
titleHidden: true,
textHidden: false,
passHidden: false,
checkHidden: true,
checkMsg: "",
checked: false,
focused: "textField",
defButton: "button0",
};
action = {
buttonClick : "ok",
buttonClick: "ok",
};
promptDone = handlePrompt(state, action);
// We've already authenticated to this host:port. For this next
@ -150,23 +150,23 @@ add_task(function* test_iframe() {
// expected password (to trigger an auth prompt, and change-password
// popup notification).
state = {
msg : "http://mochi.test:8888 is requesting your username and password. The site says: “mochitest”",
title : "Authentication Required",
textValue : "mochiuser1",
passValue : "mochipass1",
iconClass : "authentication-icon question-icon",
titleHidden : true,
textHidden : false,
passHidden : false,
checkHidden : true,
checkMsg : "",
checked : false,
focused : "textField",
defButton : "button0",
msg: "http://mochi.test:8888 is requesting your username and password. The site says: “mochitest”",
title: "Authentication Required",
textValue: "mochiuser1",
passValue: "mochipass1",
iconClass: "authentication-icon question-icon",
titleHidden: true,
textHidden: false,
passHidden: false,
checkHidden: true,
checkMsg: "",
checked: false,
focused: "textField",
defButton: "button0",
};
action = {
buttonClick : "ok",
passField : "mochipass1-new",
buttonClick: "ok",
passField: "mochipass1-new",
};
promptDone = handlePrompt(state, action);
iframeLoaded = onloadPromiseFor("iframe");
@ -182,23 +182,23 @@ add_task(function* test_iframe() {
// to (but have an existing saved login for, so that we'll trigger
// a change-password popup notification.
state = {
msg : "http://mochi.test:8888 is requesting your username and password. The site says: “mochitest3”",
title : "Authentication Required",
textValue : "mochiuser3",
passValue : "mochipass3-old",
iconClass : "authentication-icon question-icon",
titleHidden : true,
textHidden : false,
passHidden : false,
checkHidden : true,
checkMsg : "",
checked : false,
focused : "textField",
defButton : "button0",
msg: "http://mochi.test:8888 is requesting your username and password. The site says: “mochitest3”",
title: "Authentication Required",
textValue: "mochiuser3",
passValue: "mochipass3-old",
iconClass: "authentication-icon question-icon",
titleHidden: true,
textHidden: false,
passHidden: false,
checkHidden: true,
checkMsg: "",
checked: false,
focused: "textField",
defButton: "button0",
};
action = {
buttonClick : "ok",
passField : "mochipass3-new",
buttonClick: "ok",
passField: "mochipass3-new",
};
promptDone = handlePrompt(state, action);
iframeLoaded = onloadPromiseFor("iframe");
@ -228,24 +228,24 @@ add_task(function* test_iframe() {
});
state = {
msg : "http://mochi.test:8888 is requesting your username and password. The site says: “mochitest3”",
title : "Authentication Required",
textValue : "",
passValue : "",
iconClass : "authentication-icon question-icon",
titleHidden : true,
textHidden : false,
passHidden : false,
checkHidden : true,
checkMsg : "",
checked : false,
focused : "textField",
defButton : "button0",
msg: "http://mochi.test:8888 is requesting your username and password. The site says: “mochitest3”",
title: "Authentication Required",
textValue: "",
passValue: "",
iconClass: "authentication-icon question-icon",
titleHidden: true,
textHidden: false,
passHidden: false,
checkHidden: true,
checkMsg: "",
checked: false,
focused: "textField",
defButton: "button0",
};
action = {
buttonClick : "ok",
textField : "mochiuser3",
passField : "mochipass3-old",
buttonClick: "ok",
textField: "mochiuser3",
passField: "mochipass3-old",
};
// Trigger a new prompt, so we can test adding a new login.
promptDone = handlePrompt(state, action);
@ -262,23 +262,23 @@ add_task(function* test_iframe() {
add_task(function* test_schemeUpgrade() {
let state = {
msg : "https://example.com is requesting your username and password. " +
msg: "https://example.com is requesting your username and password. " +
"WARNING: Your password will not be sent to the website you are currently visiting!",
title : "Authentication Required",
textValue : "httpUser",
passValue : "httpPass",
iconClass : "authentication-icon question-icon",
titleHidden : true,
textHidden : false,
passHidden : false,
checkHidden : true,
checkMsg : "",
checked : false,
focused : "textField",
defButton : "button0",
title: "Authentication Required",
textValue: "httpUser",
passValue: "httpPass",
iconClass: "authentication-icon question-icon",
titleHidden: true,
textHidden: false,
passHidden: false,
checkHidden: true,
checkMsg: "",
checked: false,
focused: "textField",
defButton: "button0",
};
let action = {
buttonClick : "ok",
buttonClick: "ok",
};
let promptDone = handlePrompt(state, action);
@ -295,23 +295,23 @@ add_task(function* test_schemeUpgrade() {
add_task(function* test_schemeDowngrade() {
let state = {
msg : "http://example.com is requesting your username and password. " +
msg: "http://example.com is requesting your username and password. " +
"WARNING: Your password will not be sent to the website you are currently visiting!",
title : "Authentication Required",
textValue : "", // empty because we shouldn't downgrade
passValue : "",
iconClass : "authentication-icon question-icon",
titleHidden : true,
textHidden : false,
passHidden : false,
checkHidden : true,
checkMsg : "",
checked : false,
focused : "textField",
defButton : "button0",
title: "Authentication Required",
textValue: "", // empty because we shouldn't downgrade
passValue: "",
iconClass: "authentication-icon question-icon",
titleHidden: true,
textHidden: false,
passHidden: false,
checkHidden: true,
checkMsg: "",
checked: false,
focused: "textField",
defButton: "button0",
};
let action = {
buttonClick : "cancel",
buttonClick: "cancel",
};
let promptDone = handlePrompt(state, action);
@ -326,23 +326,23 @@ add_task(function* test_schemeDowngrade() {
add_task(function* test_schemeUpgrade_dedupe() {
let state = {
msg : "https://example.org is requesting your username and password. " +
msg: "https://example.org is requesting your username and password. " +
"WARNING: Your password will not be sent to the website you are currently visiting!",
title : "Authentication Required",
textValue : "dedupeUser",
passValue : "httpsPass",
iconClass : "authentication-icon question-icon",
titleHidden : true,
textHidden : false,
passHidden : false,
checkHidden : true,
checkMsg : "",
checked : false,
focused : "textField",
defButton : "button0",
title: "Authentication Required",
textValue: "dedupeUser",
passValue: "httpsPass",
iconClass: "authentication-icon question-icon",
titleHidden: true,
textHidden: false,
passHidden: false,
checkHidden: true,
checkMsg: "",
checked: false,
focused: "textField",
defButton: "button0",
};
let action = {
buttonClick : "ok",
buttonClick: "ok",
};
let promptDone = handlePrompt(state, action);

Просмотреть файл

@ -36,22 +36,22 @@ runInParent(() => {
add_task(function* test_sandbox_xhr() {
let state = {
msg : "http://mochi.test:8888 is requesting your username and password. The site says: “mochitest”",
title : "Authentication Required",
textValue : "mochiuser1",
passValue : "mochipass1",
iconClass : "authentication-icon question-icon",
titleHidden : true,
textHidden : false,
passHidden : false,
checkHidden : true,
checkMsg : "",
checked : false,
focused : "textField",
defButton : "button0",
msg: "http://mochi.test:8888 is requesting your username and password. The site says: “mochitest”",
title: "Authentication Required",
textValue: "mochiuser1",
passValue: "mochipass1",
iconClass: "authentication-icon question-icon",
titleHidden: true,
textHidden: false,
passHidden: false,
checkHidden: true,
checkMsg: "",
checked: false,
focused: "textField",
defButton: "button0",
};
let action = {
buttonClick : "ok",
buttonClick: "ok",
};
let promptDone = handlePrompt(state, action);

Просмотреть файл

@ -22,13 +22,13 @@ var isOk;
var level = Ci.nsIAuthPrompt2.LEVEL_NONE;
var authinfo = {
username : "",
password : "",
domain : "",
username: "",
password: "",
domain: "",
flags : Ci.nsIAuthInformation.AUTH_HOST,
authenticationScheme : "basic",
realm : ""
flags: Ci.nsIAuthInformation.AUTH_HOST,
authenticationScheme: "basic",
realm: ""
};
// Force parent to not look for tab-modal prompts, as they're not used for auth prompts.
@ -125,24 +125,24 @@ let prompter2 = new PrompterProxy(prompterParent);
add_task(function* test_accept() {
state = {
msg : "http://example.com is requesting your username and password. The site says: “some realm”",
title : "Authentication Required",
textValue : "inuser",
passValue : "inpass",
iconClass : "authentication-icon question-icon",
titleHidden : true,
textHidden : false,
passHidden : false,
checkHidden : true,
checkMsg : "",
checked : false,
focused : "textField",
defButton : "button0",
msg: "http://example.com is requesting your username and password. The site says: “some realm”",
title: "Authentication Required",
textValue: "inuser",
passValue: "inpass",
iconClass: "authentication-icon question-icon",
titleHidden: true,
textHidden: false,
passHidden: false,
checkHidden: true,
checkMsg: "",
checked: false,
focused: "textField",
defButton: "button0",
};
action = {
buttonClick : "ok",
textField : "outuser",
passField : "outpass",
buttonClick: "ok",
textField: "outuser",
passField: "outpass",
};
authinfo.username = "inuser";
authinfo.password = "inpass";
@ -162,22 +162,22 @@ add_task(function* test_accept() {
add_task(function* test_cancel() {
state = {
msg : "http://example.com is requesting your username and password. The site says: “some realm”",
title : "Authentication Required",
textValue : "outuser",
passValue : "outpass",
iconClass : "authentication-icon question-icon",
titleHidden : true,
textHidden : false,
passHidden : false,
checkHidden : true,
checkMsg : "",
checked : false,
focused : "textField",
defButton : "button0",
msg: "http://example.com is requesting your username and password. The site says: “some realm”",
title: "Authentication Required",
textValue: "outuser",
passValue: "outpass",
iconClass: "authentication-icon question-icon",
titleHidden: true,
textHidden: false,
passHidden: false,
checkHidden: true,
checkMsg: "",
checked: false,
focused: "textField",
defButton: "button0",
};
action = {
buttonClick : "cancel",
buttonClick: "cancel",
};
promptDone = handlePrompt(state, action);
isOk = prompter2.promptAuth("channel1", level, authinfo);
@ -189,22 +189,22 @@ add_task(function* test_cancel() {
add_task(function* test_pwonly() {
// test filling in password-only login
state = {
msg : "http://example.com is requesting your username and password. The site says: “http://example.com”",
title : "Authentication Required",
textValue : "",
passValue : "examplepass",
iconClass : "authentication-icon question-icon",
titleHidden : true,
textHidden : false,
passHidden : false,
checkHidden : true,
checkMsg : "",
checked : false,
focused : "textField",
defButton : "button0",
msg: "http://example.com is requesting your username and password. The site says: “http://example.com”",
title: "Authentication Required",
textValue: "",
passValue: "examplepass",
iconClass: "authentication-icon question-icon",
titleHidden: true,
textHidden: false,
passHidden: false,
checkHidden: true,
checkMsg: "",
checked: false,
focused: "textField",
defButton: "button0",
};
action = {
buttonClick : "ok",
buttonClick: "ok",
};
authinfo.username = "";
authinfo.password = "";
@ -223,22 +223,22 @@ add_task(function* test_multipleExisting() {
// test filling in existing login (undetermined from multiple selection)
// user2name/user2pass would also be valid to fill here.
state = {
msg : "http://example2.com is requesting your username and password. The site says: “http://example2.com”",
title : "Authentication Required",
textValue : "user1name",
passValue : "user1pass",
iconClass : "authentication-icon question-icon",
titleHidden : true,
textHidden : false,
passHidden : false,
checkHidden : true,
checkMsg : "",
checked : false,
focused : "textField",
defButton : "button0",
msg: "http://example2.com is requesting your username and password. The site says: “http://example2.com”",
title: "Authentication Required",
textValue: "user1name",
passValue: "user1pass",
iconClass: "authentication-icon question-icon",
titleHidden: true,
textHidden: false,
passHidden: false,
checkHidden: true,
checkMsg: "",
checked: false,
focused: "textField",
defButton: "button0",
};
action = {
buttonClick : "ok",
buttonClick: "ok",
};
authinfo.username = "";
authinfo.password = "";
@ -257,25 +257,25 @@ add_task(function* test_multipleExisting2() {
// test filling in existing login (undetermined --> user1)
// user2name/user2pass would also be valid to fill here.
state = {
msg : "http://example2.com is requesting your username and password. The site says: “http://example2.com”",
title : "Authentication Required",
textValue : "user1name",
passValue : "user1pass",
iconClass : "authentication-icon question-icon",
titleHidden : true,
textHidden : false,
passHidden : false,
checkHidden : true,
checkMsg : "",
checked : false,
focused : "textField",
defButton : "button0",
msg: "http://example2.com is requesting your username and password. The site says: “http://example2.com”",
title: "Authentication Required",
textValue: "user1name",
passValue: "user1pass",
iconClass: "authentication-icon question-icon",
titleHidden: true,
textHidden: false,
passHidden: false,
checkHidden: true,
checkMsg: "",
checked: false,
focused: "textField",
defButton: "button0",
};
// enter one of the known logins, test 504+505 exercise the two possible states.
action = {
buttonClick : "ok",
textField : "user1name",
passField : "user1pass",
buttonClick: "ok",
textField: "user1name",
passField: "user1pass",
};
authinfo.username = "";
authinfo.password = "";
@ -294,25 +294,25 @@ add_task(function* test_multipleExisting3() {
// test filling in existing login (undetermined --> user2)
// user2name/user2pass would also be valid to fill here.
state = {
msg : "http://example2.com is requesting your username and password. The site says: “http://example2.com”",
title : "Authentication Required",
textValue : "user1name",
passValue : "user1pass",
iconClass : "authentication-icon question-icon",
titleHidden : true,
textHidden : false,
passHidden : false,
checkHidden : true,
checkMsg : "",
checked : false,
focused : "textField",
defButton : "button0",
msg: "http://example2.com is requesting your username and password. The site says: “http://example2.com”",
title: "Authentication Required",
textValue: "user1name",
passValue: "user1pass",
iconClass: "authentication-icon question-icon",
titleHidden: true,
textHidden: false,
passHidden: false,
checkHidden: true,
checkMsg: "",
checked: false,
focused: "textField",
defButton: "button0",
};
// enter one of the known logins, test 504+505 exercise the two possible states.
action = {
buttonClick : "ok",
textField : "user2name",
passField : "user2pass",
buttonClick: "ok",
textField: "user2name",
passField: "user2pass",
};
authinfo.username = "";
authinfo.password = "";
@ -331,25 +331,25 @@ add_task(function* test_changingMultiple() {
// test changing a password (undetermined --> user2 w/ newpass)
// user2name/user2pass would also be valid to fill here.
state = {
msg : "http://example2.com is requesting your username and password. The site says: “http://example2.com”",
title : "Authentication Required",
textValue : "user1name",
passValue : "user1pass",
iconClass : "authentication-icon question-icon",
titleHidden : true,
textHidden : false,
passHidden : false,
checkHidden : true,
checkMsg : "",
checked : false,
focused : "textField",
defButton : "button0",
msg: "http://example2.com is requesting your username and password. The site says: “http://example2.com”",
title: "Authentication Required",
textValue: "user1name",
passValue: "user1pass",
iconClass: "authentication-icon question-icon",
titleHidden: true,
textHidden: false,
passHidden: false,
checkHidden: true,
checkMsg: "",
checked: false,
focused: "textField",
defButton: "button0",
};
// force to user2, and change the password
action = {
buttonClick : "ok",
textField : "user2name",
passField : "NEWuser2pass",
buttonClick: "ok",
textField: "user2name",
passField: "NEWuser2pass",
};
authinfo.username = "";
authinfo.password = "";
@ -368,25 +368,25 @@ add_task(function* test_changingMultiple2() {
// test changing a password (undetermined --> user2 w/ origpass)
// user2name/user2pass would also be valid to fill here.
state = {
msg : "http://example2.com is requesting your username and password. The site says: “http://example2.com”",
title : "Authentication Required",
textValue : "user1name",
passValue : "user1pass",
iconClass : "authentication-icon question-icon",
titleHidden : true,
textHidden : false,
passHidden : false,
checkHidden : true,
checkMsg : "",
checked : false,
focused : "textField",
defButton : "button0",
msg: "http://example2.com is requesting your username and password. The site says: “http://example2.com”",
title: "Authentication Required",
textValue: "user1name",
passValue: "user1pass",
iconClass: "authentication-icon question-icon",
titleHidden: true,
textHidden: false,
passHidden: false,
checkHidden: true,
checkMsg: "",
checked: false,
focused: "textField",
defButton: "button0",
};
// force to user2, and change the password back
action = {
buttonClick : "ok",
textField : "user2name",
passField : "user2pass",
buttonClick: "ok",
textField: "user2name",
passField: "user2pass",
};
authinfo.username = "";
authinfo.password = "";

Просмотреть файл

@ -32,13 +32,13 @@ var prefs = Cc["@mozilla.org/preferences-service;1"].getService(Ci.nsIPrefBranch
var level = Ci.nsIAuthPrompt2.LEVEL_NONE;
var proxyAuthinfo = {
username : "",
password : "",
domain : "",
username: "",
password: "",
domain: "",
flags : Ci.nsIAuthInformation.AUTH_PROXY,
authenticationScheme : "basic",
realm : ""
flags: Ci.nsIAuthInformation.AUTH_PROXY,
authenticationScheme: "basic",
realm: ""
};
// Force parent to not look for tab-modal prompts, as they're not used for auth prompts.
@ -142,22 +142,22 @@ add_task(function* setup() {
add_task(function* test_noAutologin() {
// test proxy login (default = no autologin), make sure it prompts.
state = {
msg : "The proxy moz-proxy://127.0.0.1:8888 is requesting a username and password. The site says: “Proxy Realm”",
title : "Authentication Required",
textValue : "proxuser",
passValue : "proxpass",
iconClass : "authentication-icon question-icon",
titleHidden : true,
textHidden : false,
passHidden : false,
checkHidden : true,
checkMsg : "",
checked : false,
focused : "textField",
defButton : "button0",
msg: "The proxy moz-proxy://127.0.0.1:8888 is requesting a username and password. The site says: “Proxy Realm”",
title: "Authentication Required",
textValue: "proxuser",
passValue: "proxpass",
iconClass: "authentication-icon question-icon",
titleHidden: true,
textHidden: false,
passHidden: false,
checkHidden: true,
checkMsg: "",
checked: false,
focused: "textField",
defButton: "button0",
};
action = {
buttonClick : "ok",
buttonClick: "ok",
};
proxyAuthinfo.username = "";
proxyAuthinfo.password = "";
@ -200,22 +200,22 @@ add_task(function* test_autologin() {
add_task(function* test_autologin_incorrect() {
// test proxy login (with autologin), ensure it prompts after a failed auth.
state = {
msg : "The proxy moz-proxy://127.0.0.1:8888 is requesting a username and password. The site says: “Proxy Realm”",
title : "Authentication Required",
textValue : "proxuser",
passValue : "proxpass",
iconClass : "authentication-icon question-icon",
titleHidden : true,
textHidden : false,
passHidden : false,
checkHidden : true,
checkMsg : "",
checked : false,
focused : "textField",
defButton : "button0",
msg: "The proxy moz-proxy://127.0.0.1:8888 is requesting a username and password. The site says: “Proxy Realm”",
title: "Authentication Required",
textValue: "proxuser",
passValue: "proxpass",
iconClass: "authentication-icon question-icon",
titleHidden: true,
textHidden: false,
passHidden: false,
checkHidden: true,
checkMsg: "",
checked: false,
focused: "textField",
defButton: "button0",
};
action = {
buttonClick : "ok",
buttonClick: "ok",
};
proxyAuthinfo.username = "";
@ -238,13 +238,13 @@ add_task(function* test_autologin_incorrect() {
add_task(function* test_autologin_private() {
// test proxy login (with autologin), ensure it prompts in Private Browsing mode.
state = {
msg : "the message",
title : "the title",
textValue : "proxuser",
passValue : "proxpass",
msg: "the message",
title: "the title",
textValue: "proxuser",
passValue: "proxpass",
};
action = {
buttonClick : "ok",
buttonClick: "ok",
};
proxyAuthinfo.username = "";

Просмотреть файл

@ -36,8 +36,8 @@
* we need to do SpecialPowers.wrapCallbackObject directly on the prototype.
*/
dialogMonitor.prototype = SpecialPowers.wrapCallbackObject({
windowsOpen : 0,
windowsRegistered : 0,
windowsOpen: 0,
windowsRegistered: 0,
QueryInterface(iid) {
const interfaces = [Ci.nsIObserver, Ci.nsISupports];

Просмотреть файл

@ -6,7 +6,7 @@ var expectedNotification;
var expectedData;
var TestObserver = {
QueryInterface : XPCOMUtils.generateQI([Ci.nsIObserver, Ci.nsISupportsWeakReference]),
QueryInterface: XPCOMUtils.generateQI([Ci.nsIObserver, Ci.nsISupportsWeakReference]),
observe(subject, topic, data) {
do_check_eq(topic, "passwordmgr-storage-changed");

Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше